Package com.alibaba.wasp.plan.action

Examples of com.alibaba.wasp.plan.action.TransactionAction


    DMLTransactionPlan transactionPlan = new DMLTransactionPlan(transactions);
    return transactionPlan;
  }

  private static TransactionAction createTransactionAction(String parentTable, List<DMLAction> dmlActions) throws TransactionParseException {
    TransactionAction transactionAction = new TransactionAction(parentTable, dmlActions);
    EntityGroupLocation entityGroupLocation = null;
    for (DMLAction dmlAction : dmlActions) {
      if(entityGroupLocation == null) {
        entityGroupLocation = dmlAction.getEntityGroupLocation();
      } else {
        if(entityGroupLocation.compareTo(dmlAction.getEntityGroupLocation()) != 0) {
          throw new TransactionParseException("child table row must be the same entityGoup with parent row. it means value of egk row must be same");
        }
      }
    }
    transactionAction.setEntityGroupLocation(entityGroupLocation);
    return transactionAction;
  }
View Full Code Here


  public List<ClientProtos.WriteResultProto> execDMLTransactionPlans(
      DMLTransactionPlan plan) throws ServiceException {
    List<ClientProtos.WriteResultProto> writeResultProtos = new ArrayList<ClientProtos.WriteResultProto>();
    List<TransactionAction> actions = plan.getActions();
    if (actions.size() == 1) {
      TransactionAction action = actions.get(0);
      EntityGroupInfo entityGroupInfo = action.getEntityGroupLocation()
          .getEntityGroupInfo();
      ServerName serverName = new ServerName(action.getEntityGroupLocation()
          .getHostname(), action.getEntityGroupLocation().getPort(),
          ServerName.NON_STARTCODE);
      try {
        if (workingOnLocalServer(server, serverName)) {
          ClientProtos.TransactionResponse response = server.transaction(
              entityGroupInfo.getEntityGroupName(), action);
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.plan.action.TransactionAction

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.