Package me.ahoo.cosid.segment
Class IdSegmentDistributor.Mock
java.lang.Object
me.ahoo.cosid.segment.IdSegmentDistributor.Mock
- All Implemented Interfaces:
Grouped
,IdSegmentDistributor
- Enclosing interface:
- IdSegmentDistributor
-
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
-
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.segment.IdSegmentDistributor
allowReset, getNamespacedName, getStep, nextIdSegment, nextIdSegment, nextIdSegment, nextIdSegmentChain, nextIdSegmentChain, nextMaxId
-
Constructor Details
-
Mock
public Mock() -
Mock
public Mock(long step, int tps) ctor.- Parameters:
step
- 单次获取IdSegment的区间长度tps
- 发号器的TPS,用于模拟网络IO请求的等待时常
-
-
Method Details
-
getNamespace
- Specified by:
getNamespace
in interfaceIdSegmentDistributor
-
getName
- Specified by:
getName
in interfaceIdSegmentDistributor
-
getStep
public long getStep()- Specified by:
getStep
in interfaceIdSegmentDistributor
-
nextMaxId
public long nextMaxId(long step) - Specified by:
nextMaxId
in interfaceIdSegmentDistributor
-