Search in sources :

Example 1 with AddAllOperation

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

the class RingbufferProxy method addAllAsync.

@Override
public CompletionStage<Long> addAllAsync(@Nonnull Collection<? extends E> collection, @Nonnull OverflowPolicy overflowPolicy) {
    checkNotNull(collection, "collection can't be null");
    checkNotNull(overflowPolicy, "overflowPolicy can't be null");
    checkFalse(collection.isEmpty(), "collection can't be empty");
    checkTrue(collection.size() <= MAX_BATCH_SIZE, "collection can't be larger than " + MAX_BATCH_SIZE);
    Operation op = new AddAllOperation(name, toDataArray(collection), overflowPolicy).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) 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