/** * Resets the state of the replica synchronization request for the given partition and replica. This will cancel the * scheduled synchronization, clear the ongoing sync flag and release a synchronization permit. * * @param partitionId the partition being synchronized * @param namespace namespace * @param replicaIndex the index of the replica being synchronized */ // called in operation threads public void clearReplicaSyncRequest(int partitionId, ServiceNamespace namespace, int replicaIndex) { ReplicaFragmentSyncInfo syncInfo = new ReplicaFragmentSyncInfo(partitionId, namespace, replicaIndex, null); if (!replicaSyncRequests.remove(syncInfo)) { return; } if (logger.isFinestEnabled()) { logger.finest("Clearing sync replica request for partitionId=" + partitionId + ", replicaIndex=" + replicaIndex + ", namespace=" + namespace); } releaseReplicaSyncPermits(1); replicaSyncTimeoutScheduler.cancelIfExists(syncInfo, null); }
/** * Resets the state of the replica synchronization request for the given partition and replica. This will cancel the * scheduled synchronization, clear the ongoing sync flag and release a synchronization permit. * * @param partitionId the partition being synchronized * @param namespace namespace * @param replicaIndex the index of the replica being synchronized */ // called in operation threads public void clearReplicaSyncRequest(int partitionId, ServiceNamespace namespace, int replicaIndex) { ReplicaFragmentSyncInfo syncInfo = new ReplicaFragmentSyncInfo(partitionId, namespace, replicaIndex, null); if (!replicaSyncRequests.remove(syncInfo)) { return; } if (logger.isFinestEnabled()) { logger.finest("Clearing sync replica request for partitionId=" + partitionId + ", replicaIndex=" + replicaIndex + ", namespace=" + namespace); } releaseReplicaSyncPermits(1); replicaSyncTimeoutScheduler.cancelIfExists(syncInfo, null); }