Package com.alibaba.wasp.protobuf.generated.MetaProtos

Examples of com.alibaba.wasp.protobuf.generated.MetaProtos.MessageProto


  @Test
  public void testDelete() throws InvalidProtocolBufferException {
    String tableName = "test";
    String primary = "1234";
    DeleteAction action = new DeleteAction(tableName, Bytes.toBytes(primary));
    MessageProto message = ProtobufUtil.convertDeleteAction(action);
    action = (DeleteAction) ProtobufUtil.convertWriteAction(message);
    Assert.assertTrue(tableName.equals(action.getFTableName()));
    Assert.assertTrue(primary.equals(Bytes.toString(action.getCombinedPrimaryKey())));
  }
View Full Code Here


    String columnName = "col";
    String value = "8899";
    InsertAction action = new InsertAction(tableName, Bytes.toBytes(primary));
    action.addEntityColumn(tableName, familyName, columnName, DataType.STRING,
        Bytes.toBytes(value));
    MessageProto message = ProtobufUtil.convertInsertAction(action);
    action = (InsertAction) ProtobufUtil.convertWriteAction(message);
    Assert.assertTrue(tableName.equals(action.getFTableName()));
    Assert.assertTrue(primary.equals(Bytes.toString(action.getCombinedPrimaryKey())));
    Assert.assertTrue(action.getColumns().get(0).getFamilyName()
        .equals(familyName)
View Full Code Here

    String columnName = "col";
    String value = "8899";
    UpdateAction action = new UpdateAction(tableName, Bytes.toBytes(primary));
    action.addEntityColumn(tableName, familyName, columnName, DataType.STRING,
        Bytes.toBytes(value));
    MessageProto message = ProtobufUtil.convertUpdateAction(action);
    action = (UpdateAction) ProtobufUtil.convertWriteAction(message);
    Assert.assertTrue(tableName.equals(action.getFTableName()));
    Assert.assertTrue(primary.equals(Bytes.toString(action.getCombinedPrimaryKey())));
    Assert.assertTrue(action.getColumns().get(0).getFamilyName()
        .equals(familyName)
View Full Code Here

   * @throws com.google.protobuf.InvalidProtocolBufferException
   */
  public static byte[] toMessage(Message message)
      throws InvalidProtocolBufferException {
    Action action = (Action) message;
    MessageProto proto = ProtobufUtil.convertWriteAction(action);
    return proto.toByteArray();
  }
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.protobuf.generated.MetaProtos.MessageProto

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.