public interface Sequence
Modifier and Type | Field and Description |
---|---|
static long |
NOT_FOUND |
static long |
NOT_FOUND_RETRY |
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 a writePosition
|
long |
toIndex(long headerNumber,
long sequence) |
long |
toSequenceNumber(long index) |
static final long NOT_FOUND_RETRY
static final long NOT_FOUND
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 numberposition
- the write positionlong toIndex(long headerNumber, long sequence)
long toSequenceNumber(long index)
Copyright © 2020. All rights reserved.