use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapReplaceMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation op = operationProvider.createReplaceOperation(parameters.name, parameters.key, parameters.value);
op.setThreadId(parameters.threadId);
return op;
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapProxySupport method deleteInternal.
protected void deleteInternal(Data key) {
MapOperation operation = operationProvider.createDeleteOperation(name, key);
invokeOperation(key, operation);
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapProxySupport method containsKeyInternal.
protected boolean containsKeyInternal(Data key) {
int partitionId = partitionService.getPartitionId(key);
MapOperation containsKeyOperation = operationProvider.createContainsKeyOperation(name, key);
containsKeyOperation.setThreadId(ThreadUtil.getThreadId());
containsKeyOperation.setServiceName(SERVICE_NAME);
try {
Future future = operationService.invokeOnPartition(SERVICE_NAME, containsKeyOperation, partitionId);
return (Boolean) toObject(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 executeOnKeyInternal.
public InternalCompletableFuture<Object> executeOnKeyInternal(Data key, EntryProcessor entryProcessor, ExecutionCallback<Object> callback) {
int partitionId = partitionService.getPartitionId(key);
MapOperation operation = operationProvider.createEntryOperation(name, key, entryProcessor);
operation.setThreadId(ThreadUtil.getThreadId());
try {
if (callback == null) {
return operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
} else {
return operationService.createInvocationBuilder(SERVICE_NAME, operation, partitionId).setExecutionCallback(new MapExecutionCallbackAdapter(callback)).invoke();
}
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class TransactionalMapProxySupport method putInternal.
public Data putInternal(Data key, Data value, long ttl, TimeUnit timeUnit) {
VersionedValue versionedValue = lockAndGet(key, tx.getTimeoutMillis());
long timeInMillis = getTimeInMillis(ttl, timeUnit);
MapOperation operation = operationProvider.createTxnSetOperation(name, key, value, versionedValue.version, timeInMillis);
tx.add(new MapTransactionLogRecord(name, key, getPartitionId(key), operation, versionedValue.version, tx.getOwnerUuid()));
return versionedValue.value;
}
Aggregations