public interface Sequence
| Modifier and Type | Field and Description |
|---|---|
static long |
NOT_FOUND
Returned by
getSequence(long) when a sequence number cannot be
found for the given position and retrying is unlikely to succeed. |
static long |
NOT_FOUND_RETRY
Returned by
getSequence(long) when a sequence number cannot be
found for the given position but the operation may succeed if retried. |
| Modifier and Type | Method and Description |
|---|---|
long |
getSequence(long forWritePosition)
gets the sequence for a writePosition
|
void |
setSequence(long sequence,
long position)
Sets the sequence number for the given write position.
|
long |
toIndex(long headerNumber,
long sequence)
Combines a
headerNumber (such as a cycle count) and a
sequence within that header into a single index value. |
long |
toSequenceNumber(long index)
Extracts the lower-order sequence number from an index previously created
by
toIndex(long, long). |
static final long NOT_FOUND_RETRY
getSequence(long) when a sequence number cannot be
found for the given position but the operation may succeed if retried.static final long NOT_FOUND
getSequence(long) when a sequence number cannot be
found for the given position and retrying is unlikely to succeed.long getSequence(long forWritePosition)
This method will only return a valid sequence number of the write position if the write position is the last write position in the queue. YOU CAN NOT USE THIS METHOD TO LOOK UP RANDOM SEQUENCES FOR ANY WRITE POSITION. NOT_FOUND_RETRY will be return if a sequence number can not be found ( so retry ) or NOT_FOUND if you should not retry
forWritePosition - the last write position, expected to be the end of queuevoid setSequence(long sequence,
long position)
sequence - The sequence number to associate with the position.position - The write position for which the sequence number should be
recorded.long toIndex(long headerNumber,
long sequence)
headerNumber (such as a cycle count) and a
sequence within that header into a single index value.headerNumber - The higher-order part of the index, for example a
cycle number.sequence - The lower-order sequence number within the header.long toSequenceNumber(long index)
toIndex(long, long).index - The combined index.Copyright © 2026 Chronicle Software Ltd. All rights reserved.