Package com.hazelcast.spi

Examples of com.hazelcast.spi.OperationService


        }

    }

    private void rollbackTxBackup() {
        final OperationService operationService = nodeEngine.getOperationService();
        final List<Future> futures = new ArrayList<Future>(txLogs.size());
        // 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);
                }
            }
View Full Code Here


        state = ROLLING_BACK;
    }

    private void purgeTxBackups() {
        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

            }
        }

        private void callDisconnectionOperation(ClientEndpoint endpoint) {
            Collection<MemberImpl> memberList = nodeEngine.getClusterService().getMemberList();
            OperationService operationService = nodeEngine.getOperationService();
            ClientDisconnectionOperation op = createClientDisconnectionOperation(endpoint.getUuid());
            operationService.runOperationOnCallingThread(op);

            for (MemberImpl member : memberList) {
                if (!member.localMember()) {
                    op = createClientDisconnectionOperation(endpoint.getUuid());
                    operationService.send(op, member.getAddress());
                }
            }
        }
View Full Code Here

        }
    }

    private InternalCompletableFuture invoke(Operation operation) {
        final NodeEngine nodeEngine = getNodeEngine();
        OperationService operationService = nodeEngine.getOperationService();
        return operationService.invokeOnPartition(QueueService.SERVICE_NAME, operation, getPartitionId());
    }
View Full Code Here

    }

    private Object invokeAndGetData(QueueOperation operation) {
        final NodeEngine nodeEngine = getNodeEngine();
        try {
            OperationService operationService = nodeEngine.getOperationService();
            Future f = operationService.invokeOnPartition(QueueService.SERVICE_NAME, operation, partitionId);
            return f.get();
        } catch (Throwable throwable) {
            throw ExceptionUtil.rethrow(throwable);
        }
    }
View Full Code Here

    }

    @Override
    public void run() throws Exception {
        if (operations != null && operations.length > 0) {
            final OperationService operationService = getNodeEngine().getOperationService();
            for (final Operation op : operations) {
                operationService.runOperationOnCallingThread(op);
            }
        }
    }
View Full Code Here

            throw new NullPointerException("Service name is required!");
        }
        if (name == null) {
            throw new NullPointerException("Object name is required!");
        }
        OperationService operationService = nodeEngine.getOperationService();
        Collection<MemberImpl> members = nodeEngine.getClusterService().getMemberList();
        Collection<Future> calls = new ArrayList<Future>(members.size());
        for (MemberImpl member : members) {
            if (member.localMember()) {
                continue;
            }

            DistributedObjectDestroyOperation operation = new DistributedObjectDestroyOperation(serviceName, name);
            Future f = operationService.createInvocationBuilder(SERVICE_NAME, operation, member.getAddress())
                                                          .setTryCount(TRY_COUNT).invoke();
            calls.add(f);
        }

        destroyLocalDistributedObject(serviceName, name, true);
View Full Code Here

            finalize(uuid, entry.getKey(), entry.getValue());
        }
    }

    private void finalize(String uuid, String txnId, TxBackupLog log) {
        OperationService operationService = nodeEngine.getOperationService();
        if (!uuid.equals(log.callerUuid)) {
            return;
        }

        //TODO shouldn't we remove TxBackupLog from map ?
        if (log.state == State.ACTIVE) {
            Collection<MemberImpl> memberList = nodeEngine.getClusterService().getMemberList();
            Collection<Future> futures = new ArrayList<Future>(memberList.size());
            for (MemberImpl member : memberList) {
                Operation op = new BroadcastTxRollbackOperation(txnId);
                Future f = operationService.invokeOnTarget(SERVICE_NAME, op, member.getAddress());
                futures.add(f);
            }

            try {
                long timeoutMillis = TransactionOptions.getDefault().getTimeoutMillis();
View Full Code Here

        }
        return xidSet.toArray(new Xid[xidSet.size()]);
    }

    private List<Future<SerializableCollection>> invokeRecoverOperations() {
        final OperationService operationService = nodeEngine.getOperationService();
        final ClusterService clusterService = nodeEngine.getClusterService();
        final Collection<MemberImpl> memberList = clusterService.getMemberList();

        List<Future<SerializableCollection>> futures
                = new ArrayList<Future<SerializableCollection>>(memberList.size() - 1);
        for (MemberImpl member : memberList) {
            if (member.localMember()) {
                continue;
            }
            final Future f = operationService.createInvocationBuilder(TransactionManagerServiceImpl.SERVICE_NAME,
                    new RecoverTxnOperation(), member.getAddress()).invoke();
            futures.add(f);
        }
        return futures;
    }
View Full Code Here

            }
            final List<PartitionContainer> partitionIds = partitionContainers.subList(start, end);
            for (PartitionContainer container : partitionIds) {
                // mark partition container as has on going expiration operation.
                container.setHasRunningCleanup(true);
                OperationService operationService = ExpirationManager.this.nodeEngine.getOperationService();
                operationService.executeOperation(createExpirationOperation(EXPIRATION_PERCENTAGE,
                        container.getPartitionId()));
            }
        }
View Full Code Here

TOP

Related Classes of com.hazelcast.spi.OperationService

Copyright © 2018 www.massapicom. 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.