use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapReplicationSupportingService method handleRemove.
private void handleRemove(MapReplicationRemove replicationRemove) {
String mapName = replicationRemove.getMapName();
MapOperationProvider operationProvider = mapServiceContext.getMapOperationProvider(mapName);
MapOperation operation = operationProvider.createRemoveOperation(replicationRemove.getMapName(), replicationRemove.getKey(), true);
try {
int partitionId = nodeEngine.getPartitionService().getPartitionId(replicationRemove.getKey());
Future f = nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME, operation, partitionId);
f.get();
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
}
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapProxySupport method removeAsyncInternal.
protected InternalCompletableFuture<Data> removeAsyncInternal(Data key) {
int partitionId = getNodeEngine().getPartitionService().getPartitionId(key);
MapOperation operation = operationProvider.createRemoveOperation(name, key, false);
operation.setThreadId(ThreadUtil.getThreadId());
try {
long startTime = System.currentTimeMillis();
InternalCompletableFuture<Data> future = operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
if (statisticsEnabled) {
future.andThen(new IncrementStatsExecutionCallback<Data>(operation, startTime));
}
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 executeOnKeyInternal.
public Data executeOnKeyInternal(Data key, EntryProcessor entryProcessor) {
int partitionId = partitionService.getPartitionId(key);
MapOperation operation = operationProvider.createEntryOperation(name, key, entryProcessor);
operation.setThreadId(ThreadUtil.getThreadId());
try {
Future future = operationService.createInvocationBuilder(SERVICE_NAME, operation, partitionId).setResultDeserialized(false).invoke();
return (Data) future.get();
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapProxySupport method setInternal.
//warning: When UpdateEvent is fired it does *NOT* contain oldValue.
//see this: https://github.com/hazelcast/hazelcast/pull/6088#issuecomment-136025968
protected void setInternal(Data key, Data value, long ttl, TimeUnit timeunit) {
MapOperation operation = operationProvider.createSetOperation(name, key, value, timeunit.toMillis(ttl));
invokeOperation(key, operation);
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapProxySupport method getAsyncInternal.
protected InternalCompletableFuture<Data> getAsyncInternal(Data key) {
int partitionId = partitionService.getPartitionId(key);
MapOperation operation = operationProvider.createGetOperation(name, key);
try {
long startTime = System.currentTimeMillis();
InternalCompletableFuture<Data> future = operationService.createInvocationBuilder(SERVICE_NAME, operation, partitionId).setResultDeserialized(false).invoke();
if (statisticsEnabled) {
future.andThen(new IncrementStatsExecutionCallback<Data>(operation, startTime));
}
return future;
} catch (Throwable t) {
throw rethrow(t);
}
}
Aggregations