Exemplo n.º 1
0
  private Backup newBackup(
      BackupAwareOperation backupAwareOp,
      Data backupOpData,
      long[] replicaVersions,
      int replicaIndex,
      boolean respondBack) {

    Operation op = (Operation) backupAwareOp;
    Backup backup = new Backup(backupOpData, op.getCallerAddress(), replicaVersions, respondBack);
    backup
        .setPartitionId(op.getPartitionId())
        .setReplicaIndex(replicaIndex)
        .setCallerUuid(nodeEngine.getLocalMember().getUuid());
    setCallId(backup, op.getCallId());

    return backup;
  }
  public void start() {
    logger.finest("Starting OperationService");

    ManagedExecutorService asyncExecutor =
        nodeEngine
            .getExecutionService()
            .register(
                ExecutionService.ASYNC_EXECUTOR,
                Runtime.getRuntime().availableProcessors(),
                ASYNC_QUEUE_CAPACITY,
                ExecutorType.CONCRETE);

    this.invocationContext =
        new Invocation.Context(
            asyncExecutor,
            nodeEngine.getClusterService().getClusterClock(),
            nodeEngine.getClusterService(),
            node.connectionManager,
            node.nodeEngine.getExecutionService(),
            nodeEngine.getProperties().getMillis(OPERATION_CALL_TIMEOUT_MILLIS),
            invocationRegistry,
            invocationMonitor,
            nodeEngine.getLocalMember().getUuid(),
            nodeEngine.getLogger(Invocation.class),
            node,
            nodeEngine,
            nodeEngine.getPartitionService(),
            this,
            operationExecutor,
            retryCount,
            serializationService,
            nodeEngine.getThisAddress());

    invocationMonitor.start();
    operationExecutor.start();
    asyncResponseHandler.start();
    slowOperationDetector.start();
  }