use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class TransactionalMapProxySupport method putIfAbsentInternal.
public Data putIfAbsentInternal(Data key, Data value) {
boolean unlockImmediately = !valueMap.containsKey(key);
VersionedValue versionedValue = lockAndGet(key, tx.getTimeoutMillis());
if (versionedValue.value != null) {
if (unlockImmediately) {
unlock(key, versionedValue);
return versionedValue.value;
}
addUnlockTransactionRecord(key, versionedValue.version);
return versionedValue.value;
}
MapOperation operation = operationProvider.createTxnSetOperation(name, key, value, versionedValue.version, -1);
tx.add(new MapTransactionLogRecord(name, key, getPartitionId(key), operation, versionedValue.version, tx.getOwnerUuid()));
return versionedValue.value;
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class TransactionalMapProxySupport method getInternal.
public Object getInternal(Data key) {
if (nearCacheEnabled) {
Object value = getCachedValue(key, true);
if (value != NOT_CACHED) {
return value;
}
}
MapOperation operation = operationProvider.createGetOperation(name, key);
operation.setThreadId(ThreadUtil.getThreadId());
int partitionId = partitionService.getPartitionId(key);
try {
Future future = operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
return future.get();
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapContainsKeyMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
MapOperation operation = getMapOperationProvider(parameters.name).createContainsKeyOperation(parameters.name, parameters.key);
operation.setThreadId(parameters.threadId);
return operation;
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapGetEntryViewMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation op = operationProvider.createGetEntryViewOperation(parameters.name, parameters.key);
op.setThreadId(parameters.threadId);
return op;
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapPutIfAbsentWithMaxIdleMessageTask method prepareOperation.
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation op = operationProvider.createPutIfAbsentOperation(parameters.name, parameters.key, parameters.value, parameters.ttl, parameters.maxIdle);
op.setThreadId(parameters.threadId);
return op;
}
Aggregations