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()
PartitionSequencernextSequence in interface PartitionSequencerpublic void setSequence(long update)
PartitionSequencersetSequence in interface PartitionSequencerupdate - new sequence number.public boolean compareAndSetSequence(long expect,
                                     long update)
PartitionSequencercompareAndSetSequence in interface PartitionSequencerexpect - the expected sequence.update - the new sequence.true if Compare-and-Set operation is successful, otherwise returns false.public long getSequence()
PartitionSequencergetSequence in interface PartitionSequencerpublic void reset()
PartitionSequencerPartitionSequencer.
 After this call returns sequence generation will be start from zero.reset in interface PartitionSequencerCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.