use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class WanMapSupportingService method handleRemove.
private void handleRemove(WanMapRemoveEvent replicationRemove) {
String mapName = replicationRemove.getObjectName();
MapOperationProvider operationProvider = mapServiceContext.getMapOperationProvider(mapName);
MapOperation operation = operationProvider.createDeleteOperation(replicationRemove.getObjectName(), replicationRemove.getKey(), true);
try {
int partitionId = nodeEngine.getPartitionService().getPartitionId(replicationRemove.getKey());
Future future = nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME, operation, partitionId);
future.get();
wanEventTypeCounters.incrementRemove(mapName);
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapProxySupport method removeInternal.
protected boolean removeInternal(Object key, Data value) {
Data keyData = toDataWithStrategy(key);
MapOperation operation = operationProvider.createRemoveIfSameOperation(name, keyData, value);
return (Boolean) invokeOperation(keyData, operation);
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapProxySupport method putAsyncInternal.
protected InternalCompletableFuture<Data> putAsyncInternal(Object key, Data valueData, long ttl, TimeUnit ttlUnit, long maxIdle, TimeUnit maxIdleUnit) {
Data keyData = toDataWithStrategy(key);
int partitionId = partitionService.getPartitionId(keyData);
MapOperation operation = newPutOperation(keyData, valueData, ttl, ttlUnit, maxIdle, maxIdleUnit);
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 tryPutInternal.
protected boolean tryPutInternal(Object key, Data value, long timeout, TimeUnit timeunit) {
Data keyData = toDataWithStrategy(key);
long timeInMillis = timeInMsOrOneIfResultIsZero(timeout, timeunit);
MapOperation operation = operationProvider.createTryPutOperation(name, keyData, value, timeInMillis);
return (Boolean) invokeOperation(keyData, operation);
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapProxySupport method tryRemoveInternal.
protected boolean tryRemoveInternal(Object key, long timeout, TimeUnit timeunit) {
Data keyData = toDataWithStrategy(key);
MapOperation operation = operationProvider.createTryRemoveOperation(name, keyData, timeInMsOrOneIfResultIsZero(timeout, timeunit));
return (Boolean) invokeOperation(keyData, operation);
}
Aggregations