Examples of invokeOnPartition()


Examples of com.hazelcast.spi.OperationService.invokeOnPartition()

        final NodeEngine nodeEngine = getNodeEngine();
        TxnLockAndGetOperation operation = new TxnLockAndGetOperation(name, key, timeout, ttl, getThreadId());
        try {
            int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
            final OperationService operationService = nodeEngine.getOperationService();
            Future<MultiMapResponse> f = operationService.
                    invokeOnPartition(MultiMapService.SERVICE_NAME, operation, partitionId);
            return f.get();
        } catch (Throwable t) {
            throw ExceptionUtil.rethrow(t);
        }
View Full Code Here

Examples of com.hazelcast.spi.OperationService.invokeOnPartition()

        final NodeEngine nodeEngine = getNodeEngine();
        TxnGenerateRecordIdOperation operation = new TxnGenerateRecordIdOperation(name, key);
        try {
            int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
            final OperationService operationService = nodeEngine.getOperationService();
            Future<Long> f = operationService.invokeOnPartition(MultiMapService.SERVICE_NAME, operation, partitionId);
            return f.get();
        } catch (Throwable t) {
            throw ExceptionUtil.rethrow(t);
        }
    }
View Full Code Here

Examples of com.hazelcast.spi.OperationService.invokeOnPartition()

        final Data k = serializationService.toData(key);
//        final Operation op = new CacheContainsKeyOperation(getDistributedObjectName(), k);
        Operation operation = operationProvider.createContainsKeyOperation(k);
        OperationService operationService = getNodeEngine().getOperationService();
        int partitionId = getPartitionId(getNodeEngine(), k);
        InternalCompletableFuture<Boolean> f = operationService.invokeOnPartition(getServiceName(), operation, partitionId);
        return f.getSafely();
    }

    @Override
    public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, CompletionListener completionListener) {
View Full Code Here

Examples of com.hazelcast.spi.OperationService.invokeOnPartition()

        final Integer completionId = registerCompletionLatch(1);
        Operation op = operationProvider.createEntryProcessorOperation(keyData, completionId, entryProcessor, arguments);
        try {
            OperationService operationService = getNodeEngine().getOperationService();
            int partitionId = getPartitionId(getNodeEngine(), keyData);
            final InternalCompletableFuture<T> f = operationService.invokeOnPartition(getServiceName(), op, partitionId);
            final T safely = f.getSafely();
            waitCompletionLatch(completionId);
            return safely;
        } catch (CacheException ce) {
            deregisterCompletionLatch(completionId);
View Full Code Here

Examples of com.hazelcast.spi.OperationService.invokeOnPartition()

        for (Integer partitionId : partitionIds) {
            QueryPartitionOperation queryPartitionOperation = new QueryPartitionOperation(mapName, predicate);
            queryPartitionOperation.setPartitionId(partitionId);
            try {
                Future f =
                        operationService.invokeOnPartition(MapService.SERVICE_NAME, queryPartitionOperation, partitionId);
                futures.add(f);
            } catch (Throwable t) {
                throw ExceptionUtil.rethrow(t);
            }
        }
View Full Code Here

Examples of com.hazelcast.spi.OperationService.invokeOnPartition()

        //CREATE THE CONFIG ON PARTITION BY cacheNamePrefix using a request
        final CacheCreateConfigOperation cacheCreateConfigOperation = new CacheCreateConfigOperation(cacheConfig);
        final OperationService operationService = nodeEngine.getOperationService();

        int partitionId = nodeEngine.getPartitionService().getPartitionId(cacheConfig.getNameWithPrefix());
        final InternalCompletableFuture<CacheConfig<K, V>> f = operationService
                .invokeOnPartition(CacheService.SERVICE_NAME, cacheCreateConfigOperation, partitionId);
        return f.getSafely();
    }

    @Override
View Full Code Here

Examples of com.hazelcast.spi.OperationService.invokeOnPartition()

                for (final Map.Entry<Integer, MapEntrySet> entry : entryMap.entrySet()) {
                    final Integer partitionId = entry.getKey();
                    final PutAllOperation op = new PutAllOperation(name, entry.getValue());
                    op.setPartitionId(partitionId);
                    futures.add(operationService.invokeOnPartition(SERVICE_NAME, op, partitionId));
                }

                for (Future future : futures) {
                    future.get();
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.