Search in sources :

Example 1 with AddOperation

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

the class RingbufferProxy method add.

@Override
public long add(E item) {
    checkNotNull(item, "item can't be null");
    Operation op = new AddOperation(name, toData(item), OVERWRITE).setPartitionId(partitionId);
    InternalCompletableFuture<Long> f = invokeOnPartition(op);
    return f.join();
}
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) AddOperation(com.hazelcast.ringbuffer.impl.operations.AddOperation) Operation(com.hazelcast.spi.Operation) AddOperation(com.hazelcast.ringbuffer.impl.operations.AddOperation)

Example 2 with AddOperation

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

the class RingbufferProxy method addAsync.

@Override
public ICompletableFuture<Long> addAsync(E item, OverflowPolicy overflowPolicy) {
    checkNotNull(item, "item can't be null");
    checkNotNull(overflowPolicy, "overflowPolicy can't be null");
    Operation op = new AddOperation(name, toData(item), overflowPolicy).setPartitionId(partitionId);
    return invokeOnPartition(op);
}
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) AddOperation(com.hazelcast.ringbuffer.impl.operations.AddOperation) Operation(com.hazelcast.spi.Operation) AddOperation(com.hazelcast.ringbuffer.impl.operations.AddOperation)

Aggregations

AddAllOperation (com.hazelcast.ringbuffer.impl.operations.AddAllOperation)2 AddOperation (com.hazelcast.ringbuffer.impl.operations.AddOperation)2 GenericOperation (com.hazelcast.ringbuffer.impl.operations.GenericOperation)2 ReadManyOperation (com.hazelcast.ringbuffer.impl.operations.ReadManyOperation)2 ReadOneOperation (com.hazelcast.ringbuffer.impl.operations.ReadOneOperation)2 Operation (com.hazelcast.spi.Operation)2