Пример #1
0
  @Override
  public void deserializeStateData(final InputStream stream) throws IOException {
    super.deserializeStateData(stream);

    MasterProcedureProtos.AddColumnFamilyStateData addCFMsg =
        MasterProcedureProtos.AddColumnFamilyStateData.parseDelimitedFrom(stream);
    user = MasterProcedureUtil.toUserInfo(addCFMsg.getUserInfo());
    tableName = ProtobufUtil.toTableName(addCFMsg.getTableName());
    cfDescriptor = HColumnDescriptor.convert(addCFMsg.getColumnfamilySchema());
    if (addCFMsg.hasUnmodifiedTableSchema()) {
      unmodifiedHTableDescriptor = HTableDescriptor.convert(addCFMsg.getUnmodifiedTableSchema());
    }
  }
Пример #2
0
  @Override
  public void serializeStateData(final OutputStream stream) throws IOException {
    super.serializeStateData(stream);

    MasterProcedureProtos.AddColumnFamilyStateData.Builder addCFMsg =
        MasterProcedureProtos.AddColumnFamilyStateData.newBuilder()
            .setUserInfo(MasterProcedureUtil.toProtoUserInfo(user))
            .setTableName(ProtobufUtil.toProtoTableName(tableName))
            .setColumnfamilySchema(cfDescriptor.convert());
    if (unmodifiedHTableDescriptor != null) {
      addCFMsg.setUnmodifiedTableSchema(unmodifiedHTableDescriptor.convert());
    }

    addCFMsg.build().writeDelimitedTo(stream);
  }