public class DefaultSubscriberSequencerProvider extends Object implements SubscriberSequencerProvider
PartitionSequencer
implementations
for subscriber side.PartitionSequencer
Constructor and Description |
---|
DefaultSubscriberSequencerProvider() |
Modifier and Type | Method and Description |
---|---|
boolean |
compareAndSetSequence(long expect,
long update,
int partitionId)
Atomically sets the value of sequence number for the partition.
|
long |
getSequence(int partitionId)
Returns partition's current sequence number.
|
void |
reset(int partitionId)
Resets the sequence number for the supplied
partition to zero. |
public boolean compareAndSetSequence(long expect, long update, int partitionId)
SubscriberSequencerProvider
compareAndSetSequence
in interface SubscriberSequencerProvider
expect
- the expected sequence.update
- the new sequence.partitionId
- ID of the partition.true
if Compare-and-Set operation is successful, otherwise returns false
.public long getSequence(int partitionId)
SubscriberSequencerProvider
getSequence
in interface SubscriberSequencerProvider
partitionId
- ID of the partition.public void reset(int partitionId)
SubscriberSequencerProvider
partition
to zero.reset
in interface SubscriberSequencerProvider
partitionId
- ID of the partition.Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.