Package me.ahoo.cosid.segment
Class DefaultSegmentId
java.lang.Object
me.ahoo.cosid.segment.DefaultSegmentId
- All Implemented Interfaces:
IdGenerator
,SegmentId
,Statistical
,StringIdGenerator
Default segment algorithm ID generator.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultSegmentId
(long idSegmentTtl, IdSegmentDistributor maxIdDistributor) DefaultSegmentId
(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
-
Constructor Details
-
DefaultSegmentId
-
DefaultSegmentId
-
-
Method Details
-
current
-
generate
public long generate()Description copied from interface:IdGenerator
Generate distributed ID.- Specified by:
generate
in interfaceIdGenerator
- Returns:
- generated distributed ID
-