http://git-wip-us.apache.org/repos/asf/hive/blob/20eb7b51/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatRequest.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatRequest.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatRequest.java new file mode 100644 index 0000000..71ea2c6 --- /dev/null +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatRequest.java @@ -0,0 +1,489 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.metastore.api; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class HeartbeatRequest implements org.apache.thrift.TBase<HeartbeatRequest, HeartbeatRequest._Fields>, java.io.Serializable, Cloneable, Comparable<HeartbeatRequest> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HeartbeatRequest"); + + private static final org.apache.thrift.protocol.TField LOCKID_FIELD_DESC = new org.apache.thrift.protocol.TField("lockid", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnid", org.apache.thrift.protocol.TType.I64, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new HeartbeatRequestStandardSchemeFactory()); + schemes.put(TupleScheme.class, new HeartbeatRequestTupleSchemeFactory()); + } + + private long lockid; // optional + private long txnid; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + LOCKID((short)1, "lockid"), + TXNID((short)2, "txnid"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // LOCKID + return LOCKID; + case 2: // TXNID + return TXNID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __LOCKID_ISSET_ID = 0; + private static final int __TXNID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.LOCKID,_Fields.TXNID}; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.LOCKID, new org.apache.thrift.meta_data.FieldMetaData("lockid", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.TXNID, new org.apache.thrift.meta_data.FieldMetaData("txnid", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HeartbeatRequest.class, metaDataMap); + } + + public HeartbeatRequest() { + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public HeartbeatRequest(HeartbeatRequest other) { + __isset_bitfield = other.__isset_bitfield; + this.lockid = other.lockid; + this.txnid = other.txnid; + } + + public HeartbeatRequest deepCopy() { + return new HeartbeatRequest(this); + } + + @Override + public void clear() { + setLockidIsSet(false); + this.lockid = 0; + setTxnidIsSet(false); + this.txnid = 0; + } + + public long getLockid() { + return this.lockid; + } + + public void setLockid(long lockid) { + this.lockid = lockid; + setLockidIsSet(true); + } + + public void unsetLockid() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LOCKID_ISSET_ID); + } + + /** Returns true if field lockid is set (has been assigned a value) and false otherwise */ + public boolean isSetLockid() { + return EncodingUtils.testBit(__isset_bitfield, __LOCKID_ISSET_ID); + } + + public void setLockidIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LOCKID_ISSET_ID, value); + } + + public long getTxnid() { + return this.txnid; + } + + public void setTxnid(long txnid) { + this.txnid = txnid; + setTxnidIsSet(true); + } + + public void unsetTxnid() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TXNID_ISSET_ID); + } + + /** Returns true if field txnid is set (has been assigned a value) and false otherwise */ + public boolean isSetTxnid() { + return EncodingUtils.testBit(__isset_bitfield, __TXNID_ISSET_ID); + } + + public void setTxnidIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TXNID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LOCKID: + if (value == null) { + unsetLockid(); + } else { + setLockid((Long)value); + } + break; + + case TXNID: + if (value == null) { + unsetTxnid(); + } else { + setTxnid((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LOCKID: + return getLockid(); + + case TXNID: + return getTxnid(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case LOCKID: + return isSetLockid(); + case TXNID: + return isSetTxnid(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof HeartbeatRequest) + return this.equals((HeartbeatRequest)that); + return false; + } + + public boolean equals(HeartbeatRequest that) { + if (that == null) + return false; + + boolean this_present_lockid = true && this.isSetLockid(); + boolean that_present_lockid = true && that.isSetLockid(); + if (this_present_lockid || that_present_lockid) { + if (!(this_present_lockid && that_present_lockid)) + return false; + if (this.lockid != that.lockid) + return false; + } + + boolean this_present_txnid = true && this.isSetTxnid(); + boolean that_present_txnid = true && that.isSetTxnid(); + if (this_present_txnid || that_present_txnid) { + if (!(this_present_txnid && that_present_txnid)) + return false; + if (this.txnid != that.txnid) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_lockid = true && (isSetLockid()); + list.add(present_lockid); + if (present_lockid) + list.add(lockid); + + boolean present_txnid = true && (isSetTxnid()); + list.add(present_txnid); + if (present_txnid) + list.add(txnid); + + return list.hashCode(); + } + + @Override + public int compareTo(HeartbeatRequest other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetLockid()).compareTo(other.isSetLockid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLockid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lockid, other.lockid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTxnid()).compareTo(other.isSetTxnid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTxnid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("HeartbeatRequest("); + boolean first = true; + + if (isSetLockid()) { + sb.append("lockid:"); + sb.append(this.lockid); + first = false; + } + if (isSetTxnid()) { + if (!first) sb.append(", "); + sb.append("txnid:"); + sb.append(this.txnid); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class HeartbeatRequestStandardSchemeFactory implements SchemeFactory { + public HeartbeatRequestStandardScheme getScheme() { + return new HeartbeatRequestStandardScheme(); + } + } + + private static class HeartbeatRequestStandardScheme extends StandardScheme<HeartbeatRequest> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, HeartbeatRequest 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: // 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; + 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, HeartbeatRequest struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetLockid()) { + oprot.writeFieldBegin(LOCKID_FIELD_DESC); + oprot.writeI64(struct.lockid); + oprot.writeFieldEnd(); + } + if (struct.isSetTxnid()) { + oprot.writeFieldBegin(TXNID_FIELD_DESC); + oprot.writeI64(struct.txnid); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class HeartbeatRequestTupleSchemeFactory implements SchemeFactory { + public HeartbeatRequestTupleScheme getScheme() { + return new HeartbeatRequestTupleScheme(); + } + } + + private static class HeartbeatRequestTupleScheme extends TupleScheme<HeartbeatRequest> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, HeartbeatRequest struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetLockid()) { + optionals.set(0); + } + if (struct.isSetTxnid()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetLockid()) { + oprot.writeI64(struct.lockid); + } + if (struct.isSetTxnid()) { + oprot.writeI64(struct.txnid); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, HeartbeatRequest struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.lockid = iprot.readI64(); + struct.setLockidIsSet(true); + } + if (incoming.get(1)) { + struct.txnid = iprot.readI64(); + struct.setTxnidIsSet(true); + } + } + } + +} +
http://git-wip-us.apache.org/repos/asf/hive/blob/20eb7b51/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatTxnRangeRequest.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatTxnRangeRequest.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatTxnRangeRequest.java new file mode 100644 index 0000000..586449c --- /dev/null +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatTxnRangeRequest.java @@ -0,0 +1,482 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.metastore.api; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class HeartbeatTxnRangeRequest implements org.apache.thrift.TBase<HeartbeatTxnRangeRequest, HeartbeatTxnRangeRequest._Fields>, java.io.Serializable, Cloneable, Comparable<HeartbeatTxnRangeRequest> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HeartbeatTxnRangeRequest"); + + private static final org.apache.thrift.protocol.TField MIN_FIELD_DESC = new org.apache.thrift.protocol.TField("min", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField MAX_FIELD_DESC = new org.apache.thrift.protocol.TField("max", org.apache.thrift.protocol.TType.I64, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new HeartbeatTxnRangeRequestStandardSchemeFactory()); + schemes.put(TupleScheme.class, new HeartbeatTxnRangeRequestTupleSchemeFactory()); + } + + private long min; // required + private long max; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + MIN((short)1, "min"), + MAX((short)2, "max"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // MIN + return MIN; + case 2: // MAX + return MAX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __MIN_ISSET_ID = 0; + private static final int __MAX_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.MIN, new org.apache.thrift.meta_data.FieldMetaData("min", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.MAX, new org.apache.thrift.meta_data.FieldMetaData("max", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HeartbeatTxnRangeRequest.class, metaDataMap); + } + + public HeartbeatTxnRangeRequest() { + } + + public HeartbeatTxnRangeRequest( + long min, + long max) + { + this(); + this.min = min; + setMinIsSet(true); + this.max = max; + setMaxIsSet(true); + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public HeartbeatTxnRangeRequest(HeartbeatTxnRangeRequest other) { + __isset_bitfield = other.__isset_bitfield; + this.min = other.min; + this.max = other.max; + } + + public HeartbeatTxnRangeRequest deepCopy() { + return new HeartbeatTxnRangeRequest(this); + } + + @Override + public void clear() { + setMinIsSet(false); + this.min = 0; + setMaxIsSet(false); + this.max = 0; + } + + public long getMin() { + return this.min; + } + + public void setMin(long min) { + this.min = min; + setMinIsSet(true); + } + + public void unsetMin() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MIN_ISSET_ID); + } + + /** Returns true if field min is set (has been assigned a value) and false otherwise */ + public boolean isSetMin() { + return EncodingUtils.testBit(__isset_bitfield, __MIN_ISSET_ID); + } + + public void setMinIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MIN_ISSET_ID, value); + } + + public long getMax() { + return this.max; + } + + public void setMax(long max) { + this.max = max; + setMaxIsSet(true); + } + + public void unsetMax() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAX_ISSET_ID); + } + + /** Returns true if field max is set (has been assigned a value) and false otherwise */ + public boolean isSetMax() { + return EncodingUtils.testBit(__isset_bitfield, __MAX_ISSET_ID); + } + + public void setMaxIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAX_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MIN: + if (value == null) { + unsetMin(); + } else { + setMin((Long)value); + } + break; + + case MAX: + if (value == null) { + unsetMax(); + } else { + setMax((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MIN: + return getMin(); + + case MAX: + return getMax(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case MIN: + return isSetMin(); + case MAX: + return isSetMax(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof HeartbeatTxnRangeRequest) + return this.equals((HeartbeatTxnRangeRequest)that); + return false; + } + + public boolean equals(HeartbeatTxnRangeRequest that) { + if (that == null) + return false; + + boolean this_present_min = true; + boolean that_present_min = true; + if (this_present_min || that_present_min) { + if (!(this_present_min && that_present_min)) + return false; + if (this.min != that.min) + return false; + } + + boolean this_present_max = true; + boolean that_present_max = true; + if (this_present_max || that_present_max) { + if (!(this_present_max && that_present_max)) + return false; + if (this.max != that.max) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_min = true; + list.add(present_min); + if (present_min) + list.add(min); + + boolean present_max = true; + list.add(present_max); + if (present_max) + list.add(max); + + return list.hashCode(); + } + + @Override + public int compareTo(HeartbeatTxnRangeRequest other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetMin()).compareTo(other.isSetMin()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMin()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.min, other.min); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMax()).compareTo(other.isSetMax()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMax()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max, other.max); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("HeartbeatTxnRangeRequest("); + boolean first = true; + + sb.append("min:"); + sb.append(this.min); + first = false; + if (!first) sb.append(", "); + sb.append("max:"); + sb.append(this.max); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetMin()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'min' is unset! Struct:" + toString()); + } + + if (!isSetMax()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'max' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class HeartbeatTxnRangeRequestStandardSchemeFactory implements SchemeFactory { + public HeartbeatTxnRangeRequestStandardScheme getScheme() { + return new HeartbeatTxnRangeRequestStandardScheme(); + } + } + + private static class HeartbeatTxnRangeRequestStandardScheme extends StandardScheme<HeartbeatTxnRangeRequest> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, HeartbeatTxnRangeRequest 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: // MIN + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.min = iprot.readI64(); + struct.setMinIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MAX + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.max = iprot.readI64(); + struct.setMaxIsSet(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, HeartbeatTxnRangeRequest struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(MIN_FIELD_DESC); + oprot.writeI64(struct.min); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(MAX_FIELD_DESC); + oprot.writeI64(struct.max); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class HeartbeatTxnRangeRequestTupleSchemeFactory implements SchemeFactory { + public HeartbeatTxnRangeRequestTupleScheme getScheme() { + return new HeartbeatTxnRangeRequestTupleScheme(); + } + } + + private static class HeartbeatTxnRangeRequestTupleScheme extends TupleScheme<HeartbeatTxnRangeRequest> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, HeartbeatTxnRangeRequest struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI64(struct.min); + oprot.writeI64(struct.max); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, HeartbeatTxnRangeRequest struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.min = iprot.readI64(); + struct.setMinIsSet(true); + struct.max = iprot.readI64(); + struct.setMaxIsSet(true); + } + } + +} + http://git-wip-us.apache.org/repos/asf/hive/blob/20eb7b51/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatTxnRangeResponse.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatTxnRangeResponse.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatTxnRangeResponse.java new file mode 100644 index 0000000..a3dceab --- /dev/null +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HeartbeatTxnRangeResponse.java @@ -0,0 +1,588 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.metastore.api; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class HeartbeatTxnRangeResponse implements org.apache.thrift.TBase<HeartbeatTxnRangeResponse, HeartbeatTxnRangeResponse._Fields>, java.io.Serializable, Cloneable, Comparable<HeartbeatTxnRangeResponse> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HeartbeatTxnRangeResponse"); + + private static final org.apache.thrift.protocol.TField ABORTED_FIELD_DESC = new org.apache.thrift.protocol.TField("aborted", org.apache.thrift.protocol.TType.SET, (short)1); + private static final org.apache.thrift.protocol.TField NOSUCH_FIELD_DESC = new org.apache.thrift.protocol.TField("nosuch", org.apache.thrift.protocol.TType.SET, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new HeartbeatTxnRangeResponseStandardSchemeFactory()); + schemes.put(TupleScheme.class, new HeartbeatTxnRangeResponseTupleSchemeFactory()); + } + + private Set<Long> aborted; // required + private Set<Long> nosuch; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ABORTED((short)1, "aborted"), + NOSUCH((short)2, "nosuch"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ABORTED + return ABORTED; + case 2: // NOSUCH + return NOSUCH; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ABORTED, new org.apache.thrift.meta_data.FieldMetaData("aborted", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); + tmpMap.put(_Fields.NOSUCH, new org.apache.thrift.meta_data.FieldMetaData("nosuch", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HeartbeatTxnRangeResponse.class, metaDataMap); + } + + public HeartbeatTxnRangeResponse() { + } + + public HeartbeatTxnRangeResponse( + Set<Long> aborted, + Set<Long> nosuch) + { + this(); + this.aborted = aborted; + this.nosuch = nosuch; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public HeartbeatTxnRangeResponse(HeartbeatTxnRangeResponse other) { + if (other.isSetAborted()) { + Set<Long> __this__aborted = new HashSet<Long>(other.aborted); + this.aborted = __this__aborted; + } + if (other.isSetNosuch()) { + Set<Long> __this__nosuch = new HashSet<Long>(other.nosuch); + this.nosuch = __this__nosuch; + } + } + + public HeartbeatTxnRangeResponse deepCopy() { + return new HeartbeatTxnRangeResponse(this); + } + + @Override + public void clear() { + this.aborted = null; + this.nosuch = null; + } + + public int getAbortedSize() { + return (this.aborted == null) ? 0 : this.aborted.size(); + } + + public java.util.Iterator<Long> getAbortedIterator() { + return (this.aborted == null) ? null : this.aborted.iterator(); + } + + public void addToAborted(long elem) { + if (this.aborted == null) { + this.aborted = new HashSet<Long>(); + } + this.aborted.add(elem); + } + + public Set<Long> getAborted() { + return this.aborted; + } + + public void setAborted(Set<Long> aborted) { + this.aborted = aborted; + } + + public void unsetAborted() { + this.aborted = null; + } + + /** Returns true if field aborted is set (has been assigned a value) and false otherwise */ + public boolean isSetAborted() { + return this.aborted != null; + } + + public void setAbortedIsSet(boolean value) { + if (!value) { + this.aborted = null; + } + } + + public int getNosuchSize() { + return (this.nosuch == null) ? 0 : this.nosuch.size(); + } + + public java.util.Iterator<Long> getNosuchIterator() { + return (this.nosuch == null) ? null : this.nosuch.iterator(); + } + + public void addToNosuch(long elem) { + if (this.nosuch == null) { + this.nosuch = new HashSet<Long>(); + } + this.nosuch.add(elem); + } + + public Set<Long> getNosuch() { + return this.nosuch; + } + + public void setNosuch(Set<Long> nosuch) { + this.nosuch = nosuch; + } + + public void unsetNosuch() { + this.nosuch = null; + } + + /** Returns true if field nosuch is set (has been assigned a value) and false otherwise */ + public boolean isSetNosuch() { + return this.nosuch != null; + } + + public void setNosuchIsSet(boolean value) { + if (!value) { + this.nosuch = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ABORTED: + if (value == null) { + unsetAborted(); + } else { + setAborted((Set<Long>)value); + } + break; + + case NOSUCH: + if (value == null) { + unsetNosuch(); + } else { + setNosuch((Set<Long>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ABORTED: + return getAborted(); + + case NOSUCH: + return getNosuch(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case ABORTED: + return isSetAborted(); + case NOSUCH: + return isSetNosuch(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof HeartbeatTxnRangeResponse) + return this.equals((HeartbeatTxnRangeResponse)that); + return false; + } + + public boolean equals(HeartbeatTxnRangeResponse that) { + if (that == null) + return false; + + boolean this_present_aborted = true && this.isSetAborted(); + boolean that_present_aborted = true && that.isSetAborted(); + if (this_present_aborted || that_present_aborted) { + if (!(this_present_aborted && that_present_aborted)) + return false; + if (!this.aborted.equals(that.aborted)) + return false; + } + + boolean this_present_nosuch = true && this.isSetNosuch(); + boolean that_present_nosuch = true && that.isSetNosuch(); + if (this_present_nosuch || that_present_nosuch) { + if (!(this_present_nosuch && that_present_nosuch)) + return false; + if (!this.nosuch.equals(that.nosuch)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_aborted = true && (isSetAborted()); + list.add(present_aborted); + if (present_aborted) + list.add(aborted); + + boolean present_nosuch = true && (isSetNosuch()); + list.add(present_nosuch); + if (present_nosuch) + list.add(nosuch); + + return list.hashCode(); + } + + @Override + public int compareTo(HeartbeatTxnRangeResponse other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetAborted()).compareTo(other.isSetAborted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAborted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aborted, other.aborted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNosuch()).compareTo(other.isSetNosuch()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNosuch()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nosuch, other.nosuch); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("HeartbeatTxnRangeResponse("); + boolean first = true; + + sb.append("aborted:"); + if (this.aborted == null) { + sb.append("null"); + } else { + sb.append(this.aborted); + } + first = false; + if (!first) sb.append(", "); + sb.append("nosuch:"); + if (this.nosuch == null) { + sb.append("null"); + } else { + sb.append(this.nosuch); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetAborted()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'aborted' is unset! Struct:" + toString()); + } + + if (!isSetNosuch()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nosuch' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class HeartbeatTxnRangeResponseStandardSchemeFactory implements SchemeFactory { + public HeartbeatTxnRangeResponseStandardScheme getScheme() { + return new HeartbeatTxnRangeResponseStandardScheme(); + } + } + + private static class HeartbeatTxnRangeResponseStandardScheme extends StandardScheme<HeartbeatTxnRangeResponse> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, HeartbeatTxnRangeResponse 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: // ABORTED + if (schemeField.type == org.apache.thrift.protocol.TType.SET) { + { + org.apache.thrift.protocol.TSet _set674 = iprot.readSetBegin(); + struct.aborted = new HashSet<Long>(2*_set674.size); + long _elem675; + for (int _i676 = 0; _i676 < _set674.size; ++_i676) + { + _elem675 = iprot.readI64(); + struct.aborted.add(_elem675); + } + iprot.readSetEnd(); + } + struct.setAbortedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NOSUCH + if (schemeField.type == org.apache.thrift.protocol.TType.SET) { + { + org.apache.thrift.protocol.TSet _set677 = iprot.readSetBegin(); + struct.nosuch = new HashSet<Long>(2*_set677.size); + long _elem678; + for (int _i679 = 0; _i679 < _set677.size; ++_i679) + { + _elem678 = iprot.readI64(); + struct.nosuch.add(_elem678); + } + iprot.readSetEnd(); + } + struct.setNosuchIsSet(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, HeartbeatTxnRangeResponse struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.aborted != null) { + oprot.writeFieldBegin(ABORTED_FIELD_DESC); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, struct.aborted.size())); + for (long _iter680 : struct.aborted) + { + oprot.writeI64(_iter680); + } + oprot.writeSetEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nosuch != null) { + oprot.writeFieldBegin(NOSUCH_FIELD_DESC); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, struct.nosuch.size())); + for (long _iter681 : struct.nosuch) + { + oprot.writeI64(_iter681); + } + oprot.writeSetEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class HeartbeatTxnRangeResponseTupleSchemeFactory implements SchemeFactory { + public HeartbeatTxnRangeResponseTupleScheme getScheme() { + return new HeartbeatTxnRangeResponseTupleScheme(); + } + } + + private static class HeartbeatTxnRangeResponseTupleScheme extends TupleScheme<HeartbeatTxnRangeResponse> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, HeartbeatTxnRangeResponse struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.aborted.size()); + for (long _iter682 : struct.aborted) + { + oprot.writeI64(_iter682); + } + } + { + oprot.writeI32(struct.nosuch.size()); + for (long _iter683 : struct.nosuch) + { + oprot.writeI64(_iter683); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, HeartbeatTxnRangeResponse struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TSet _set684 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.aborted = new HashSet<Long>(2*_set684.size); + long _elem685; + for (int _i686 = 0; _i686 < _set684.size; ++_i686) + { + _elem685 = iprot.readI64(); + struct.aborted.add(_elem685); + } + } + struct.setAbortedIsSet(true); + { + org.apache.thrift.protocol.TSet _set687 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.nosuch = new HashSet<Long>(2*_set687.size); + long _elem688; + for (int _i689 = 0; _i689 < _set687.size; ++_i689) + { + _elem688 = iprot.readI64(); + struct.nosuch.add(_elem688); + } + } + struct.setNosuchIsSet(true); + } + } + +} + http://git-wip-us.apache.org/repos/asf/hive/blob/20eb7b51/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HiveObjectPrivilege.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HiveObjectPrivilege.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HiveObjectPrivilege.java new file mode 100644 index 0000000..8b2817d --- /dev/null +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/HiveObjectPrivilege.java @@ -0,0 +1,833 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.metastore.api; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class HiveObjectPrivilege implements org.apache.thrift.TBase<HiveObjectPrivilege, HiveObjectPrivilege._Fields>, java.io.Serializable, Cloneable, Comparable<HiveObjectPrivilege> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HiveObjectPrivilege"); + + private static final org.apache.thrift.protocol.TField HIVE_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("hiveObject", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField PRINCIPAL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("principalName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField PRINCIPAL_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("principalType", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField GRANT_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("grantInfo", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField AUTHORIZER_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizer", org.apache.thrift.protocol.TType.STRING, (short)5); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new HiveObjectPrivilegeStandardSchemeFactory()); + schemes.put(TupleScheme.class, new HiveObjectPrivilegeTupleSchemeFactory()); + } + + private HiveObjectRef hiveObject; // required + private String principalName; // required + private PrincipalType principalType; // required + private PrivilegeGrantInfo grantInfo; // required + private String authorizer; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + HIVE_OBJECT((short)1, "hiveObject"), + PRINCIPAL_NAME((short)2, "principalName"), + /** + * + * @see PrincipalType + */ + PRINCIPAL_TYPE((short)3, "principalType"), + GRANT_INFO((short)4, "grantInfo"), + AUTHORIZER((short)5, "authorizer"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // HIVE_OBJECT + return HIVE_OBJECT; + case 2: // PRINCIPAL_NAME + return PRINCIPAL_NAME; + case 3: // PRINCIPAL_TYPE + return PRINCIPAL_TYPE; + case 4: // GRANT_INFO + return GRANT_INFO; + case 5: // AUTHORIZER + return AUTHORIZER; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.HIVE_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("hiveObject", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HiveObjectRef.class))); + tmpMap.put(_Fields.PRINCIPAL_NAME, new org.apache.thrift.meta_data.FieldMetaData("principalName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PRINCIPAL_TYPE, new org.apache.thrift.meta_data.FieldMetaData("principalType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PrincipalType.class))); + tmpMap.put(_Fields.GRANT_INFO, new org.apache.thrift.meta_data.FieldMetaData("grantInfo", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PrivilegeGrantInfo.class))); + tmpMap.put(_Fields.AUTHORIZER, new org.apache.thrift.meta_data.FieldMetaData("authorizer", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HiveObjectPrivilege.class, metaDataMap); + } + + public HiveObjectPrivilege() { + } + + public HiveObjectPrivilege( + HiveObjectRef hiveObject, + String principalName, + PrincipalType principalType, + PrivilegeGrantInfo grantInfo, + String authorizer) + { + this(); + this.hiveObject = hiveObject; + this.principalName = principalName; + this.principalType = principalType; + this.grantInfo = grantInfo; + this.authorizer = authorizer; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public HiveObjectPrivilege(HiveObjectPrivilege other) { + if (other.isSetHiveObject()) { + this.hiveObject = new HiveObjectRef(other.hiveObject); + } + if (other.isSetPrincipalName()) { + this.principalName = other.principalName; + } + if (other.isSetPrincipalType()) { + this.principalType = other.principalType; + } + if (other.isSetGrantInfo()) { + this.grantInfo = new PrivilegeGrantInfo(other.grantInfo); + } + if (other.isSetAuthorizer()) { + this.authorizer = other.authorizer; + } + } + + public HiveObjectPrivilege deepCopy() { + return new HiveObjectPrivilege(this); + } + + @Override + public void clear() { + this.hiveObject = null; + this.principalName = null; + this.principalType = null; + this.grantInfo = null; + this.authorizer = null; + } + + public HiveObjectRef getHiveObject() { + return this.hiveObject; + } + + public void setHiveObject(HiveObjectRef hiveObject) { + this.hiveObject = hiveObject; + } + + public void unsetHiveObject() { + this.hiveObject = null; + } + + /** Returns true if field hiveObject is set (has been assigned a value) and false otherwise */ + public boolean isSetHiveObject() { + return this.hiveObject != null; + } + + public void setHiveObjectIsSet(boolean value) { + if (!value) { + this.hiveObject = null; + } + } + + public String getPrincipalName() { + return this.principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + public void unsetPrincipalName() { + this.principalName = null; + } + + /** Returns true if field principalName is set (has been assigned a value) and false otherwise */ + public boolean isSetPrincipalName() { + return this.principalName != null; + } + + public void setPrincipalNameIsSet(boolean value) { + if (!value) { + this.principalName = null; + } + } + + /** + * + * @see PrincipalType + */ + public PrincipalType getPrincipalType() { + return this.principalType; + } + + /** + * + * @see PrincipalType + */ + public void setPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + } + + public void unsetPrincipalType() { + this.principalType = null; + } + + /** Returns true if field principalType is set (has been assigned a value) and false otherwise */ + public boolean isSetPrincipalType() { + return this.principalType != null; + } + + public void setPrincipalTypeIsSet(boolean value) { + if (!value) { + this.principalType = null; + } + } + + public PrivilegeGrantInfo getGrantInfo() { + return this.grantInfo; + } + + public void setGrantInfo(PrivilegeGrantInfo grantInfo) { + this.grantInfo = grantInfo; + } + + public void unsetGrantInfo() { + this.grantInfo = null; + } + + /** Returns true if field grantInfo is set (has been assigned a value) and false otherwise */ + public boolean isSetGrantInfo() { + return this.grantInfo != null; + } + + public void setGrantInfoIsSet(boolean value) { + if (!value) { + this.grantInfo = null; + } + } + + public String getAuthorizer() { + return this.authorizer; + } + + public void setAuthorizer(String authorizer) { + this.authorizer = authorizer; + } + + public void unsetAuthorizer() { + this.authorizer = null; + } + + /** Returns true if field authorizer is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthorizer() { + return this.authorizer != null; + } + + public void setAuthorizerIsSet(boolean value) { + if (!value) { + this.authorizer = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HIVE_OBJECT: + if (value == null) { + unsetHiveObject(); + } else { + setHiveObject((HiveObjectRef)value); + } + break; + + case PRINCIPAL_NAME: + if (value == null) { + unsetPrincipalName(); + } else { + setPrincipalName((String)value); + } + break; + + case PRINCIPAL_TYPE: + if (value == null) { + unsetPrincipalType(); + } else { + setPrincipalType((PrincipalType)value); + } + break; + + case GRANT_INFO: + if (value == null) { + unsetGrantInfo(); + } else { + setGrantInfo((PrivilegeGrantInfo)value); + } + break; + + case AUTHORIZER: + if (value == null) { + unsetAuthorizer(); + } else { + setAuthorizer((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HIVE_OBJECT: + return getHiveObject(); + + case PRINCIPAL_NAME: + return getPrincipalName(); + + case PRINCIPAL_TYPE: + return getPrincipalType(); + + case GRANT_INFO: + return getGrantInfo(); + + case AUTHORIZER: + return getAuthorizer(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case HIVE_OBJECT: + return isSetHiveObject(); + case PRINCIPAL_NAME: + return isSetPrincipalName(); + case PRINCIPAL_TYPE: + return isSetPrincipalType(); + case GRANT_INFO: + return isSetGrantInfo(); + case AUTHORIZER: + return isSetAuthorizer(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof HiveObjectPrivilege) + return this.equals((HiveObjectPrivilege)that); + return false; + } + + public boolean equals(HiveObjectPrivilege that) { + if (that == null) + return false; + + boolean this_present_hiveObject = true && this.isSetHiveObject(); + boolean that_present_hiveObject = true && that.isSetHiveObject(); + if (this_present_hiveObject || that_present_hiveObject) { + if (!(this_present_hiveObject && that_present_hiveObject)) + return false; + if (!this.hiveObject.equals(that.hiveObject)) + return false; + } + + boolean this_present_principalName = true && this.isSetPrincipalName(); + boolean that_present_principalName = true && that.isSetPrincipalName(); + if (this_present_principalName || that_present_principalName) { + if (!(this_present_principalName && that_present_principalName)) + return false; + if (!this.principalName.equals(that.principalName)) + return false; + } + + boolean this_present_principalType = true && this.isSetPrincipalType(); + boolean that_present_principalType = true && that.isSetPrincipalType(); + if (this_present_principalType || that_present_principalType) { + if (!(this_present_principalType && that_present_principalType)) + return false; + if (!this.principalType.equals(that.principalType)) + return false; + } + + boolean this_present_grantInfo = true && this.isSetGrantInfo(); + boolean that_present_grantInfo = true && that.isSetGrantInfo(); + if (this_present_grantInfo || that_present_grantInfo) { + if (!(this_present_grantInfo && that_present_grantInfo)) + return false; + if (!this.grantInfo.equals(that.grantInfo)) + return false; + } + + boolean this_present_authorizer = true && this.isSetAuthorizer(); + boolean that_present_authorizer = true && that.isSetAuthorizer(); + if (this_present_authorizer || that_present_authorizer) { + if (!(this_present_authorizer && that_present_authorizer)) + return false; + if (!this.authorizer.equals(that.authorizer)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_hiveObject = true && (isSetHiveObject()); + list.add(present_hiveObject); + if (present_hiveObject) + list.add(hiveObject); + + boolean present_principalName = true && (isSetPrincipalName()); + list.add(present_principalName); + if (present_principalName) + list.add(principalName); + + boolean present_principalType = true && (isSetPrincipalType()); + list.add(present_principalType); + if (present_principalType) + list.add(principalType.getValue()); + + boolean present_grantInfo = true && (isSetGrantInfo()); + list.add(present_grantInfo); + if (present_grantInfo) + list.add(grantInfo); + + boolean present_authorizer = true && (isSetAuthorizer()); + list.add(present_authorizer); + if (present_authorizer) + list.add(authorizer); + + return list.hashCode(); + } + + @Override + public int compareTo(HiveObjectPrivilege other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetHiveObject()).compareTo(other.isSetHiveObject()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHiveObject()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hiveObject, other.hiveObject); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPrincipalName()).compareTo(other.isSetPrincipalName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrincipalName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.principalName, other.principalName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPrincipalType()).compareTo(other.isSetPrincipalType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrincipalType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.principalType, other.principalType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGrantInfo()).compareTo(other.isSetGrantInfo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGrantInfo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.grantInfo, other.grantInfo); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAuthorizer()).compareTo(other.isSetAuthorizer()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthorizer()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizer, other.authorizer); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("HiveObjectPrivilege("); + boolean first = true; + + sb.append("hiveObject:"); + if (this.hiveObject == null) { + sb.append("null"); + } else { + sb.append(this.hiveObject); + } + first = false; + if (!first) sb.append(", "); + sb.append("principalName:"); + if (this.principalName == null) { + sb.append("null"); + } else { + sb.append(this.principalName); + } + first = false; + if (!first) sb.append(", "); + sb.append("principalType:"); + if (this.principalType == null) { + sb.append("null"); + } else { + sb.append(this.principalType); + } + first = false; + if (!first) sb.append(", "); + sb.append("grantInfo:"); + if (this.grantInfo == null) { + sb.append("null"); + } else { + sb.append(this.grantInfo); + } + first = false; + if (!first) sb.append(", "); + sb.append("authorizer:"); + if (this.authorizer == null) { + sb.append("null"); + } else { + sb.append(this.authorizer); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (hiveObject != null) { + hiveObject.validate(); + } + if (grantInfo != null) { + grantInfo.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class HiveObjectPrivilegeStandardSchemeFactory implements SchemeFactory { + public HiveObjectPrivilegeStandardScheme getScheme() { + return new HiveObjectPrivilegeStandardScheme(); + } + } + + private static class HiveObjectPrivilegeStandardScheme extends StandardScheme<HiveObjectPrivilege> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, HiveObjectPrivilege 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: // HIVE_OBJECT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.hiveObject = new HiveObjectRef(); + struct.hiveObject.read(iprot); + struct.setHiveObjectIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PRINCIPAL_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.principalName = iprot.readString(); + struct.setPrincipalNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PRINCIPAL_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.principalType = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32()); + struct.setPrincipalTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // GRANT_INFO + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.grantInfo = new PrivilegeGrantInfo(); + struct.grantInfo.read(iprot); + struct.setGrantInfoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // AUTHORIZER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.authorizer = iprot.readString(); + struct.setAuthorizerIsSet(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, HiveObjectPrivilege struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.hiveObject != null) { + oprot.writeFieldBegin(HIVE_OBJECT_FIELD_DESC); + struct.hiveObject.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.principalName != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(struct.principalName); + oprot.writeFieldEnd(); + } + if (struct.principalType != null) { + oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC); + oprot.writeI32(struct.principalType.getValue()); + oprot.writeFieldEnd(); + } + if (struct.grantInfo != null) { + oprot.writeFieldBegin(GRANT_INFO_FIELD_DESC); + struct.grantInfo.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.authorizer != null) { + oprot.writeFieldBegin(AUTHORIZER_FIELD_DESC); + oprot.writeString(struct.authorizer); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class HiveObjectPrivilegeTupleSchemeFactory implements SchemeFactory { + public HiveObjectPrivilegeTupleScheme getScheme() { + return new HiveObjectPrivilegeTupleScheme(); + } + } + + private static class HiveObjectPrivilegeTupleScheme extends TupleScheme<HiveObjectPrivilege> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, HiveObjectPrivilege struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetHiveObject()) { + optionals.set(0); + } + if (struct.isSetPrincipalName()) { + optionals.set(1); + } + if (struct.isSetPrincipalType()) { + optionals.set(2); + } + if (struct.isSetGrantInfo()) { + optionals.set(3); + } + if (struct.isSetAuthorizer()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetHiveObject()) { + struct.hiveObject.write(oprot); + } + if (struct.isSetPrincipalName()) { + oprot.writeString(struct.principalName); + } + if (struct.isSetPrincipalType()) { + oprot.writeI32(struct.principalType.getValue()); + } + if (struct.isSetGrantInfo()) { + struct.grantInfo.write(oprot); + } + if (struct.isSetAuthorizer()) { + oprot.writeString(struct.authorizer); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, HiveObjectPrivilege struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.hiveObject = new HiveObjectRef(); + struct.hiveObject.read(iprot); + struct.setHiveObjectIsSet(true); + } + if (incoming.get(1)) { + struct.principalName = iprot.readString(); + struct.setPrincipalNameIsSet(true); + } + if (incoming.get(2)) { + struct.principalType = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32()); + struct.setPrincipalTypeIsSet(true); + } + if (incoming.get(3)) { + struct.grantInfo = new PrivilegeGrantInfo(); + struct.grantInfo.read(iprot); + struct.setGrantInfoIsSet(true); + } + if (incoming.get(4)) { + struct.authorizer = iprot.readString(); + struct.setAuthorizerIsSet(true); + } + } + } + +} +