use of com.hazelcast.ringbuffer.impl.RingbufferProxy.MAX_BATCH_SIZE in project hazelcast by hazelcast.
the class ClientRingbufferProxy method readManyAsync.
@Override
public ICompletableFuture<ReadResultSet<E>> readManyAsync(long startSequence, int minCount, int maxCount, IFunction<E, Boolean> filter) {
checkSequence(startSequence);
checkNotNegative(minCount, "minCount can't be smaller than 0");
checkTrue(maxCount >= minCount, "maxCount should be equal or larger than minCount");
checkTrue(minCount <= capacity(), "the minCount should be smaller than or equal to the capacity");
checkTrue(maxCount <= MAX_BATCH_SIZE, "maxCount can't be larger than " + MAX_BATCH_SIZE);
ClientMessage request = RingbufferReadManyCodec.encodeRequest(name, startSequence, minCount, maxCount, toData(filter));
try {
ClientInvocationFuture invocationFuture = new ClientInvocation(getClient(), request, partitionId).invoke();
return new ClientDelegatingFuture<ReadResultSet<E>>(invocationFuture, getContext().getSerializationService(), readManyAsyncResponseDecoder);
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
}
Aggregations