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. |
void |
resetAll()
Like
SubscriberSequencerProvider.reset(int) but this method resets all partition sequences. |
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.public void resetAll()
SubscriberSequencerProvider
SubscriberSequencerProvider.reset(int)
but this method resets all partition sequences.resetAll
in interface SubscriberSequencerProvider
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.