private void invokeOnAllPartitions() { for (Map.Entry<Address, List<Integer>> mp : memberPartitions.entrySet()) { Address address = mp.getKey(); List<Integer> partitions = mp.getValue(); PartitionIteratingOperation op = new PartitionIteratingOperation(operationFactory, toIntArray(partitions)); Future future = operationService.createInvocationBuilder(serviceName, op, address) .setTryCount(TRY_COUNT) .setTryPauseMillis(TRY_PAUSE_MILLIS) .invoke(); futures.put(address, future); } }
private void invokeOnAllPartitions() { if (memberPartitions.isEmpty()) { future.setResult(Collections.EMPTY_MAP); return; } for (final Map.Entry<Address, List<Integer>> mp : memberPartitions.entrySet()) { final Address address = mp.getKey(); List<Integer> partitions = mp.getValue(); PartitionIteratingOperation op = new PartitionIteratingOperation(operationFactory, toIntArray(partitions)); operationService.createInvocationBuilder(serviceName, op, address) .setTryCount(TRY_COUNT) .setTryPauseMillis(TRY_PAUSE_MILLIS) .invoke() .andThen(new FirstAttemptExecutionCallback(partitions)); } }
private void invokeOnAllPartitions() { if (memberPartitions.isEmpty()) { future.setResult(Collections.EMPTY_MAP); if (callback != null) { callback.onResponse(Collections.EMPTY_MAP); } return; } for (final Map.Entry<Address, List<Integer>> mp : memberPartitions.entrySet()) { final Address address = mp.getKey(); List<Integer> partitions = mp.getValue(); PartitionIteratingOperation op = new PartitionIteratingOperation(operationFactory, toIntArray(partitions)); operationService.createInvocationBuilder(serviceName, op, address) .setTryCount(TRY_COUNT) .setTryPauseMillis(TRY_PAUSE_MILLIS) .invoke() .andThen(new FirstAttemptExecutionCallback(mp.getValue())); } }