Skip to content

Commit

Permalink
Merge pull request hazelcast#8723 from jerrinot/experiments/anti-entr…
Browse files Browse the repository at this point in the history
…opy-counter/master

Add Replica Sync Request Counter into Diagnostics
  • Loading branch information
pveentjer committed Aug 15, 2016
2 parents aa69abc + 7d3f59b commit cfad2df
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.hazelcast.internal.metrics.Probe;
import com.hazelcast.internal.partition.InternalPartition;
import com.hazelcast.internal.partition.operation.ReplicaSyncRequest;
import com.hazelcast.internal.util.counters.MwCounter;
import com.hazelcast.logging.ILogger;
import com.hazelcast.nio.Address;
import com.hazelcast.spi.ExecutionService;
Expand All @@ -42,6 +43,7 @@

import static com.hazelcast.internal.partition.InternalPartitionService.DEFAULT_REPLICA_SYNC_DELAY;
import static com.hazelcast.internal.partition.InternalPartitionService.REPLICA_SYNC_RETRY_DELAY;
import static com.hazelcast.internal.util.counters.MwCounter.newMwCounter;

/**
*
Expand All @@ -61,6 +63,8 @@ public class PartitionReplicaManager {
private final EntryTaskScheduler<Integer, ReplicaSyncInfo> replicaSyncScheduler;
@Probe
private final Semaphore replicaSyncProcessLock;
@Probe
private final MwCounter replicaSyncRequestsCounter = newMwCounter();

private final long partitionMigrationTimeout;
private final int partitionCount;
Expand Down Expand Up @@ -203,6 +207,7 @@ private boolean fireSyncReplicaRequest(ReplicaSyncInfo syncInfo, Address target)
logger.finest("Sending sync replica request to -> " + target + "; for partitionId=" + partitionId
+ ", replicaIndex=" + replicaIndex);
}
replicaSyncRequestsCounter.inc();
replicaSyncScheduler.schedule(partitionMigrationTimeout, partitionId, syncInfo);
ReplicaSyncRequest syncRequest = new ReplicaSyncRequest(partitionId, replicaIndex);
nodeEngine.getOperationService().send(syncRequest, target);
Expand Down

0 comments on commit cfad2df

Please sign in to comment.