Package me.ahoo.cosid.segment
Class SegmentChainId
java.lang.Object
me.ahoo.cosid.segment.SegmentChainId
- All Implemented Interfaces:
IdGenerator
,SegmentId
,Statistical
,StringIdGenerator
Segment chain algorithm ID generator.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSegmentChainId
(long idSegmentTtl, int safeDistance, IdSegmentDistributor maxIdDistributor, PrefetchWorkerExecutorService prefetchWorkerExecutorService) SegmentChainId
(IdSegmentDistributor maxIdDistributor) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.ahoo.cosid.IdGenerator
generateAsString, idConverter
-
Field Details
-
DEFAULT_SAFE_DISTANCE
public static final int DEFAULT_SAFE_DISTANCE- See Also:
-
-
Constructor Details
-
SegmentChainId
-
SegmentChainId
public SegmentChainId(long idSegmentTtl, int safeDistance, IdSegmentDistributor maxIdDistributor, PrefetchWorkerExecutorService prefetchWorkerExecutorService)
-
-
Method Details
-
current
-
getHead
-
generate
public long generate()Description copied from interface:IdGenerator
Generate distributed ID.- Specified by:
generate
in interfaceIdGenerator
- Returns:
- generated distributed ID
-