public class SequenceNumbers
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOCAL_CHECKPOINT_KEY |
static java.lang.String |
MAX_SEQ_NO |
static long |
NO_OPS_PERFORMED
Represents no operations have been performed on the shard.
|
static long |
PRE_60_NODE_CHECKPOINT
Represents a checkpoint coming from a pre-6.0 node
|
static long |
UNASSIGNED_SEQ_NO
Represents an unassigned sequence number (e.g., can be used on primary operations before they are executed).
|
Constructor and Description |
---|
SequenceNumbers() |
Modifier and Type | Method and Description |
---|---|
static SeqNoStats |
loadSeqNoStatsFromLuceneCommit(long globalCheckpoint,
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> commitData)
Reads the sequence number stats from the commit data (maximum sequence number and local checkpoint) and uses the specified global
checkpoint.
|
static long |
max(long maxSeqNo,
long seqNo)
Compute the maximum of the given current maximum sequence number and the specified sequence number, accounting for the fact that the
current maximum sequence number could be
NO_OPS_PERFORMED or
UNASSIGNED_SEQ_NO . |
static long |
min(long minSeqNo,
long seqNo)
Compute the minimum of the given current minimum sequence number and the specified sequence number, accounting for the fact that the
current minimum sequence number could be
NO_OPS_PERFORMED or
UNASSIGNED_SEQ_NO . |
public static final java.lang.String LOCAL_CHECKPOINT_KEY
public static final java.lang.String MAX_SEQ_NO
public static final long PRE_60_NODE_CHECKPOINT
public static final long UNASSIGNED_SEQ_NO
public static final long NO_OPS_PERFORMED
public static SeqNoStats loadSeqNoStatsFromLuceneCommit(long globalCheckpoint, java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> commitData)
globalCheckpoint
- the global checkpoint to usecommitData
- the commit datapublic static long min(long minSeqNo, long seqNo)
NO_OPS_PERFORMED
or
UNASSIGNED_SEQ_NO
. When the current minimum sequence number is not
NO_OPS_PERFORMED
nor UNASSIGNED_SEQ_NO
, the specified sequence number
must not be UNASSIGNED_SEQ_NO
.minSeqNo
- the current minimum sequence numberseqNo
- the specified sequence numberpublic static long max(long maxSeqNo, long seqNo)
NO_OPS_PERFORMED
or
UNASSIGNED_SEQ_NO
. When the current maximum sequence number is not
NO_OPS_PERFORMED
nor UNASSIGNED_SEQ_NO
, the specified sequence number
must not be UNASSIGNED_SEQ_NO
.maxSeqNo
- the current maximum sequence numberseqNo
- the specified sequence number