public class DefaultPartitionSequencer extends Object implements PartitionSequencer
PartitionSequencer
.PartitionSequencer
Constructor and Description |
---|
DefaultPartitionSequencer() |
Modifier and Type | Method and Description |
---|---|
boolean |
compareAndSetSequence(long expect,
long update)
Atomically sets the value of sequence number for the partition.
|
long |
getSequence()
Returns current sequence number of the partition.
|
long |
nextSequence()
Returns next number in sequence for the partition.
|
void |
reset()
Resets
PartitionSequencer . |
void |
setSequence(long update)
Sets the current sequence number for the partition.
|
public long nextSequence()
PartitionSequencer
nextSequence
in interface PartitionSequencer
public void setSequence(long update)
PartitionSequencer
setSequence
in interface PartitionSequencer
update
- new sequence number.public boolean compareAndSetSequence(long expect, long update)
PartitionSequencer
compareAndSetSequence
in interface PartitionSequencer
expect
- the expected sequence.update
- the new sequence.true
if Compare-and-Set operation is successful, otherwise returns false
.public long getSequence()
PartitionSequencer
getSequence
in interface PartitionSequencer
public void reset()
PartitionSequencer
PartitionSequencer
.
After this call returns sequence generation will be start from zero.reset
in interface PartitionSequencer
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.