use of com.hazelcast.spi.InternalCompletableFuture in project hazelcast by hazelcast.
the class MapProxyImpl method submitToKey.
@Override
public ICompletableFuture submitToKey(K key, EntryProcessor entryProcessor) {
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
MapService service = getService();
Data keyData = toData(key, partitionStrategy);
InternalCompletableFuture f = executeOnKeyInternal(keyData, entryProcessor, null);
return new DelegatingFuture(f, service.getMapServiceContext().getNodeEngine().getSerializationService());
}
use of com.hazelcast.spi.InternalCompletableFuture in project hazelcast by hazelcast.
the class MemberMapMetaDataFetcher method scanMembers.
@Override
protected List<InternalCompletableFuture> scanMembers(List<String> names) {
Collection<Member> members = clusterService.getMembers(DATA_MEMBER_SELECTOR);
List<InternalCompletableFuture> futures = new ArrayList<InternalCompletableFuture>(members.size());
for (Member member : members) {
Operation operation = new MapGetInvalidationMetaDataOperation(names);
Address address = member.getAddress();
try {
futures.add(operationService.invokeOnTarget(SERVICE_NAME, operation, address));
} catch (Exception e) {
if (logger.isWarningEnabled()) {
logger.warning("Cant fetch invalidation meta-data from address + " + address + " + [" + e.getMessage() + "]");
}
}
}
return futures;
}
use of com.hazelcast.spi.InternalCompletableFuture in project hazelcast by hazelcast.
the class InvocationBuilderImpl method invoke.
@Override
public InternalCompletableFuture invoke() {
op.setServiceName(serviceName);
Invocation invocation;
if (target == null) {
op.setPartitionId(partitionId).setReplicaIndex(replicaIndex);
invocation = new PartitionInvocation(context, op, doneCallback, tryCount, tryPauseMillis, callTimeout, resultDeserialized);
} else {
invocation = new TargetInvocation(context, op, target, doneCallback, tryCount, tryPauseMillis, callTimeout, resultDeserialized);
}
InternalCompletableFuture future = invocation.invoke();
if (executionCallback != null) {
future.andThen(executionCallback);
}
return future;
}
use of com.hazelcast.spi.InternalCompletableFuture in project hazelcast by hazelcast.
the class CountDownLatchProxy method countDown.
@Override
public void countDown() {
Operation op = new CountDownOperation(name).setPartitionId(partitionId);
InternalCompletableFuture f = invokeOnPartition(op);
f.join();
}
use of com.hazelcast.spi.InternalCompletableFuture in project hazelcast by hazelcast.
the class ConditionImpl method signal.
private void signal(boolean all) {
long threadId = ThreadUtil.getThreadId();
Data key = lockProxy.getKeyData();
SignalOperation op = new SignalOperation(namespace, key, threadId, conditionId, all);
InternalCompletableFuture f = invoke(op);
f.join();
}
Aggregations