Search in sources :

Example 1 with PartitionResponse

use of com.hazelcast.spi.impl.operationservice.impl.operations.PartitionIteratingOperation.PartitionResponse in project hazelcast by hazelcast.

the class InvokeOnPartitions method awaitCompletion.

private void awaitCompletion() {
    NodeEngineImpl nodeEngine = operationService.nodeEngine;
    for (Map.Entry<Address, Future> response : futures.entrySet()) {
        try {
            Future future = response.getValue();
            PartitionResponse result = (PartitionResponse) nodeEngine.toObject(future.get());
            result.addResults(partitionResults);
        } catch (Throwable t) {
            if (operationService.logger.isFinestEnabled()) {
                operationService.logger.finest(t);
            } else {
                operationService.logger.warning(t.getMessage());
            }
            List<Integer> partitions = memberPartitions.get(response.getKey());
            for (Integer partition : partitions) {
                partitionResults.put(partition, t);
            }
        }
    }
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) PartitionResponse(com.hazelcast.spi.impl.operationservice.impl.operations.PartitionIteratingOperation.PartitionResponse) Address(com.hazelcast.nio.Address) Future(java.util.concurrent.Future) List(java.util.List) LinkedList(java.util.LinkedList) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

Address (com.hazelcast.nio.Address)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 PartitionResponse (com.hazelcast.spi.impl.operationservice.impl.operations.PartitionIteratingOperation.PartitionResponse)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 Future (java.util.concurrent.Future)1