public void run() throws Exception {
   for (Operation op : opList) {
     op.setNodeEngine(getNodeEngine())
         .setServiceName(getServiceName())
         .setPartitionId(getPartitionId());
     op.beforeRun();
     op.run();
     op.afterRun();
   }
   getOrCreateContainer().unlock(dataKey, caller, threadId);
 }
 private void ensureBackupOperationInitialized() {
   if (backupOp.getNodeEngine() == null) {
     backupOp.setNodeEngine(getNodeEngine());
     backupOp.setPartitionId(getPartitionId());
     backupOp.setReplicaIndex(getReplicaIndex());
     backupOp.setCallerUuid(getCallerUuid());
     OperationAccessor.setCallerAddress(backupOp, getCallerAddress());
     OperationAccessor.setInvocationTime(backupOp, Clock.currentTimeMillis());
     backupOp.setOperationResponseHandler(createEmptyResponseHandler());
   }
 }
Exemple #3
0
  @Override
  public void run() throws Exception {
    if (!valid) {
      return;
    }
    final NodeEngine nodeEngine = getNodeEngine();
    final PartitionServiceImpl partitionService =
        (PartitionServiceImpl) nodeEngine.getPartitionService();
    partitionService.updatePartitionReplicaVersions(
        getPartitionId(), replicaVersions, getReplicaIndex());

    if (backupOp != null) {
      backupOp.setNodeEngine(nodeEngine);
      backupOp.setResponseHandler(ResponseHandlerFactory.createEmptyResponseHandler());
      backupOp.setCallerUuid(getCallerUuid());
      OperationAccessor.setCallerAddress(backupOp, getCallerAddress());
      OperationAccessor.setInvocationTime(backupOp, Clock.currentTimeMillis());

      final OperationService operationService = nodeEngine.getOperationService();
      operationService.runOperation(backupOp);
    }
  }
  protected void startClusterMerge(final Address targetAddress) {
    ClusterServiceImpl clusterService = node.clusterService;

    if (!prepareClusterState(clusterService)) {
      return;
    }

    OperationService operationService = node.nodeEngine.getOperationService();
    Collection<Member> memberList = clusterService.getMembers();
    for (Member member : memberList) {
      if (!member.localMember()) {
        Operation op = new MergeClustersOperation(targetAddress);
        operationService.invokeOnTarget(ClusterServiceImpl.SERVICE_NAME, op, member.getAddress());
      }
    }

    Operation mergeClustersOperation = new MergeClustersOperation(targetAddress);
    mergeClustersOperation
        .setNodeEngine(node.nodeEngine)
        .setService(clusterService)
        .setOperationResponseHandler(createEmptyResponseHandler());
    operationService.runOperationOnCallingThread(mergeClustersOperation);
  }