Search in sources :

Example 61 with MapOperation

use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.

the class MapProxySupport method replaceInternal.

protected boolean replaceInternal(Object key, Data expect, Data update) {
    Data keyData = toDataWithStrategy(key);
    MapOperation operation = operationProvider.createReplaceIfSameOperation(name, keyData, expect, update);
    return (Boolean) invokeOperation(keyData, operation);
}
Also used : Data(com.hazelcast.internal.serialization.Data) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Example 62 with MapOperation

use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.

the class MapProxySupport method removeAsyncInternal.

protected InternalCompletableFuture<Data> removeAsyncInternal(Object key) {
    Data keyData = toDataWithStrategy(key);
    int partitionId = partitionService.getPartitionId(keyData);
    MapOperation operation = operationProvider.createRemoveOperation(name, keyData);
    operation.setThreadId(getThreadId());
    try {
        long startTimeNanos = Timer.nanos();
        InvocationFuture<Data> future = operationService.invokeOnPartitionAsync(SERVICE_NAME, operation, partitionId);
        if (statisticsEnabled) {
            future.whenCompleteAsync(new IncrementStatsExecutionCallback<>(operation, startTimeNanos), CALLER_RUNS);
        }
        return future;
    } catch (Throwable t) {
        throw rethrow(t);
    }
}
Also used : Data(com.hazelcast.internal.serialization.Data) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Example 63 with MapOperation

use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.

the class MapProxySupport method deleteInternal.

protected void deleteInternal(Object key) {
    Data keyData = toDataWithStrategy(key);
    MapOperation operation = operationProvider.createDeleteOperation(name, keyData, false);
    invokeOperation(keyData, operation);
}
Also used : Data(com.hazelcast.internal.serialization.Data) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Example 64 with MapOperation

use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.

the class MapProxySupport method putTransientInternal.

protected void putTransientInternal(Object key, Data value, long ttl, TimeUnit ttlUnit, long maxIdle, TimeUnit maxIdleUnit) {
    Data keyData = toDataWithStrategy(key);
    MapOperation operation = newPutTransientOperation(keyData, value, ttl, ttlUnit, maxIdle, maxIdleUnit);
    invokeOperation(keyData, operation);
}
Also used : Data(com.hazelcast.internal.serialization.Data) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Example 65 with MapOperation

use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.

the class MapProxySupport method executeOnKeyInternal.

public InternalCompletableFuture<Data> executeOnKeyInternal(Object key, EntryProcessor entryProcessor) {
    Data keyData = toDataWithStrategy(key);
    int partitionId = partitionService.getPartitionId(keyData);
    MapOperation operation = operationProvider.createEntryOperation(name, keyData, entryProcessor);
    operation.setThreadId(getThreadId());
    validateEntryProcessorForSingleKeyProcessing(entryProcessor);
    return operationService.createInvocationBuilder(SERVICE_NAME, operation, partitionId).setResultDeserialized(false).invoke();
}
Also used : Data(com.hazelcast.internal.serialization.Data) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Aggregations

MapOperation (com.hazelcast.map.impl.operation.MapOperation)80 MapOperationProvider (com.hazelcast.map.impl.operation.MapOperationProvider)25 Data (com.hazelcast.internal.serialization.Data)23 Future (java.util.concurrent.Future)16 Data (com.hazelcast.nio.serialization.Data)6 ArrayList (java.util.ArrayList)5 InternalCompletableFuture (com.hazelcast.spi.impl.InternalCompletableFuture)4 SerializationService (com.hazelcast.internal.serialization.SerializationService)3 MapService (com.hazelcast.map.impl.MapService)3 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)3 InternalCompletableFuture (com.hazelcast.spi.InternalCompletableFuture)3 AbstractDistributedObject (com.hazelcast.spi.impl.AbstractDistributedObject)3 InitializingObject (com.hazelcast.spi.impl.InitializingObject)3 InternalCompletableFuture.newCompletedFuture (com.hazelcast.spi.impl.InternalCompletableFuture.newCompletedFuture)3 InvocationFuture (com.hazelcast.spi.impl.operationservice.impl.InvocationFuture)3 OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)3 List (java.util.List)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 EntryView (com.hazelcast.core.EntryView)2 EntryProcessor (com.hazelcast.map.EntryProcessor)2