public void read(org.apache.thrift.protocol.TProtocol iprot, CompactionRequest struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // DBNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dbname = iprot.readString(); struct.setDbnameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TABLENAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.tablename = iprot.readString(); struct.setTablenameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PARTITIONNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.partitionname = iprot.readString(); struct.setPartitionnameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = org.apache.hadoop.hive.metastore.api.CompactionType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // RUNAS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.runas = iprot.readString(); struct.setRunasIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
public void write(org.apache.thrift.protocol.TProtocol oprot, CompactionRequest struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.dbname != null) { oprot.writeFieldBegin(DBNAME_FIELD_DESC); oprot.writeString(struct.dbname); oprot.writeFieldEnd(); } if (struct.tablename != null) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(struct.tablename); oprot.writeFieldEnd(); } if (struct.partitionname != null) { if (struct.isSetPartitionname()) { oprot.writeFieldBegin(PARTITIONNAME_FIELD_DESC); oprot.writeString(struct.partitionname); oprot.writeFieldEnd(); } } if (struct.type != null) { oprot.writeFieldBegin(TYPE_FIELD_DESC); oprot.writeI32(struct.type.getValue()); oprot.writeFieldEnd(); } if (struct.runas != null) { if (struct.isSetRunas()) { oprot.writeFieldBegin(RUNAS_FIELD_DESC); oprot.writeString(struct.runas); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }