Package me.ahoo.cosid.segment.grouped
Class DefaultGroupedIdSegmentDistributor
java.lang.Object
me.ahoo.cosid.segment.grouped.DefaultGroupedIdSegmentDistributor
- All Implemented Interfaces:
Grouped
,GroupedIdSegmentDistributor
,IdSegmentDistributor
public class DefaultGroupedIdSegmentDistributor
extends Object
implements GroupedIdSegmentDistributor
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.ahoo.cosid.segment.IdSegmentDistributor
IdSegmentDistributor.Atomic, IdSegmentDistributor.Mock
-
Field Summary
Fields inherited from interface me.ahoo.cosid.segment.IdSegmentDistributor
DEFAULT_OFFSET, DEFAULT_SEGMENTS, DEFAULT_STEP
-
Constructor Summary
ConstructorDescriptionDefaultGroupedIdSegmentDistributor
(GroupBySupplier groupBySupplier, IdSegmentDistributorDefinition idSegmentDistributorDefinition, IdSegmentDistributorFactory idSegmentDistributorFactory) -
Method Summary
Modifier and TypeMethodDescriptiongetName()
long
getStep()
group()
nextIdSegment
(int segments, long ttl) nextIdSegment
(long ttl) nextIdSegmentChain
(IdSegmentChain previousChain) nextIdSegmentChain
(IdSegmentChain previousChain, int segments, long ttl) long
long
nextMaxId
(long step) 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.segment.grouped.GroupedIdSegmentDistributor
allowReset
Methods inherited from interface me.ahoo.cosid.segment.IdSegmentDistributor
getNamespacedName, getStep
-
Constructor Details
-
DefaultGroupedIdSegmentDistributor
public DefaultGroupedIdSegmentDistributor(GroupBySupplier groupBySupplier, IdSegmentDistributorDefinition idSegmentDistributorDefinition, IdSegmentDistributorFactory idSegmentDistributorFactory)
-
-
Method Details
-
groupBySupplier
-
getNamespace
- Specified by:
getNamespace
in interfaceIdSegmentDistributor
-
getName
- Specified by:
getName
in interfaceIdSegmentDistributor
-
getStep
public long getStep()- Specified by:
getStep
in interfaceIdSegmentDistributor
-
group
-
nextMaxId
public long nextMaxId()- Specified by:
nextMaxId
in interfaceIdSegmentDistributor
-
nextMaxId
public long nextMaxId(long step) - Specified by:
nextMaxId
in interfaceIdSegmentDistributor
-
nextIdSegment
- Specified by:
nextIdSegment
in interfaceIdSegmentDistributor
-
nextIdSegment
- Specified by:
nextIdSegment
in interfaceIdSegmentDistributor
-
nextIdSegment
- Specified by:
nextIdSegment
in interfaceIdSegmentDistributor
-
nextIdSegmentChain
@Nonnull public IdSegmentChain nextIdSegmentChain(IdSegmentChain previousChain, int segments, long ttl) - Specified by:
nextIdSegmentChain
in interfaceIdSegmentDistributor
-
nextIdSegmentChain
- Specified by:
nextIdSegmentChain
in interfaceIdSegmentDistributor
-