use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class AbstractMapQueryMessageTask method invokeOnPartition.
private QueryResult invokeOnPartition(PartitionPredicate predicate, int partitionId) {
final OperationServiceImpl operationService = nodeEngine.getOperationService();
MapService mapService = nodeEngine.getService(getServiceName());
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
Query query = buildQuery(predicate);
MapOperation queryPartitionOperation = createQueryPartitionOperation(query, mapServiceContext);
queryPartitionOperation.setPartitionId(partitionId);
try {
return (QueryResult) operationService.invokeOnPartition(SERVICE_NAME, queryPartitionOperation, partitionId).get();
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapDeleteMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation op = operationProvider.createDeleteOperation(parameters.name, parameters.key, false);
op.setThreadId(parameters.threadId);
return op;
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapEvictMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
MapOperation operation = operationProvider.createEvictOperation(parameters.name, parameters.key, false);
operation.setThreadId(parameters.threadId);
return operation;
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class MapQueryPartitionIterator method fetch.
protected List<Data> fetch() {
final MapOperation op = mapProxy.getOperationProvider().createFetchWithQueryOperation(mapProxy.getName(), pointers, fetchSize, query);
final ResultSegment segment = invoke(op);
final QueryResult queryResult = (QueryResult) segment.getResult();
final List<Data> serialized = new ArrayList<>(queryResult.size());
for (QueryResultRow row : queryResult) {
serialized.add(row.getValue());
}
setLastTableIndex(serialized, segment.getPointers());
return serialized;
}
use of com.hazelcast.map.impl.operation.MapOperation in project hazelcast by hazelcast.
the class TransactionalMapProxySupport method putInternal.
Data putInternal(Data key, Data value, long ttl, TimeUnit timeUnit, NearCachingHook hook) {
VersionedValue versionedValue = lockAndGet(key, tx.getTimeoutMillis());
long timeInMillis = getTimeInMillis(ttl, timeUnit);
MapOperation op = operationProvider.createTxnSetOperation(name, key, value, versionedValue.version, timeInMillis);
tx.add(new MapTransactionLogRecord(name, key, getPartitionId(key), op, tx.getOwnerUuid(), tx.getTxnId(), hook));
return versionedValue.value;
}
Aggregations