Package com.alibaba.wasp.fserver

Examples of com.alibaba.wasp.fserver.OperationStatus


        }
        QueryResult queryResult = new QueryResult(resultMap);
        results.add(queryResult);
      } else {
        ClientProtos.WriteResultProto writeResultProto = result.getWriteResult();
        OperationStatus status = new OperationStatus(
            OperationStatusCode.valueOf(writeResultProto.getCode().name()),
            writeResultProto.getExceptionMsg(),
            writeResultProto.getExceptionClassName());
        WriteResult writeResult = new WriteResult(status);
        results.add(writeResult);
View Full Code Here


            values.add(v);
          }
          result.add(values.toArray(new Value[values.size()]));
          lableAliasInited = true;
        } else {
          OperationStatus operationStatus = executeResult.getStatus();

          // write
          if ((FConstants.OperationStatusCode.SUCCESS.name())
              .equals(operationStatus.getOperationStatusCode().name())) {
            effectNums++;
          } else if (((FConstants.OperationStatusCode.FAILURE.name())
              .equals(operationStatus.getOperationStatusCode().name()))) {
            String exceptionClassName = operationStatus.getExceptionClassname();
            String exceptionMsg = operationStatus.getExceptionMsg();

            if (StringUtils.isNullOrEmpty(exceptionClassName)) {
              continue;
            }
View Full Code Here

    String insert = "Insert into " + TABLE_NAME
        + " (column1,column2,column3) values (7,234,'def');";
    Pair<String, Pair<Boolean, List<ExecuteResult>>> insertRet = client
        .execute(insert);

    OperationStatus operationStatus = insertRet.getSecond().getSecond().get(0)
        .getStatus();
    assertTrue(operationStatus.getOperationStatusCode() == OperationStatusCode.FAILURE);
    assertTrue(operationStatus.getExceptionClassname().equals(
        "com.alibaba.wasp.PrimaryKeyAlreadyExistsException"));
  }
View Full Code Here

    for (EntityGroup entityGroup : entityGroups) {
      Subscriber subscriber = builder.build(entityGroup);
      List<Message> messages = subscriber.receive();
      assertTrue(messages != null && messages.size() == 1);
      for (Message message : messages) {
        OperationStatus status = subscriber.doAsynchronous(message);
        assertTrue(status == OperationStatus.SUCCESS);
      }
    }
  }
View Full Code Here

  @Override
  public OperationStatus doAsynchronous(Message message) {
    if (!message.isCommited()) {
      return OperationStatus.SUCCESS;
    }
    OperationStatus status = entityGroup.doAsynchronous(message);
    if (status.getOperationStatusCode() != OperationStatusCode.SUCCESS) {
      return status;
    } else {
      Delete delete = new Delete(currentMessageRow);
      try {
        this.action.delete(FConstants.MESSAGEQUEUE_TABLENAME, delete);
View Full Code Here

      }
    } else if (updateActions.size() > 1) {
      Map<EntityGroupInfo, List<Action>> actionMap = getActionMap(plan
          .getActions());
      boolean ret = twoPhaseCommit.submit(actionMap);
      OperationStatus status = ret ? OperationStatus.SUCCESS
          : OperationStatus.FAILURE;
      writeResultProtos.add(ResponseConverter.buildUpdateResponse(status)
          .getResult());
    }
    LOG.debug("ExecUpdatePlan:" + plan.toString() + ",SUCCESS:"
View Full Code Here

      }
    } else if (actions.size() > 1) {
      Map<EntityGroupInfo, List<Action>> actionMap = getActionMap(plan
          .getActions());
      boolean ret = twoPhaseCommit.submit(actionMap);
      OperationStatus status = ret ? OperationStatus.SUCCESS
          : OperationStatus.FAILURE;
      writeResultProtos.add(ResponseConverter.buildInsertResponse(status)
          .getResult());
    }
    LOG.debug("ExecInsertPlan:" + plan.toString() + ",SUCCESS:"
View Full Code Here

      }
    } else if (actions.size() > 1) {
      Map<EntityGroupInfo, List<Action>> actionMap = getActionMap(plan
          .getActions());
      boolean ret = twoPhaseCommit.submit(actionMap);
      OperationStatus status = ret ? OperationStatus.SUCCESS
          : OperationStatus.FAILURE;
      writeResultProtos.add(ResponseConverter.buildDeleteResponse(status)
          .getResult());
    }
    LOG.debug("ExecDeletePlan:" + plan.toString() + ",SUCCESS:"
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.fserver.OperationStatus

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.