Search in sources :

Example 1 with ReadManyOperation

use of com.hazelcast.ringbuffer.impl.operations.ReadManyOperation in project hazelcast by hazelcast.

the class RingbufferProxy method readManyAsync.

@Override
public CompletionStage<ReadResultSet<E>> readManyAsync(long startSequence, int minCount, int maxCount, @Nullable 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(maxCount <= config.getCapacity(), "the maxCount should be smaller than or equal to the capacity");
    checkTrue(maxCount <= MAX_BATCH_SIZE, "maxCount can't be larger than " + MAX_BATCH_SIZE);
    Operation op = new ReadManyOperation<>(name, startSequence, minCount, maxCount, filter).setPartitionId(partitionId);
    OperationService operationService = getOperationService();
    return operationService.createInvocationBuilder(null, op, partitionId).setCallTimeout(Long.MAX_VALUE).invoke();
}
Also used : AddAllOperation(com.hazelcast.ringbuffer.impl.operations.AddAllOperation) GenericOperation(com.hazelcast.ringbuffer.impl.operations.GenericOperation) ReadOneOperation(com.hazelcast.ringbuffer.impl.operations.ReadOneOperation) ReadManyOperation(com.hazelcast.ringbuffer.impl.operations.ReadManyOperation) Operation(com.hazelcast.spi.impl.operationservice.Operation) AddOperation(com.hazelcast.ringbuffer.impl.operations.AddOperation) OperationService(com.hazelcast.spi.impl.operationservice.OperationService)

Aggregations

AddAllOperation (com.hazelcast.ringbuffer.impl.operations.AddAllOperation)1 AddOperation (com.hazelcast.ringbuffer.impl.operations.AddOperation)1 GenericOperation (com.hazelcast.ringbuffer.impl.operations.GenericOperation)1 ReadManyOperation (com.hazelcast.ringbuffer.impl.operations.ReadManyOperation)1 ReadOneOperation (com.hazelcast.ringbuffer.impl.operations.ReadOneOperation)1 Operation (com.hazelcast.spi.impl.operationservice.Operation)1 OperationService (com.hazelcast.spi.impl.operationservice.OperationService)1