| Modifier and Type | Field and Description |
|---|---|
static DefaultIdSegment |
OVERFLOW |
SEQUENCE_OVERFLOW, TIME_TO_LIVE_FOREVER| Constructor and Description |
|---|
DefaultIdSegment(long maxId,
long step) |
DefaultIdSegment(long maxId,
long step,
long fetchTime,
long ttl) |
| Modifier and Type | Method and Description |
|---|---|
long |
getFetchTime()
ID segment fetch time.
|
long |
getMaxId() |
long |
getOffset() |
long |
getSequence() |
long |
getStep() |
long |
getTtl()
the id segment time to live.
|
long |
incrementAndGet() |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompareTo, ensureNextIdSegment, isAvailable, isExpired, isOverflow, isOverflowpublic static final DefaultIdSegment OVERFLOW
public DefaultIdSegment(long maxId,
long step)
public DefaultIdSegment(long maxId,
long step,
long fetchTime,
long ttl)
public long getFetchTime()
IdSegmentTimeUnit.SECONDSgetFetchTime in interface IdSegmentpublic long getTtl()
IdSegmentTimeUnit.SECONDSpublic long getSequence()
getSequence in interface IdSegmentpublic long incrementAndGet()
incrementAndGet in interface IdSegmentpublic java.lang.String toString()
toString in class java.lang.Object