public class PartitionReplicaManager extends Object
Modifier and Type | Method and Description |
---|---|
void |
cancelReplicaSync(int partitionId) |
void |
clearPartitionReplicaVersions(int partitionId) |
void |
clearReplicaSyncRequest(int partitionId,
int replicaIndex)
Resets the state of the replica synchronization request for the given partition and replica.
|
void |
finalizeReplicaSync(int partitionId,
int replicaIndex,
long[] versions)
Set the new replica versions for the partition with the
partitionId and reset any ongoing replica
synchronization request for this partition and replica index. |
long[] |
getPartitionReplicaVersions(int partitionId) |
boolean |
isPartitionReplicaVersionDirty(int partitionId) |
boolean |
isPartitionReplicaVersionStale(int partitionId,
long[] versions,
int replicaIndex) |
void |
releaseReplicaSyncPermit() |
void |
setPartitionReplicaVersions(int partitionId,
long[] versions,
int replicaOffset) |
void |
triggerPartitionReplicaSync(int partitionId,
int replicaIndex,
long delayMillis)
This method is called on a backup node (replica).
|
boolean |
tryToAcquireReplicaSyncPermit() |
public void triggerPartitionReplicaSync(int partitionId, int replicaIndex, long delayMillis)
delayMillis
is greater than 0partitionId
- the partition which is being synchronizedreplicaIndex
- the index of the replica which is being synchronizeddelayMillis
- the delay before the sync operation is sentIllegalArgumentException
- if the replica index is not between 0 and InternalPartition.MAX_REPLICA_COUNT
public boolean isPartitionReplicaVersionStale(int partitionId, long[] versions, int replicaIndex)
public boolean isPartitionReplicaVersionDirty(int partitionId)
public long[] getPartitionReplicaVersions(int partitionId)
public void setPartitionReplicaVersions(int partitionId, long[] versions, int replicaOffset)
public void clearPartitionReplicaVersions(int partitionId)
public void finalizeReplicaSync(int partitionId, int replicaIndex, long[] versions)
partitionId
and reset any ongoing replica
synchronization request for this partition and replica index.partitionId
- the partition IDreplicaIndex
- the index of the replicaversions
- the new replica versions for the partitionpublic void clearReplicaSyncRequest(int partitionId, int replicaIndex)
partitionId
- the partition being synchronizedreplicaIndex
- the index of the replica being synchronizedpublic void cancelReplicaSync(int partitionId)
public boolean tryToAcquireReplicaSyncPermit()
public void releaseReplicaSyncPermit()
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.