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);
}
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);
}
}
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);
}
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);
}
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();
}
Aggregations