Search in sources :

Example 16 with MapOperation

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);
    }
}
Also used : Query(com.hazelcast.map.impl.query.Query) MapService(com.hazelcast.map.impl.MapService) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) MapServiceContext(com.hazelcast.map.impl.MapServiceContext) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Example 17 with MapOperation

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;
}
Also used : MapOperationProvider(com.hazelcast.map.impl.operation.MapOperationProvider) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Example 18 with MapOperation

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;
}
Also used : MapOperationProvider(com.hazelcast.map.impl.operation.MapOperationProvider) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Example 19 with MapOperation

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;
}
Also used : QueryResult(com.hazelcast.map.impl.query.QueryResult) QueryResultRow(com.hazelcast.map.impl.query.QueryResultRow) ArrayList(java.util.ArrayList) ResultSegment(com.hazelcast.map.impl.query.ResultSegment) Data(com.hazelcast.internal.serialization.Data) MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Example 20 with MapOperation

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;
}
Also used : MapOperation(com.hazelcast.map.impl.operation.MapOperation)

Aggregations

MapOperation (com.hazelcast.map.impl.operation.MapOperation)80 MapOperationProvider (com.hazelcast.map.impl.operation.MapOperationProvider)25 Data (com.hazelcast.internal.serialization.Data)23 Future (java.util.concurrent.Future)16 Data (com.hazelcast.nio.serialization.Data)6 ArrayList (java.util.ArrayList)5 InternalCompletableFuture (com.hazelcast.spi.impl.InternalCompletableFuture)4 SerializationService (com.hazelcast.internal.serialization.SerializationService)3 MapService (com.hazelcast.map.impl.MapService)3 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)3 InternalCompletableFuture (com.hazelcast.spi.InternalCompletableFuture)3 AbstractDistributedObject (com.hazelcast.spi.impl.AbstractDistributedObject)3 InitializingObject (com.hazelcast.spi.impl.InitializingObject)3 InternalCompletableFuture.newCompletedFuture (com.hazelcast.spi.impl.InternalCompletableFuture.newCompletedFuture)3 InvocationFuture (com.hazelcast.spi.impl.operationservice.impl.InvocationFuture)3 OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)3 List (java.util.List)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 EntryView (com.hazelcast.core.EntryView)2 EntryProcessor (com.hazelcast.map.EntryProcessor)2