@Override public CountDownLatchProxy createDistributedObject(String name) { return new CountDownLatchProxy(name, nodeEngine); }
WaitNotifyKey waitNotifyKey() { return new LatchKey(name); } }
@Override public Operation getBackupOperation() { CountDownLatchService service = getService(); CountDownLatchContainer container = service.getCountDownLatchContainer(name); int count = container != null ? container.getCount() : 0; return new CountDownLatchBackupOperation(name, count); }
@Override public void run() throws Exception { CountDownLatchService service = getService(); service.countDown(name); int count = service.getCount(name); shouldNotify = count == 0; }
public void setCountDirect(String name, int count) { if (count < 0) { containers.remove(name); } else { CountDownLatchContainer latch = containers.get(name); if (latch == null) { latch = new CountDownLatchContainer(name); containers.put(name, latch); } latch.setCountDirect(count); } }
@Override public void run() throws Exception { CountDownLatchService service = getService(); response = service.setCount(name, count); }
@Override public boolean shouldWait() { CountDownLatchService service = getService(); return service.shouldWait(name); }
@Override public void run() throws Exception { CountDownLatchService service = getService(); count = service.getCount(name); }
@Override public void run() throws Exception { if (data == null) { return; } CountDownLatchService service = getService(); for (CountDownLatchContainer container : data) { service.add(container); } }
@Override public void run() throws Exception { CountDownLatchService service = getService(); service.setCountDirect(name, count); }
@Override public void commitMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == MigrationEndpoint.SOURCE) { int partitionId = event.getPartitionId(); int thresholdReplicaIndex = event.getNewReplicaIndex(); if (thresholdReplicaIndex == -1 || thresholdReplicaIndex > 1) { clearPartitionReplica(partitionId); } } }
@Override public Operation getBackupOperation() { CountDownLatchService service = getService(); CountDownLatchContainer container = service.getCountDownLatchContainer(name); int count = container != null ? container.getCount() : 0; return new CountDownLatchBackupOperation(name, count); }
@Override public void run() throws Exception { CountDownLatchService service = getService(); service.countDown(name); int count = service.getCount(name); shouldNotify = count == 0; }
@Override public void run() throws Exception { CountDownLatchService service = getService(); response = service.setCount(name, count); }
@Override public boolean shouldWait() { CountDownLatchService service = getService(); return service.shouldWait(name); }
@Override public void run() throws Exception { CountDownLatchService service = getService(); count = service.getCount(name); }
@Override public void commitMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == MigrationEndpoint.SOURCE) { int partitionId = event.getPartitionId(); int thresholdReplicaIndex = event.getNewReplicaIndex(); if (thresholdReplicaIndex == -1 || thresholdReplicaIndex > 1) { clearPartitionReplica(partitionId); } } }
@Override public CountDownLatchProxy createDistributedObject(String name) { return new CountDownLatchProxy(name, nodeEngine); }
WaitNotifyKey waitNotifyKey() { return new LatchKey(name); } }
@Override public void rollbackMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == MigrationEndpoint.DESTINATION) { int partitionId = event.getPartitionId(); int thresholdReplicaIndex = event.getCurrentReplicaIndex(); if (thresholdReplicaIndex == -1 || thresholdReplicaIndex > 1) { clearPartitionReplica(partitionId); } } }