public interface PartitionReplicaVersionManager
PartitionReplicaVersionManager
maintains partition replica version handling.
It keeps versions for each partition and ServiceNamespace
pair.Modifier and Type | Method and Description |
---|---|
Collection<ServiceNamespace> |
getNamespaces(int partitionId)
Returns all registered namespaces for given partition ID
|
long[] |
getPartitionReplicaVersions(int partitionId,
ServiceNamespace namespace)
Returns replica versions for given partition and namespace.
|
ServiceNamespace |
getServiceNamespace(Operation operation)
Returns
ServiceNamespace for given operation. |
long[] |
incrementPartitionReplicaVersions(int partitionId,
ServiceNamespace namespace,
int backupCount)
Increments replica versions for given partition and namespace by the number of backup count.
|
boolean |
isPartitionReplicaVersionStale(int partitionId,
ServiceNamespace namespace,
long[] replicaVersions,
int replicaIndex)
Returns whether given replica version is behind the current version or not.
|
void |
updatePartitionReplicaVersions(int partitionId,
ServiceNamespace namespace,
long[] replicaVersions,
int replicaIndex)
Updates the partition replica version and triggers replica sync if the replica is dirty (e.g.
|
Collection<ServiceNamespace> getNamespaces(int partitionId)
partitionId
- partition IDboolean isPartitionReplicaVersionStale(int partitionId, ServiceNamespace namespace, long[] replicaVersions, int replicaIndex)
partitionId
- partition IDnamespace
- replica namespacereplicaVersions
- replica versionsreplicaIndex
- specific replica indexlong[] getPartitionReplicaVersions(int partitionId, ServiceNamespace namespace)
partitionId
- partition IDnamespace
- replica namespacevoid updatePartitionReplicaVersions(int partitionId, ServiceNamespace namespace, long[] replicaVersions, int replicaIndex)
partitionId
- the ID of the partition for which we received a new versionnamespace
- replica namespacereplicaVersions
- the received replica versionsreplicaIndex
- the index of this replicalong[] incrementPartitionReplicaVersions(int partitionId, ServiceNamespace namespace, int backupCount)
partitionId
- partition IDnamespace
- replica namespacebackupCount
- number of desired backupsServiceNamespace getServiceNamespace(Operation operation)
ServiceNamespace
for given operation. If operation is instance of
ServiceNamespaceAware
then ServiceNamespaceAware.getServiceNamespace()
will be used. Otherwise NonFragmentedServiceNamespace
will be returned.operation
- operationCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.