/** Performs a deep copy on <i>other</i>. */ public CompactionRequest(CompactionRequest other) { if (other.isSetDbname()) { this.dbname = other.dbname; } if (other.isSetTablename()) { this.tablename = other.tablename; } if (other.isSetPartitionname()) { this.partitionname = other.partitionname; } if (other.isSetType()) { this.type = other.type; } if (other.isSetRunas()) { this.runas = other.runas; } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, CompactionRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.dbname = iprot.readString(); struct.setDbnameIsSet(true); struct.tablename = iprot.readString(); struct.setTablenameIsSet(true); struct.type = org.apache.hadoop.hive.metastore.api.CompactionType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.partitionname = iprot.readString(); struct.setPartitionnameIsSet(true); } if (incoming.get(1)) { struct.runas = iprot.readString(); struct.setRunasIsSet(true); } }
public boolean equals(CompactionRequest that) { if (that == null) return false; boolean this_present_dbname = true && this.isSetDbname(); boolean that_present_dbname = true && that.isSetDbname(); if (this_present_dbname || that_present_dbname) { if (!(this_present_dbname && that_present_dbname)) return false; if (!this.dbname.equals(that.dbname)) return false; } boolean this_present_tablename = true && this.isSetTablename(); boolean that_present_tablename = true && that.isSetTablename(); if (this_present_tablename || that_present_tablename) { if (!(this_present_tablename && that_present_tablename)) return false; if (!this.tablename.equals(that.tablename)) return false; } boolean this_present_partitionname = true && this.isSetPartitionname(); boolean that_present_partitionname = true && that.isSetPartitionname(); if (this_present_partitionname || that_present_partitionname) { if (!(this_present_partitionname && that_present_partitionname)) return false; if (!this.partitionname.equals(that.partitionname)) return false; } boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (!this.type.equals(that.type)) return false; } boolean this_present_runas = true && this.isSetRunas(); boolean that_present_runas = true && that.isSetRunas(); if (this_present_runas || that_present_runas) { if (!(this_present_runas && that_present_runas)) return false; if (!this.runas.equals(that.runas)) return false; } return true; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, CompactionRequest struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeString(struct.dbname); oprot.writeString(struct.tablename); oprot.writeI32(struct.type.getValue()); BitSet optionals = new BitSet(); if (struct.isSetPartitionname()) { optionals.set(0); } if (struct.isSetRunas()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPartitionname()) { oprot.writeString(struct.partitionname); } if (struct.isSetRunas()) { oprot.writeString(struct.runas); } }
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(); }
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(); }
@Override public int compareTo(CompactionRequest other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetDbname()).compareTo(other.isSetDbname()); if (lastComparison != 0) { return lastComparison; } if (isSetDbname()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dbname, other.dbname); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTablename()).compareTo(other.isSetTablename()); if (lastComparison != 0) { return lastComparison; } if (isSetTablename()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tablename, other.tablename); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPartitionname()).compareTo(other.isSetPartitionname()); if (lastComparison != 0) { return lastComparison; } if (isSetPartitionname()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitionname, other.partitionname); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); if (lastComparison != 0) { return lastComparison; } if (isSetType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRunas()).compareTo(other.isSetRunas()); if (lastComparison != 0) { return lastComparison; } if (isSetRunas()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runas, other.runas); if (lastComparison != 0) { return lastComparison; } } return 0; }