public void write(org.apache.thrift.protocol.TProtocol oprot, ShowLocksResponseElement struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(LOCKID_FIELD_DESC); oprot.writeI64(struct.lockid); oprot.writeFieldEnd(); if (struct.dbname != null) { oprot.writeFieldBegin(DBNAME_FIELD_DESC); oprot.writeString(struct.dbname); oprot.writeFieldEnd(); } if (struct.tablename != null) { if (struct.isSetTablename()) { oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(struct.tablename); oprot.writeFieldEnd(); } } if (struct.partname != null) { if (struct.isSetPartname()) { oprot.writeFieldBegin(PARTNAME_FIELD_DESC); oprot.writeString(struct.partname); oprot.writeFieldEnd(); } } if (struct.state != null) { oprot.writeFieldBegin(STATE_FIELD_DESC); oprot.writeI32(struct.state.getValue()); oprot.writeFieldEnd(); } if (struct.type != null) { oprot.writeFieldBegin(TYPE_FIELD_DESC); oprot.writeI32(struct.type.getValue()); oprot.writeFieldEnd(); } if (struct.isSetTxnid()) { oprot.writeFieldBegin(TXNID_FIELD_DESC); oprot.writeI64(struct.txnid); oprot.writeFieldEnd(); } oprot.writeFieldBegin(LASTHEARTBEAT_FIELD_DESC); oprot.writeI64(struct.lastheartbeat); oprot.writeFieldEnd(); if (struct.isSetAcquiredat()) { oprot.writeFieldBegin(ACQUIREDAT_FIELD_DESC); oprot.writeI64(struct.acquiredat); oprot.writeFieldEnd(); } if (struct.user != null) { oprot.writeFieldBegin(USER_FIELD_DESC); oprot.writeString(struct.user); oprot.writeFieldEnd(); } if (struct.hostname != null) { oprot.writeFieldBegin(HOSTNAME_FIELD_DESC); oprot.writeString(struct.hostname); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public void read(org.apache.thrift.protocol.TProtocol iprot, ShowLocksResponseElement 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: // LOCKID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.lockid = iprot.readI64(); struct.setLockidIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // 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 3: // 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 4: // PARTNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.partname = iprot.readString(); struct.setPartnameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // STATE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.state = org.apache.hadoop.hive.metastore.api.LockState.findByValue(iprot.readI32()); struct.setStateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = org.apache.hadoop.hive.metastore.api.LockType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // TXNID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.txnid = iprot.readI64(); struct.setTxnidIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // LASTHEARTBEAT if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.lastheartbeat = iprot.readI64(); struct.setLastheartbeatIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // ACQUIREDAT if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.acquiredat = iprot.readI64(); struct.setAcquiredatIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // USER if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.user = iprot.readString(); struct.setUserIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 11: // HOSTNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.hostname = iprot.readString(); struct.setHostnameIsSet(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(); }