Examples of OperationService


Examples of com.hazelcast.spi.OperationService

    public void memberAttributeChanged(MemberAttributeServiceEvent event) {
    }

    private void onOwnerDisconnected(final String caller) {
        InternalPartitionService partitionService = nodeEngine.getPartitionService();
        OperationService operationService = nodeEngine.getOperationService();
        Address thisAddress = nodeEngine.getThisAddress();

        for (String name : permitMap.keySet()) {
            int partitionId = partitionService.getPartitionId(getPartitionKey(name));
            InternalPartition partition = partitionService.getPartition(partitionId);

            if (thisAddress.equals(partition.getOwner())) {
                Operation op = new SemaphoreDeadMemberOperation(name, caller)
                        .setPartitionId(partitionId)
                        .setResponseHandler(createEmptyResponseHandler())
                        .setService(this)
                        .setNodeEngine(nodeEngine)
                        .setServiceName(SERVICE_NAME);
                operationService.executeOperation(op);
            }
        }
    }
View Full Code Here

Examples of com.hazelcast.spi.OperationService

        }
    }

    private <T> InternalCompletableFuture<T> invoke(Operation operation) {
        NodeEngine nodeEngine = getNodeEngine();
        OperationService operationService = nodeEngine.getOperationService();
        //noinspection unchecked
        return (InternalCompletableFuture) operationService.invokeOnPartition(
                SemaphoreService.SERVICE_NAME, operation, partitionId);
    }
View Full Code Here

Examples of com.hazelcast.spi.OperationService

        try {
            Collection<MemberImpl> members = node.clusterService.getMemberList();
            PartitionRuntimeState partitionState = createPartitionState(members);
            PartitionStateOperation op = new PartitionStateOperation(partitionState);

            OperationService operationService = nodeEngine.getOperationService();
            for (MemberImpl member : members) {
                if (!member.localMember()) {
                    try {
                        operationService.send(op, member.getAddress());
                    } catch (Exception e) {
                        logger.finest(e);
                    }
                }
            }
View Full Code Here

Examples of com.hazelcast.spi.OperationService

        }

        lock.lock();
        try {
            PartitionRuntimeState partitionState = createPartitionState(members);
            OperationService operationService = nodeEngine.getOperationService();
            List<Future> calls = new ArrayList<Future>(members.size());

            for (MemberImpl member : members) {
                if (!member.localMember()) {
                    try {
                        PartitionStateOperation op = new PartitionStateOperation(partitionState, true);
                        Future<Object> f = operationService
                                .invokeOnTarget(SERVICE_NAME, op, member.getAddress());
                        calls.add(f);
                    } catch (Exception e) {
                        logger.finest(e);
                    }
View Full Code Here

Examples of com.hazelcast.spi.OperationService

        versionMismatch = true;
    }

    public Object callOnAddress(Address address, Operation operation) {
        //todo: why are we always executing on the mapservice??
        OperationService operationService = instance.node.nodeEngine.getOperationService();
        Future future = operationService.invokeOnTarget(MapService.SERVICE_NAME, operation, address);
        try {
            return future.get();
        } catch (Throwable t) {
            StringWriter s = new StringWriter();
            t.printStackTrace(new PrintWriter(s));
View Full Code Here

Examples of com.hazelcast.spi.OperationService

        return callOnAddress(address, operation);
    }

    public void send(Address address, Operation operation) {
        //todo: clean up needed.
        OperationService operationService = instance.node.nodeEngine.getOperationService();

        operationService.createInvocationBuilder(MapService.SERVICE_NAME, operation, address).invoke();
    }
View Full Code Here

Examples of com.hazelcast.spi.OperationService

        }
    }

    private InternalCompletableFuture invoke(Operation operation, Data key) {
        int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
        OperationService operationService = nodeEngine.getOperationService();
        return operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
    }
View Full Code Here

Examples of com.hazelcast.spi.OperationService

        Collection<MultiMapRecord> coll = txMap.get(key);
        if (coll == null) {
            GetAllOperation operation = new GetAllOperation(name, key);
            try {
                int partitionId = getNodeEngine().getPartitionService().getPartitionId(key);
                final OperationService operationService = getNodeEngine().getOperationService();
                Future<MultiMapResponse> f = operationService.invokeOnPartition(
                        MultiMapService.SERVICE_NAME,
                        operation,
                        partitionId
                );
                MultiMapResponse response = f.get();
View Full Code Here

Examples of com.hazelcast.spi.OperationService

        Collection<MultiMapRecord> coll = txMap.get(key);
        if (coll == null) {
            CountOperation operation = new CountOperation(name, key);
            try {
                int partitionId = getNodeEngine().getPartitionService().getPartitionId(key);
                final OperationService operationService = getNodeEngine().getOperationService();
                Future<Integer> 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

    }

    public int size() {
        checkTransactionState();
        try {
            final OperationService operationService = getNodeEngine().getOperationService();
            final Map<Integer, Object> results = operationService.invokeOnAllPartitions(MultiMapService.SERVICE_NAME,
                    new MultiMapOperationFactory(name, MultiMapOperationFactory.OperationFactoryType.SIZE));
            int size = 0;
            for (Object obj : results.values()) {
                if (obj == null) {
                    continue;
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.