Package com.alibaba.wasp.plan.action

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


    String tableName = "test";
    String primary = "1234";
    String familyName = "info";
    String columnName = "col";
    ReadModel model = ReadModel.SNAPSHOT;
    GetAction action = new GetAction(model, tableName, Bytes.toBytes(primary));
    action.addEntityColumn(tableName, familyName, columnName, DataType.STRING, null);
    action.addEntityColumn(tableName, familyName, columnName, DataType.STRING, null);
    GetActionProto proto = ProtobufUtil.toGetActionProto(action);
    action = (GetAction) ProtobufUtil.toGetAction(proto);
    Assert.assertTrue(model == action.getReaderMode());
    Assert.assertTrue(tableName.equals(action.getFTableName()));
    Assert.assertTrue(primary.equals(Bytes.toString(action.getCombinedPrimaryKey())));
    Assert.assertTrue(action.getColumns().get(0).getFamilyName()
        .equals(familyName)
        && action.getColumns().get(0).getColumnName().equals(columnName));
    Assert.assertTrue(action.getColumns().get(1).getFamilyName()
        .equals(familyName)
        && action.getColumns().get(1).getColumnName().equals(columnName));
  }
View Full Code Here


    public Pair<List<ClientProtos.QueryResultProto>, List<ClientProtos.StringDataTypePair>> execute()
        throws ServiceException {
      try {
        queryResultProtos.clear();

        GetAction action = plan.getGetAction();
        EntityGroupLocation entityGroupLocation = action
            .getEntityGroupLocation();
        EntityGroupInfo entityGroupInfo = entityGroupLocation
            .getEntityGroupInfo();
        ServerName serverName = new ServerName(
            entityGroupLocation.getHostname(), entityGroupLocation.getPort(),
View Full Code Here

    Condition entityGroupKeyCondition = queryInfo.getField(table
        .getEntityGroupKey().getName());
    if (queryInfo.getType() == QueryInfo.QueryType.GET) {
      byte[] primaryKey = RowBuilder.build().genRowkey(primaryKeyPairs);
      // check if the column is table's primary key.
      action = new GetAction(context.getReadModel(), table.getTableName(),
          primaryKey, this.buildEntityColumnsForGet(table, metaEventOperation,
              selectItem));
      ((GetAction)action).setForUpdate(queryInfo.isForUpdate());
      if (context.isGenWholePlan()) {
        // get entityGroupLocation according to entity group key.
View Full Code Here

        druidParser.generatePlan(context);
        plan = context.getPlan();
        LOG.info("Plan is " + plan.toString());
        if (plan instanceof LocalQueryPlan) {
          LocalQueryPlan localQueryPlan = (LocalQueryPlan) plan;
          GetAction getAction = localQueryPlan.getGetAction();
          if (getAction != null) {
            LOG.info("GetAction " + getAction.toString());
            Result rs = eg.get(getAction);
            LOG.info("Result " + rs.toString());
            if (!rs.isEmpty()) {
              Collection<Field> columns = testFTable[i].getColumns().values();
              for (Field f : columns) {
View Full Code Here

TOP

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

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.