use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.
the class MCMessageTasksTest method testHotRestartTriggerBackupMessageTask.
@Test
public void testHotRestartTriggerBackupMessageTask() throws Exception {
ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCTriggerHotRestartBackupCodec.encodeRequest(), null);
ClientDelegatingFuture<Void> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), clientMessage -> null);
future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
}
use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.
the class MCMessageTasksTest method testHotRestartTriggerForceStartMessageTask.
@Test
public void testHotRestartTriggerForceStartMessageTask() throws Exception {
ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCTriggerForceStartCodec.encodeRequest(), null);
ClientDelegatingFuture<Boolean> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), MCTriggerForceStartCodec::decodeResponse);
assertFalse(future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS));
}
use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.
the class ClientMapProxy method submitToKeysInternal.
/**
* @param objectKeys not serialized key
* @param dataKeys serialized keys
*/
@Nonnull
protected <R> InternalCompletableFuture<Map<K, R>> submitToKeysInternal(@Nonnull Set<K> objectKeys, @Nonnull Collection<Data> dataKeys, @Nonnull EntryProcessor<K, V, R> entryProcessor) {
ClientMessage request = MapExecuteOnKeysCodec.encodeRequest(name, toData(entryProcessor), dataKeys);
ClientInvocationFuture future = new ClientInvocation(getClient(), request, getName()).invoke();
return new ClientDelegatingFuture<>(future, getSerializationService(), message -> prepareResult(MapExecuteOnKeysCodec.decodeResponse(message)));
}
use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.
the class ClientMapProxy method removeAsyncInternal.
protected InternalCompletableFuture<V> removeAsyncInternal(Object key) {
try {
Data keyData = toData(key);
ClientMessage request = MapRemoveCodec.encodeRequest(name, keyData, getThreadId());
ClientInvocationFuture future = invokeOnKeyOwner(request, keyData);
SerializationService ss = getSerializationService();
return new ClientDelegatingFuture<>(future, ss, MapRemoveCodec::decodeResponse);
} catch (Exception e) {
throw rethrow(e);
}
}
use of com.hazelcast.client.impl.ClientDelegatingFuture in project hazelcast by hazelcast.
the class ClientDurableExecutorServiceProxy method retrieveResult.
@Override
public <T> Future<T> retrieveResult(long taskId) {
int partitionId = Bits.extractInt(taskId, false);
int sequence = Bits.extractInt(taskId, true);
ClientMessage clientMessage = DurableExecutorRetrieveResultCodec.encodeRequest(name, sequence);
ClientInvocationFuture future = new ClientInvocation(getClient(), clientMessage, getName(), partitionId).invoke();
return new ClientDelegatingFuture<>(future, getSerializationService(), DurableExecutorRetrieveResultCodec::decodeResponse);
}
Aggregations