use of com.hazelcast.replicatedmap.impl.operation.CheckReplicaVersionOperation in project hazelcast by hazelcast.
the class ReplicatedMapService method triggerAntiEntropy.
/** Send an operation to all replicas to check their replica versions for all partitions for which this node is the owner */
public void triggerAntiEntropy() {
if (clusterService.getSize(DATA_MEMBER_SELECTOR) == 1) {
return;
}
Collection<Address> addresses = new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
addresses.remove(nodeEngine.getThisAddress());
for (int i = 0; i < partitionContainers.length; i++) {
Address thisAddress = nodeEngine.getThisAddress();
InternalPartition partition = partitionService.getPartition(i, false);
Address ownerAddress = partition.getOwnerOrNull();
if (!thisAddress.equals(ownerAddress)) {
continue;
}
PartitionContainer partitionContainer = partitionContainers[i];
if (partitionContainer.isEmpty()) {
continue;
}
for (Address address : addresses) {
CheckReplicaVersionOperation checkReplicaVersionOperation = new CheckReplicaVersionOperation(partitionContainer);
checkReplicaVersionOperation.setPartitionId(i);
checkReplicaVersionOperation.setValidateTarget(false);
operationService.createInvocationBuilder(SERVICE_NAME, checkReplicaVersionOperation, address).setTryCount(INVOCATION_TRY_COUNT).invoke();
}
}
}
Aggregations