use of com.hazelcast.spi.InternalCompletableFuture in project hazelcast by hazelcast.
the class MapKeyLoader method sendBatch.
private List<Future> sendBatch(Map<Integer, List<Data>> batch, boolean replaceExistingValues) {
Set<Entry<Integer, List<Data>>> entries = batch.entrySet();
List<Future> futures = new ArrayList<Future>(entries.size());
for (Entry<Integer, List<Data>> e : entries) {
int partitionId = e.getKey();
List<Data> keys = e.getValue();
MapOperation op = operationProvider.createLoadAllOperation(mapName, keys, replaceExistingValues);
InternalCompletableFuture<Object> future = opService.invokeOnPartition(SERVICE_NAME, op, partitionId);
futures.add(future);
}
return futures;
}
use of com.hazelcast.spi.InternalCompletableFuture in project hazelcast by hazelcast.
the class RingbufferAbstractTest method destroy_whenBlockedThreads_thenDistributedObjectDestroyedException.
@Test(expected = DistributedObjectDestroyedException.class)
public void destroy_whenBlockedThreads_thenDistributedObjectDestroyedException() throws Exception {
spawn(new Runnable() {
@Override
public void run() {
sleepSeconds(2);
ringbuffer.destroy();
}
});
InternalCompletableFuture f = (InternalCompletableFuture) ringbuffer.readManyAsync(0, 1, 1, null);
f.join();
}
Aggregations