Package com.hazelcast.spi

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


        QueryResultSet result = new QueryResultSet(nodeEngine.getSerializationService(), iterationType, dataResult);
        List<Integer> missingList = new ArrayList<Integer>();
        try {
            List<Future> flist = new ArrayList<Future>();
            for (MemberImpl member : members) {
                Future future = operationService
                        .invokeOnTarget(SERVICE_NAME, new QueryOperation(name, predicate), member.getAddress());
                flist.add(future);
            }
            for (Future future : flist) {
                QueryResult queryResult = (QueryResult) future.get();
View Full Code Here


        if (durability > 0 && backupAddresses != null && transactionType == TransactionType.TWO_PHASE) {
            final OperationService operationService = nodeEngine.getOperationService();
            List<Future> futures = new ArrayList<Future>(backupAddresses.length);
            for (Address backupAddress : backupAddresses) {
                if (nodeEngine.getClusterService().getMember(backupAddress) != null) {
                    final Future f = operationService.invokeOnTarget(TransactionManagerServiceImpl.SERVICE_NAME,
                            new BeginTxBackupOperation(txOwnerUuid, txnId, xid), backupAddress);
                    futures.add(f);
                }
            }
            for (Future future : futures) {
View Full Code Here

            // replicate tx log
            if (durability > 0) {
                final OperationService operationService = nodeEngine.getOperationService();
                for (Address backupAddress : backupAddresses) {
                    if (nodeEngine.getClusterService().getMember(backupAddress) != null) {
                        final Future f = operationService.invokeOnTarget(TransactionManagerServiceImpl.SERVICE_NAME,
                                new ReplicateTxOperation(txLogs, txOwnerUuid, txnId, timeoutMillis, startTime),
                                backupAddress);
                        futures.add(f);
                    }
                }
View Full Code Here

                // rollback tx backup
                if (durability > 0 && transactionType.equals(TransactionType.TWO_PHASE)) {
                    for (Address backupAddress : backupAddresses) {
                        if (nodeEngine.getClusterService().getMember(backupAddress) != null) {
                            final Future f = operationService.invokeOnTarget(TransactionManagerServiceImpl.SERVICE_NAME,
                                    new RollbackTxBackupOperation(txnId), backupAddress);
                            futures.add(f);
                        }
                    }
                    for (Future future : futures) {
View Full Code Here

        if (durability > 0 && transactionType.equals(TransactionType.TWO_PHASE)) {
            final OperationService operationService = nodeEngine.getOperationService();
            for (Address backupAddress : backupAddresses) {
                if (nodeEngine.getClusterService().getMember(backupAddress) != null) {
                    try {
                        operationService.invokeOnTarget(TransactionManagerServiceImpl.SERVICE_NAME,
                                new PurgeTxBackupOperation(txnId), backupAddress);
                    } catch (Throwable e) {
                        nodeEngine.getLogger(getClass()).warning("Error during purging backups!", e);
                    }
                }
View Full Code Here

            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

    }

    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

        Collection<MemberImpl> members = nodeEngine.getClusterService().getMemberList();
        Collection<Future> calls = new ArrayList<Future>(members.size());
        for (MemberImpl member : members) {
            if (!member.localMember()) {
                RegistrationOperation operation = new RegistrationOperation(reg);
                Future f = operationService.invokeOnTarget(serviceName, operation, member.getAddress());
                calls.add(f);
            }
        }

        try {
View Full Code Here

        Collection<MemberImpl> members = nodeEngine.getClusterService().getMemberList();
        Collection<Future> calls = new ArrayList<Future>(members.size());
        for (MemberImpl member : members) {
            if (!member.localMember()) {
                DeregistrationOperation operation = new DeregistrationOperation(topic, id);
                Future f = operationService.invokeOnTarget(serviceName, operation, member.getAddress());
                calls.add(f);
            }
        }

        try {
View Full Code Here

        return result;
    }

    private Future queryOnLocalMember(String mapName, Predicate predicate, NodeEngine nodeEngine) {
        final OperationService operationService = nodeEngine.getOperationService();
        return operationService
                .invokeOnTarget(SERVICE_NAME,
                        new QueryOperation(mapName, predicate),
                        nodeEngine.getThisAddress());
    }
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.