| Modifier and Type | Field and Description |
|---|---|
static IdSegmentChain |
NOT_SET |
static int |
ROOT_VERSION |
SEQUENCE_OVERFLOW, TIME_TO_LIVE_FOREVER| Constructor and Description |
|---|
IdSegmentChain(IdSegmentChain previousChain,
IdSegment idSegment) |
IdSegmentChain(long version,
IdSegment idSegment) |
| Modifier and Type | Method and Description |
|---|---|
IdSegmentChain |
ensureSetNext(java.util.function.Function<IdSegmentChain,IdSegmentChain> idSegmentChainSupplier) |
int |
gap(IdSegmentChain end,
long step) |
long |
getFetchTime()
ID segment fetch time.
|
IdSegment |
getIdSegment() |
long |
getMaxId() |
IdSegmentChain |
getNext() |
long |
getOffset() |
long |
getSequence() |
long |
getStep() |
long |
getVersion() |
long |
incrementAndGet() |
static IdSegmentChain |
newRoot() |
void |
setNext(IdSegmentChain nextIdSegmentChain) |
java.lang.String |
toString() |
boolean |
trySetNext(java.util.function.Function<IdSegmentChain,IdSegmentChain> idSegmentChainSupplier)
try set next Chained ID segment.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompareTo, ensureNextIdSegment, getTtl, isAvailable, isExpired, isOverflow, isOverflowpublic static final int ROOT_VERSION
public static final IdSegmentChain NOT_SET
public IdSegmentChain(IdSegmentChain previousChain, IdSegment idSegment)
public IdSegmentChain(long version,
IdSegment idSegment)
public boolean trySetNext(java.util.function.Function<IdSegmentChain,IdSegmentChain> idSegmentChainSupplier) throws NextIdSegmentExpiredException
idSegmentChainSupplier - IdSegmentChain supplierNextIdSegmentExpiredException - This exception is thrown
if the provided IdSegmentChain has expired.public void setNext(IdSegmentChain nextIdSegmentChain)
public IdSegmentChain ensureSetNext(java.util.function.Function<IdSegmentChain,IdSegmentChain> idSegmentChainSupplier) throws NextIdSegmentExpiredException
NextIdSegmentExpiredExceptionpublic IdSegmentChain getNext()
public IdSegment getIdSegment()
public long getVersion()
public int gap(IdSegmentChain end, long step)
public static IdSegmentChain newRoot()
public long getFetchTime()
IdSegmentTimeUnit.SECONDSgetFetchTime in interface IdSegmentpublic long getSequence()
getSequence in interface IdSegmentpublic long incrementAndGet()
incrementAndGet in interface IdSegmentpublic java.lang.String toString()
toString in class java.lang.Object