@ThreadSafe public interface IdSegment extends java.lang.Comparable<IdSegment>

| Modifier and Type | Field and Description |
|---|---|
static long |
SEQUENCE_OVERFLOW |
static long |
TIME_TO_LIVE_FOREVER |
| Modifier and Type | Method and Description |
|---|---|
default int |
compareTo(IdSegment other) |
default void |
ensureNextIdSegment(IdSegment nextIdSegment) |
long |
getFetchTime()
ID segment fetch time.
|
long |
getMaxId() |
long |
getOffset() |
long |
getSequence() |
long |
getStep() |
default long |
getTtl()
the id segment time to live.
|
long |
incrementAndGet() |
default boolean |
isAvailable()
not expired and not overflow.
|
default boolean |
isExpired()
id segment has expired?.
|
default boolean |
isOverflow() |
default boolean |
isOverflow(long nextSeq) |
static final long SEQUENCE_OVERFLOW
static final long TIME_TO_LIVE_FOREVER
long getFetchTime()
TimeUnit.SECONDSlong getMaxId()
long getOffset()
long getSequence()
long getStep()
default long getTtl()
TimeUnit.SECONDSdefault boolean isExpired()
default boolean isOverflow()
default boolean isOverflow(long nextSeq)
default boolean isAvailable()
long incrementAndGet()
default int compareTo(IdSegment other)
compareTo in interface java.lang.Comparable<IdSegment>default void ensureNextIdSegment(IdSegment nextIdSegment) throws NextIdSegmentExpiredException
NextIdSegmentExpiredException