Search in sources :

Example 1 with SERVICE_NAME

use of com.hazelcast.map.impl.MapService.SERVICE_NAME in project hazelcast by hazelcast.

the class AbstractMapQueryMessageTask method createInvocationsForMissingPartitions.

private void createInvocationsForMissingPartitions(PartitionIdSet missingPartitionsList, List<Future> futures, Predicate predicate) {
    final OperationServiceImpl operationService = nodeEngine.getOperationService();
    MapService mapService = nodeEngine.getService(getServiceName());
    MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    Query query = buildQuery(predicate);
    PrimitiveIterator.OfInt missingPartitionIterator = missingPartitionsList.intIterator();
    missingPartitionIterator.forEachRemaining((IntConsumer) partitionId -> {
        MapOperation queryPartitionOperation = createQueryPartitionOperation(query, mapServiceContext);
        queryPartitionOperation.setPartitionId(partitionId);
        try {
            Future future = operationService.invokeOnPartition(SERVICE_NAME, queryPartitionOperation, partitionId);
            futures.add(future);
        } catch (Throwable t) {
            throw rethrow(t);
        }
    });
}
Also used : Query(com.hazelcast.map.impl.query.Query) PartitionPredicate(com.hazelcast.query.PartitionPredicate) Member(com.hazelcast.cluster.Member) IntConsumer(java.util.function.IntConsumer) QueryResultSizeExceededException(com.hazelcast.map.QueryResultSizeExceededException) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) ExceptionUtil.rethrow(com.hazelcast.internal.util.ExceptionUtil.rethrow) Aggregator(com.hazelcast.aggregation.Aggregator) ArrayList(java.util.ArrayList) Future(java.util.concurrent.Future) AbstractCallableMessageTask(com.hazelcast.client.impl.protocol.task.AbstractCallableMessageTask) DATA_MEMBER_SELECTOR(com.hazelcast.cluster.memberselector.MemberSelectors.DATA_MEMBER_SELECTOR) Operation(com.hazelcast.spi.impl.operationservice.Operation) ActionConstants(com.hazelcast.security.permission.ActionConstants) LinkedList(java.util.LinkedList) Predicate(com.hazelcast.query.Predicate) QueryException(com.hazelcast.query.QueryException) HazelcastException(com.hazelcast.core.HazelcastException) MapOperation(com.hazelcast.map.impl.operation.MapOperation) Connection(com.hazelcast.internal.nio.Connection) SetUtil(com.hazelcast.internal.util.SetUtil) Collection(java.util.Collection) MapService(com.hazelcast.map.impl.MapService) Result(com.hazelcast.map.impl.query.Result) MapServiceContext(com.hazelcast.map.impl.MapServiceContext) Node(com.hazelcast.instance.impl.Node) PrimitiveIterator(java.util.PrimitiveIterator) ExecutionException(java.util.concurrent.ExecutionException) SERVICE_NAME(com.hazelcast.map.impl.MapService.SERVICE_NAME) List(java.util.List) Permission(java.security.Permission) IterationType(com.hazelcast.internal.util.IterationType) Projection(com.hazelcast.projection.Projection) PartitionIdSet(com.hazelcast.internal.util.collection.PartitionIdSet) MapPermission(com.hazelcast.security.permission.MapPermission) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) Query(com.hazelcast.map.impl.query.Query) PrimitiveIterator(java.util.PrimitiveIterator) Future(java.util.concurrent.Future) 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)

Aggregations

Aggregator (com.hazelcast.aggregation.Aggregator)1 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 AbstractCallableMessageTask (com.hazelcast.client.impl.protocol.task.AbstractCallableMessageTask)1 Member (com.hazelcast.cluster.Member)1 DATA_MEMBER_SELECTOR (com.hazelcast.cluster.memberselector.MemberSelectors.DATA_MEMBER_SELECTOR)1 HazelcastException (com.hazelcast.core.HazelcastException)1 Node (com.hazelcast.instance.impl.Node)1 Connection (com.hazelcast.internal.nio.Connection)1 ExceptionUtil.rethrow (com.hazelcast.internal.util.ExceptionUtil.rethrow)1 IterationType (com.hazelcast.internal.util.IterationType)1 SetUtil (com.hazelcast.internal.util.SetUtil)1 PartitionIdSet (com.hazelcast.internal.util.collection.PartitionIdSet)1 QueryResultSizeExceededException (com.hazelcast.map.QueryResultSizeExceededException)1 MapService (com.hazelcast.map.impl.MapService)1 SERVICE_NAME (com.hazelcast.map.impl.MapService.SERVICE_NAME)1 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)1 MapOperation (com.hazelcast.map.impl.operation.MapOperation)1 Query (com.hazelcast.map.impl.query.Query)1 Result (com.hazelcast.map.impl.query.Result)1 Projection (com.hazelcast.projection.Projection)1