Search in sources :

Example 1 with CountDownLatchContainer

use of com.hazelcast.concurrent.countdownlatch.CountDownLatchContainer in project hazelcast by hazelcast.

the class BackupAwareCountDownLatchOperation method getBackupOperation.

@Override
public Operation getBackupOperation() {
    CountDownLatchService service = getService();
    CountDownLatchContainer latchContainer = service.getCountDownLatchContainer(name);
    int count = latchContainer != null ? latchContainer.getCount() : 0;
    return new CountDownLatchBackupOperation(name, count);
}
Also used : CountDownLatchService(com.hazelcast.concurrent.countdownlatch.CountDownLatchService) CountDownLatchContainer(com.hazelcast.concurrent.countdownlatch.CountDownLatchContainer)

Example 2 with CountDownLatchContainer

use of com.hazelcast.concurrent.countdownlatch.CountDownLatchContainer in project hazelcast by hazelcast.

the class CountDownLatchReplicationOperation method readInternal.

@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    super.readInternal(in);
    int len = in.readInt();
    if (len > 0) {
        data = new ArrayList<CountDownLatchContainer>();
        for (int i = 0; i < len; i++) {
            CountDownLatchContainer latchContainer = new CountDownLatchContainer();
            latchContainer.readData(in);
            data.add(latchContainer);
        }
    }
}
Also used : CountDownLatchContainer(com.hazelcast.concurrent.countdownlatch.CountDownLatchContainer)

Example 3 with CountDownLatchContainer

use of com.hazelcast.concurrent.countdownlatch.CountDownLatchContainer in project hazelcast by hazelcast.

the class CountDownLatchReplicationOperation method writeInternal.

@Override
protected void writeInternal(ObjectDataOutput out) throws IOException {
    super.writeInternal(out);
    int len = data != null ? data.size() : 0;
    out.writeInt(len);
    if (len > 0) {
        for (CountDownLatchContainer latchContainer : data) {
            latchContainer.writeData(out);
        }
    }
}
Also used : CountDownLatchContainer(com.hazelcast.concurrent.countdownlatch.CountDownLatchContainer)

Aggregations

CountDownLatchContainer (com.hazelcast.concurrent.countdownlatch.CountDownLatchContainer)3 CountDownLatchService (com.hazelcast.concurrent.countdownlatch.CountDownLatchService)1