http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/0eb6645e/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathsUpdate.java ---------------------------------------------------------------------- diff --git a/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathsUpdate.java b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathsUpdate.java new file mode 100644 index 0000000..f0bdbc9 --- /dev/null +++ b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathsUpdate.java @@ -0,0 +1,748 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.sentry.provider.db.service.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPathsUpdate._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPathsUpdate"); + + private static final org.apache.thrift.protocol.TField HAS_FULL_IMAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("hasFullImage", org.apache.thrift.protocol.TType.BOOL, (short)1); + private static final org.apache.thrift.protocol.TField PATHS_DUMP_FIELD_DESC = new org.apache.thrift.protocol.TField("pathsDump", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField SEQ_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("seqNum", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField PATH_CHANGES_FIELD_DESC = new org.apache.thrift.protocol.TField("pathChanges", org.apache.thrift.protocol.TType.LIST, (short)4); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPathsUpdateStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPathsUpdateTupleSchemeFactory()); + } + + private boolean hasFullImage; // required + private TPathsDump pathsDump; // optional + private long seqNum; // required + private List<TPathChanges> pathChanges; // 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 { + HAS_FULL_IMAGE((short)1, "hasFullImage"), + PATHS_DUMP((short)2, "pathsDump"), + SEQ_NUM((short)3, "seqNum"), + PATH_CHANGES((short)4, "pathChanges"); + + 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: // HAS_FULL_IMAGE + return HAS_FULL_IMAGE; + case 2: // PATHS_DUMP + return PATHS_DUMP; + case 3: // SEQ_NUM + return SEQ_NUM; + case 4: // PATH_CHANGES + return PATH_CHANGES; + 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 __HASFULLIMAGE_ISSET_ID = 0; + private static final int __SEQNUM_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.PATHS_DUMP}; + 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.HAS_FULL_IMAGE, new org.apache.thrift.meta_data.FieldMetaData("hasFullImage", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.PATHS_DUMP, new org.apache.thrift.meta_data.FieldMetaData("pathsDump", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPathsDump.class))); + tmpMap.put(_Fields.SEQ_NUM, new org.apache.thrift.meta_data.FieldMetaData("seqNum", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.PATH_CHANGES, new org.apache.thrift.meta_data.FieldMetaData("pathChanges", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPathChanges.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPathsUpdate.class, metaDataMap); + } + + public TPathsUpdate() { + } + + public TPathsUpdate( + boolean hasFullImage, + long seqNum, + List<TPathChanges> pathChanges) + { + this(); + this.hasFullImage = hasFullImage; + setHasFullImageIsSet(true); + this.seqNum = seqNum; + setSeqNumIsSet(true); + this.pathChanges = pathChanges; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public TPathsUpdate(TPathsUpdate other) { + __isset_bitfield = other.__isset_bitfield; + this.hasFullImage = other.hasFullImage; + if (other.isSetPathsDump()) { + this.pathsDump = new TPathsDump(other.pathsDump); + } + this.seqNum = other.seqNum; + if (other.isSetPathChanges()) { + List<TPathChanges> __this__pathChanges = new ArrayList<TPathChanges>(); + for (TPathChanges other_element : other.pathChanges) { + __this__pathChanges.add(new TPathChanges(other_element)); + } + this.pathChanges = __this__pathChanges; + } + } + + public TPathsUpdate deepCopy() { + return new TPathsUpdate(this); + } + + @Override + public void clear() { + setHasFullImageIsSet(false); + this.hasFullImage = false; + this.pathsDump = null; + setSeqNumIsSet(false); + this.seqNum = 0; + this.pathChanges = null; + } + + public boolean isHasFullImage() { + return this.hasFullImage; + } + + public void setHasFullImage(boolean hasFullImage) { + this.hasFullImage = hasFullImage; + setHasFullImageIsSet(true); + } + + public void unsetHasFullImage() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASFULLIMAGE_ISSET_ID); + } + + /** Returns true if field hasFullImage is set (has been assigned a value) and false otherwise */ + public boolean isSetHasFullImage() { + return EncodingUtils.testBit(__isset_bitfield, __HASFULLIMAGE_ISSET_ID); + } + + public void setHasFullImageIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASFULLIMAGE_ISSET_ID, value); + } + + public TPathsDump getPathsDump() { + return this.pathsDump; + } + + public void setPathsDump(TPathsDump pathsDump) { + this.pathsDump = pathsDump; + } + + public void unsetPathsDump() { + this.pathsDump = null; + } + + /** Returns true if field pathsDump is set (has been assigned a value) and false otherwise */ + public boolean isSetPathsDump() { + return this.pathsDump != null; + } + + public void setPathsDumpIsSet(boolean value) { + if (!value) { + this.pathsDump = null; + } + } + + public long getSeqNum() { + return this.seqNum; + } + + public void setSeqNum(long seqNum) { + this.seqNum = seqNum; + setSeqNumIsSet(true); + } + + public void unsetSeqNum() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SEQNUM_ISSET_ID); + } + + /** Returns true if field seqNum is set (has been assigned a value) and false otherwise */ + public boolean isSetSeqNum() { + return EncodingUtils.testBit(__isset_bitfield, __SEQNUM_ISSET_ID); + } + + public void setSeqNumIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SEQNUM_ISSET_ID, value); + } + + public int getPathChangesSize() { + return (this.pathChanges == null) ? 0 : this.pathChanges.size(); + } + + public java.util.Iterator<TPathChanges> getPathChangesIterator() { + return (this.pathChanges == null) ? null : this.pathChanges.iterator(); + } + + public void addToPathChanges(TPathChanges elem) { + if (this.pathChanges == null) { + this.pathChanges = new ArrayList<TPathChanges>(); + } + this.pathChanges.add(elem); + } + + public List<TPathChanges> getPathChanges() { + return this.pathChanges; + } + + public void setPathChanges(List<TPathChanges> pathChanges) { + this.pathChanges = pathChanges; + } + + public void unsetPathChanges() { + this.pathChanges = null; + } + + /** Returns true if field pathChanges is set (has been assigned a value) and false otherwise */ + public boolean isSetPathChanges() { + return this.pathChanges != null; + } + + public void setPathChangesIsSet(boolean value) { + if (!value) { + this.pathChanges = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HAS_FULL_IMAGE: + if (value == null) { + unsetHasFullImage(); + } else { + setHasFullImage((Boolean)value); + } + break; + + case PATHS_DUMP: + if (value == null) { + unsetPathsDump(); + } else { + setPathsDump((TPathsDump)value); + } + break; + + case SEQ_NUM: + if (value == null) { + unsetSeqNum(); + } else { + setSeqNum((Long)value); + } + break; + + case PATH_CHANGES: + if (value == null) { + unsetPathChanges(); + } else { + setPathChanges((List<TPathChanges>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HAS_FULL_IMAGE: + return Boolean.valueOf(isHasFullImage()); + + case PATHS_DUMP: + return getPathsDump(); + + case SEQ_NUM: + return Long.valueOf(getSeqNum()); + + case PATH_CHANGES: + return getPathChanges(); + + } + 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 HAS_FULL_IMAGE: + return isSetHasFullImage(); + case PATHS_DUMP: + return isSetPathsDump(); + case SEQ_NUM: + return isSetSeqNum(); + case PATH_CHANGES: + return isSetPathChanges(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPathsUpdate) + return this.equals((TPathsUpdate)that); + return false; + } + + public boolean equals(TPathsUpdate that) { + if (that == null) + return false; + + boolean this_present_hasFullImage = true; + boolean that_present_hasFullImage = true; + if (this_present_hasFullImage || that_present_hasFullImage) { + if (!(this_present_hasFullImage && that_present_hasFullImage)) + return false; + if (this.hasFullImage != that.hasFullImage) + return false; + } + + boolean this_present_pathsDump = true && this.isSetPathsDump(); + boolean that_present_pathsDump = true && that.isSetPathsDump(); + if (this_present_pathsDump || that_present_pathsDump) { + if (!(this_present_pathsDump && that_present_pathsDump)) + return false; + if (!this.pathsDump.equals(that.pathsDump)) + return false; + } + + boolean this_present_seqNum = true; + boolean that_present_seqNum = true; + if (this_present_seqNum || that_present_seqNum) { + if (!(this_present_seqNum && that_present_seqNum)) + return false; + if (this.seqNum != that.seqNum) + return false; + } + + boolean this_present_pathChanges = true && this.isSetPathChanges(); + boolean that_present_pathChanges = true && that.isSetPathChanges(); + if (this_present_pathChanges || that_present_pathChanges) { + if (!(this_present_pathChanges && that_present_pathChanges)) + return false; + if (!this.pathChanges.equals(that.pathChanges)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_hasFullImage = true; + builder.append(present_hasFullImage); + if (present_hasFullImage) + builder.append(hasFullImage); + + boolean present_pathsDump = true && (isSetPathsDump()); + builder.append(present_pathsDump); + if (present_pathsDump) + builder.append(pathsDump); + + boolean present_seqNum = true; + builder.append(present_seqNum); + if (present_seqNum) + builder.append(seqNum); + + boolean present_pathChanges = true && (isSetPathChanges()); + builder.append(present_pathChanges); + if (present_pathChanges) + builder.append(pathChanges); + + return builder.toHashCode(); + } + + public int compareTo(TPathsUpdate other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TPathsUpdate typedOther = (TPathsUpdate)other; + + lastComparison = Boolean.valueOf(isSetHasFullImage()).compareTo(typedOther.isSetHasFullImage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasFullImage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasFullImage, typedOther.hasFullImage); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPathsDump()).compareTo(typedOther.isSetPathsDump()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPathsDump()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pathsDump, typedOther.pathsDump); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSeqNum()).compareTo(typedOther.isSetSeqNum()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSeqNum()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.seqNum, typedOther.seqNum); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPathChanges()).compareTo(typedOther.isSetPathChanges()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPathChanges()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pathChanges, typedOther.pathChanges); + 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("TPathsUpdate("); + boolean first = true; + + sb.append("hasFullImage:"); + sb.append(this.hasFullImage); + first = false; + if (isSetPathsDump()) { + if (!first) sb.append(", "); + sb.append("pathsDump:"); + if (this.pathsDump == null) { + sb.append("null"); + } else { + sb.append(this.pathsDump); + } + first = false; + } + if (!first) sb.append(", "); + sb.append("seqNum:"); + sb.append(this.seqNum); + first = false; + if (!first) sb.append(", "); + sb.append("pathChanges:"); + if (this.pathChanges == null) { + sb.append("null"); + } else { + sb.append(this.pathChanges); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetHasFullImage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasFullImage' is unset! Struct:" + toString()); + } + + if (!isSetSeqNum()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'seqNum' is unset! Struct:" + toString()); + } + + if (!isSetPathChanges()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'pathChanges' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (pathsDump != null) { + pathsDump.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 { + // 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 TPathsUpdateStandardSchemeFactory implements SchemeFactory { + public TPathsUpdateStandardScheme getScheme() { + return new TPathsUpdateStandardScheme(); + } + } + + private static class TPathsUpdateStandardScheme extends StandardScheme<TPathsUpdate> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPathsUpdate 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: // HAS_FULL_IMAGE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasFullImage = iprot.readBool(); + struct.setHasFullImageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PATHS_DUMP + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.pathsDump = new TPathsDump(); + struct.pathsDump.read(iprot); + struct.setPathsDumpIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SEQ_NUM + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.seqNum = iprot.readI64(); + struct.setSeqNumIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // PATH_CHANGES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list114 = iprot.readListBegin(); + struct.pathChanges = new ArrayList<TPathChanges>(_list114.size); + for (int _i115 = 0; _i115 < _list114.size; ++_i115) + { + TPathChanges _elem116; // required + _elem116 = new TPathChanges(); + _elem116.read(iprot); + struct.pathChanges.add(_elem116); + } + iprot.readListEnd(); + } + struct.setPathChangesIsSet(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, TPathsUpdate struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(HAS_FULL_IMAGE_FIELD_DESC); + oprot.writeBool(struct.hasFullImage); + oprot.writeFieldEnd(); + if (struct.pathsDump != null) { + if (struct.isSetPathsDump()) { + oprot.writeFieldBegin(PATHS_DUMP_FIELD_DESC); + struct.pathsDump.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldBegin(SEQ_NUM_FIELD_DESC); + oprot.writeI64(struct.seqNum); + oprot.writeFieldEnd(); + if (struct.pathChanges != null) { + oprot.writeFieldBegin(PATH_CHANGES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.pathChanges.size())); + for (TPathChanges _iter117 : struct.pathChanges) + { + _iter117.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPathsUpdateTupleSchemeFactory implements SchemeFactory { + public TPathsUpdateTupleScheme getScheme() { + return new TPathsUpdateTupleScheme(); + } + } + + private static class TPathsUpdateTupleScheme extends TupleScheme<TPathsUpdate> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPathsUpdate struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBool(struct.hasFullImage); + oprot.writeI64(struct.seqNum); + { + oprot.writeI32(struct.pathChanges.size()); + for (TPathChanges _iter118 : struct.pathChanges) + { + _iter118.write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetPathsDump()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetPathsDump()) { + struct.pathsDump.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPathsUpdate struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.hasFullImage = iprot.readBool(); + struct.setHasFullImageIsSet(true); + struct.seqNum = iprot.readI64(); + struct.setSeqNumIsSet(true); + { + org.apache.thrift.protocol.TList _list119 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.pathChanges = new ArrayList<TPathChanges>(_list119.size); + for (int _i120 = 0; _i120 < _list119.size; ++_i120) + { + TPathChanges _elem121; // required + _elem121 = new TPathChanges(); + _elem121.read(iprot); + struct.pathChanges.add(_elem121); + } + } + struct.setPathChangesIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.pathsDump = new TPathsDump(); + struct.pathsDump.read(iprot); + struct.setPathsDumpIsSet(true); + } + } + } + +} +
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/0eb6645e/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPermissionsUpdate.java ---------------------------------------------------------------------- diff --git a/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPermissionsUpdate.java b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPermissionsUpdate.java new file mode 100644 index 0000000..968f2b1 --- /dev/null +++ b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPermissionsUpdate.java @@ -0,0 +1,810 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.sentry.provider.db.service.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsUpdate, TPermissionsUpdate._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPermissionsUpdate"); + + private static final org.apache.thrift.protocol.TField HASFULL_IMAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("hasfullImage", org.apache.thrift.protocol.TType.BOOL, (short)1); + private static final org.apache.thrift.protocol.TField SEQ_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("seqNum", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField PRIVILEGE_CHANGES_FIELD_DESC = new org.apache.thrift.protocol.TField("privilegeChanges", org.apache.thrift.protocol.TType.MAP, (short)3); + private static final org.apache.thrift.protocol.TField ROLE_CHANGES_FIELD_DESC = new org.apache.thrift.protocol.TField("roleChanges", org.apache.thrift.protocol.TType.MAP, (short)4); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPermissionsUpdateStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPermissionsUpdateTupleSchemeFactory()); + } + + private boolean hasfullImage; // required + private long seqNum; // required + private Map<String,TPrivilegeChanges> privilegeChanges; // required + private Map<String,TRoleChanges> roleChanges; // 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 { + HASFULL_IMAGE((short)1, "hasfullImage"), + SEQ_NUM((short)2, "seqNum"), + PRIVILEGE_CHANGES((short)3, "privilegeChanges"), + ROLE_CHANGES((short)4, "roleChanges"); + + 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: // HASFULL_IMAGE + return HASFULL_IMAGE; + case 2: // SEQ_NUM + return SEQ_NUM; + case 3: // PRIVILEGE_CHANGES + return PRIVILEGE_CHANGES; + case 4: // ROLE_CHANGES + return ROLE_CHANGES; + 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 __HASFULLIMAGE_ISSET_ID = 0; + private static final int __SEQNUM_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.HASFULL_IMAGE, new org.apache.thrift.meta_data.FieldMetaData("hasfullImage", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.SEQ_NUM, new org.apache.thrift.meta_data.FieldMetaData("seqNum", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.PRIVILEGE_CHANGES, new org.apache.thrift.meta_data.FieldMetaData("privilegeChanges", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrivilegeChanges.class)))); + tmpMap.put(_Fields.ROLE_CHANGES, new org.apache.thrift.meta_data.FieldMetaData("roleChanges", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRoleChanges.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPermissionsUpdate.class, metaDataMap); + } + + public TPermissionsUpdate() { + } + + public TPermissionsUpdate( + boolean hasfullImage, + long seqNum, + Map<String,TPrivilegeChanges> privilegeChanges, + Map<String,TRoleChanges> roleChanges) + { + this(); + this.hasfullImage = hasfullImage; + setHasfullImageIsSet(true); + this.seqNum = seqNum; + setSeqNumIsSet(true); + this.privilegeChanges = privilegeChanges; + this.roleChanges = roleChanges; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public TPermissionsUpdate(TPermissionsUpdate other) { + __isset_bitfield = other.__isset_bitfield; + this.hasfullImage = other.hasfullImage; + this.seqNum = other.seqNum; + if (other.isSetPrivilegeChanges()) { + Map<String,TPrivilegeChanges> __this__privilegeChanges = new HashMap<String,TPrivilegeChanges>(); + for (Map.Entry<String, TPrivilegeChanges> other_element : other.privilegeChanges.entrySet()) { + + String other_element_key = other_element.getKey(); + TPrivilegeChanges other_element_value = other_element.getValue(); + + String __this__privilegeChanges_copy_key = other_element_key; + + TPrivilegeChanges __this__privilegeChanges_copy_value = new TPrivilegeChanges(other_element_value); + + __this__privilegeChanges.put(__this__privilegeChanges_copy_key, __this__privilegeChanges_copy_value); + } + this.privilegeChanges = __this__privilegeChanges; + } + if (other.isSetRoleChanges()) { + Map<String,TRoleChanges> __this__roleChanges = new HashMap<String,TRoleChanges>(); + for (Map.Entry<String, TRoleChanges> other_element : other.roleChanges.entrySet()) { + + String other_element_key = other_element.getKey(); + TRoleChanges other_element_value = other_element.getValue(); + + String __this__roleChanges_copy_key = other_element_key; + + TRoleChanges __this__roleChanges_copy_value = new TRoleChanges(other_element_value); + + __this__roleChanges.put(__this__roleChanges_copy_key, __this__roleChanges_copy_value); + } + this.roleChanges = __this__roleChanges; + } + } + + public TPermissionsUpdate deepCopy() { + return new TPermissionsUpdate(this); + } + + @Override + public void clear() { + setHasfullImageIsSet(false); + this.hasfullImage = false; + setSeqNumIsSet(false); + this.seqNum = 0; + this.privilegeChanges = null; + this.roleChanges = null; + } + + public boolean isHasfullImage() { + return this.hasfullImage; + } + + public void setHasfullImage(boolean hasfullImage) { + this.hasfullImage = hasfullImage; + setHasfullImageIsSet(true); + } + + public void unsetHasfullImage() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASFULLIMAGE_ISSET_ID); + } + + /** Returns true if field hasfullImage is set (has been assigned a value) and false otherwise */ + public boolean isSetHasfullImage() { + return EncodingUtils.testBit(__isset_bitfield, __HASFULLIMAGE_ISSET_ID); + } + + public void setHasfullImageIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASFULLIMAGE_ISSET_ID, value); + } + + public long getSeqNum() { + return this.seqNum; + } + + public void setSeqNum(long seqNum) { + this.seqNum = seqNum; + setSeqNumIsSet(true); + } + + public void unsetSeqNum() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SEQNUM_ISSET_ID); + } + + /** Returns true if field seqNum is set (has been assigned a value) and false otherwise */ + public boolean isSetSeqNum() { + return EncodingUtils.testBit(__isset_bitfield, __SEQNUM_ISSET_ID); + } + + public void setSeqNumIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SEQNUM_ISSET_ID, value); + } + + public int getPrivilegeChangesSize() { + return (this.privilegeChanges == null) ? 0 : this.privilegeChanges.size(); + } + + public void putToPrivilegeChanges(String key, TPrivilegeChanges val) { + if (this.privilegeChanges == null) { + this.privilegeChanges = new HashMap<String,TPrivilegeChanges>(); + } + this.privilegeChanges.put(key, val); + } + + public Map<String,TPrivilegeChanges> getPrivilegeChanges() { + return this.privilegeChanges; + } + + public void setPrivilegeChanges(Map<String,TPrivilegeChanges> privilegeChanges) { + this.privilegeChanges = privilegeChanges; + } + + public void unsetPrivilegeChanges() { + this.privilegeChanges = null; + } + + /** Returns true if field privilegeChanges is set (has been assigned a value) and false otherwise */ + public boolean isSetPrivilegeChanges() { + return this.privilegeChanges != null; + } + + public void setPrivilegeChangesIsSet(boolean value) { + if (!value) { + this.privilegeChanges = null; + } + } + + public int getRoleChangesSize() { + return (this.roleChanges == null) ? 0 : this.roleChanges.size(); + } + + public void putToRoleChanges(String key, TRoleChanges val) { + if (this.roleChanges == null) { + this.roleChanges = new HashMap<String,TRoleChanges>(); + } + this.roleChanges.put(key, val); + } + + public Map<String,TRoleChanges> getRoleChanges() { + return this.roleChanges; + } + + public void setRoleChanges(Map<String,TRoleChanges> roleChanges) { + this.roleChanges = roleChanges; + } + + public void unsetRoleChanges() { + this.roleChanges = null; + } + + /** Returns true if field roleChanges is set (has been assigned a value) and false otherwise */ + public boolean isSetRoleChanges() { + return this.roleChanges != null; + } + + public void setRoleChangesIsSet(boolean value) { + if (!value) { + this.roleChanges = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HASFULL_IMAGE: + if (value == null) { + unsetHasfullImage(); + } else { + setHasfullImage((Boolean)value); + } + break; + + case SEQ_NUM: + if (value == null) { + unsetSeqNum(); + } else { + setSeqNum((Long)value); + } + break; + + case PRIVILEGE_CHANGES: + if (value == null) { + unsetPrivilegeChanges(); + } else { + setPrivilegeChanges((Map<String,TPrivilegeChanges>)value); + } + break; + + case ROLE_CHANGES: + if (value == null) { + unsetRoleChanges(); + } else { + setRoleChanges((Map<String,TRoleChanges>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HASFULL_IMAGE: + return Boolean.valueOf(isHasfullImage()); + + case SEQ_NUM: + return Long.valueOf(getSeqNum()); + + case PRIVILEGE_CHANGES: + return getPrivilegeChanges(); + + case ROLE_CHANGES: + return getRoleChanges(); + + } + 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 HASFULL_IMAGE: + return isSetHasfullImage(); + case SEQ_NUM: + return isSetSeqNum(); + case PRIVILEGE_CHANGES: + return isSetPrivilegeChanges(); + case ROLE_CHANGES: + return isSetRoleChanges(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPermissionsUpdate) + return this.equals((TPermissionsUpdate)that); + return false; + } + + public boolean equals(TPermissionsUpdate that) { + if (that == null) + return false; + + boolean this_present_hasfullImage = true; + boolean that_present_hasfullImage = true; + if (this_present_hasfullImage || that_present_hasfullImage) { + if (!(this_present_hasfullImage && that_present_hasfullImage)) + return false; + if (this.hasfullImage != that.hasfullImage) + return false; + } + + boolean this_present_seqNum = true; + boolean that_present_seqNum = true; + if (this_present_seqNum || that_present_seqNum) { + if (!(this_present_seqNum && that_present_seqNum)) + return false; + if (this.seqNum != that.seqNum) + return false; + } + + boolean this_present_privilegeChanges = true && this.isSetPrivilegeChanges(); + boolean that_present_privilegeChanges = true && that.isSetPrivilegeChanges(); + if (this_present_privilegeChanges || that_present_privilegeChanges) { + if (!(this_present_privilegeChanges && that_present_privilegeChanges)) + return false; + if (!this.privilegeChanges.equals(that.privilegeChanges)) + return false; + } + + boolean this_present_roleChanges = true && this.isSetRoleChanges(); + boolean that_present_roleChanges = true && that.isSetRoleChanges(); + if (this_present_roleChanges || that_present_roleChanges) { + if (!(this_present_roleChanges && that_present_roleChanges)) + return false; + if (!this.roleChanges.equals(that.roleChanges)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_hasfullImage = true; + builder.append(present_hasfullImage); + if (present_hasfullImage) + builder.append(hasfullImage); + + boolean present_seqNum = true; + builder.append(present_seqNum); + if (present_seqNum) + builder.append(seqNum); + + boolean present_privilegeChanges = true && (isSetPrivilegeChanges()); + builder.append(present_privilegeChanges); + if (present_privilegeChanges) + builder.append(privilegeChanges); + + boolean present_roleChanges = true && (isSetRoleChanges()); + builder.append(present_roleChanges); + if (present_roleChanges) + builder.append(roleChanges); + + return builder.toHashCode(); + } + + public int compareTo(TPermissionsUpdate other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TPermissionsUpdate typedOther = (TPermissionsUpdate)other; + + lastComparison = Boolean.valueOf(isSetHasfullImage()).compareTo(typedOther.isSetHasfullImage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasfullImage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasfullImage, typedOther.hasfullImage); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSeqNum()).compareTo(typedOther.isSetSeqNum()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSeqNum()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.seqNum, typedOther.seqNum); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPrivilegeChanges()).compareTo(typedOther.isSetPrivilegeChanges()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrivilegeChanges()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privilegeChanges, typedOther.privilegeChanges); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRoleChanges()).compareTo(typedOther.isSetRoleChanges()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRoleChanges()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roleChanges, typedOther.roleChanges); + 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("TPermissionsUpdate("); + boolean first = true; + + sb.append("hasfullImage:"); + sb.append(this.hasfullImage); + first = false; + if (!first) sb.append(", "); + sb.append("seqNum:"); + sb.append(this.seqNum); + first = false; + if (!first) sb.append(", "); + sb.append("privilegeChanges:"); + if (this.privilegeChanges == null) { + sb.append("null"); + } else { + sb.append(this.privilegeChanges); + } + first = false; + if (!first) sb.append(", "); + sb.append("roleChanges:"); + if (this.roleChanges == null) { + sb.append("null"); + } else { + sb.append(this.roleChanges); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetHasfullImage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasfullImage' is unset! Struct:" + toString()); + } + + if (!isSetSeqNum()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'seqNum' is unset! Struct:" + toString()); + } + + if (!isSetPrivilegeChanges()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'privilegeChanges' is unset! Struct:" + toString()); + } + + if (!isSetRoleChanges()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleChanges' 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 TPermissionsUpdateStandardSchemeFactory implements SchemeFactory { + public TPermissionsUpdateStandardScheme getScheme() { + return new TPermissionsUpdateStandardScheme(); + } + } + + private static class TPermissionsUpdateStandardScheme extends StandardScheme<TPermissionsUpdate> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPermissionsUpdate 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: // HASFULL_IMAGE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasfullImage = iprot.readBool(); + struct.setHasfullImageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SEQ_NUM + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.seqNum = iprot.readI64(); + struct.setSeqNumIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PRIVILEGE_CHANGES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map158 = iprot.readMapBegin(); + struct.privilegeChanges = new HashMap<String,TPrivilegeChanges>(2*_map158.size); + for (int _i159 = 0; _i159 < _map158.size; ++_i159) + { + String _key160; // required + TPrivilegeChanges _val161; // required + _key160 = iprot.readString(); + _val161 = new TPrivilegeChanges(); + _val161.read(iprot); + struct.privilegeChanges.put(_key160, _val161); + } + iprot.readMapEnd(); + } + struct.setPrivilegeChangesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ROLE_CHANGES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); + struct.roleChanges = new HashMap<String,TRoleChanges>(2*_map162.size); + for (int _i163 = 0; _i163 < _map162.size; ++_i163) + { + String _key164; // required + TRoleChanges _val165; // required + _key164 = iprot.readString(); + _val165 = new TRoleChanges(); + _val165.read(iprot); + struct.roleChanges.put(_key164, _val165); + } + iprot.readMapEnd(); + } + struct.setRoleChangesIsSet(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, TPermissionsUpdate struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(HASFULL_IMAGE_FIELD_DESC); + oprot.writeBool(struct.hasfullImage); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(SEQ_NUM_FIELD_DESC); + oprot.writeI64(struct.seqNum); + oprot.writeFieldEnd(); + if (struct.privilegeChanges != null) { + oprot.writeFieldBegin(PRIVILEGE_CHANGES_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.privilegeChanges.size())); + for (Map.Entry<String, TPrivilegeChanges> _iter166 : struct.privilegeChanges.entrySet()) + { + oprot.writeString(_iter166.getKey()); + _iter166.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.roleChanges != null) { + oprot.writeFieldBegin(ROLE_CHANGES_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.roleChanges.size())); + for (Map.Entry<String, TRoleChanges> _iter167 : struct.roleChanges.entrySet()) + { + oprot.writeString(_iter167.getKey()); + _iter167.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPermissionsUpdateTupleSchemeFactory implements SchemeFactory { + public TPermissionsUpdateTupleScheme getScheme() { + return new TPermissionsUpdateTupleScheme(); + } + } + + private static class TPermissionsUpdateTupleScheme extends TupleScheme<TPermissionsUpdate> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPermissionsUpdate struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBool(struct.hasfullImage); + oprot.writeI64(struct.seqNum); + { + oprot.writeI32(struct.privilegeChanges.size()); + for (Map.Entry<String, TPrivilegeChanges> _iter168 : struct.privilegeChanges.entrySet()) + { + oprot.writeString(_iter168.getKey()); + _iter168.getValue().write(oprot); + } + } + { + oprot.writeI32(struct.roleChanges.size()); + for (Map.Entry<String, TRoleChanges> _iter169 : struct.roleChanges.entrySet()) + { + oprot.writeString(_iter169.getKey()); + _iter169.getValue().write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPermissionsUpdate struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.hasfullImage = iprot.readBool(); + struct.setHasfullImageIsSet(true); + struct.seqNum = iprot.readI64(); + struct.setSeqNumIsSet(true); + { + org.apache.thrift.protocol.TMap _map170 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.privilegeChanges = new HashMap<String,TPrivilegeChanges>(2*_map170.size); + for (int _i171 = 0; _i171 < _map170.size; ++_i171) + { + String _key172; // required + TPrivilegeChanges _val173; // required + _key172 = iprot.readString(); + _val173 = new TPrivilegeChanges(); + _val173.read(iprot); + struct.privilegeChanges.put(_key172, _val173); + } + } + struct.setPrivilegeChangesIsSet(true); + { + org.apache.thrift.protocol.TMap _map174 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.roleChanges = new HashMap<String,TRoleChanges>(2*_map174.size); + for (int _i175 = 0; _i175 < _map174.size; ++_i175) + { + String _key176; // required + TRoleChanges _val177; // required + _key176 = iprot.readString(); + _val177 = new TRoleChanges(); + _val177.read(iprot); + struct.roleChanges.put(_key176, _val177); + } + } + struct.setRoleChangesIsSet(true); + } + } + +} + http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/0eb6645e/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPrivilegeChanges.java ---------------------------------------------------------------------- diff --git a/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPrivilegeChanges.java b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPrivilegeChanges.java new file mode 100644 index 0000000..3ded631 --- /dev/null +++ b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPrivilegeChanges.java @@ -0,0 +1,713 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.sentry.provider.db.service.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChanges, TPrivilegeChanges._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrivilegeChanges"); + + private static final org.apache.thrift.protocol.TField AUTHZ_OBJ_FIELD_DESC = new org.apache.thrift.protocol.TField("authzObj", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ADD_PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("addPrivileges", org.apache.thrift.protocol.TType.MAP, (short)2); + private static final org.apache.thrift.protocol.TField DEL_PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("delPrivileges", org.apache.thrift.protocol.TType.MAP, (short)3); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPrivilegeChangesStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPrivilegeChangesTupleSchemeFactory()); + } + + private String authzObj; // required + private Map<String,String> addPrivileges; // required + private Map<String,String> delPrivileges; // 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 { + AUTHZ_OBJ((short)1, "authzObj"), + ADD_PRIVILEGES((short)2, "addPrivileges"), + DEL_PRIVILEGES((short)3, "delPrivileges"); + + 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: // AUTHZ_OBJ + return AUTHZ_OBJ; + case 2: // ADD_PRIVILEGES + return ADD_PRIVILEGES; + case 3: // DEL_PRIVILEGES + return DEL_PRIVILEGES; + 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.AUTHZ_OBJ, new org.apache.thrift.meta_data.FieldMetaData("authzObj", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ADD_PRIVILEGES, new org.apache.thrift.meta_data.FieldMetaData("addPrivileges", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.DEL_PRIVILEGES, new org.apache.thrift.meta_data.FieldMetaData("delPrivileges", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrivilegeChanges.class, metaDataMap); + } + + public TPrivilegeChanges() { + } + + public TPrivilegeChanges( + String authzObj, + Map<String,String> addPrivileges, + Map<String,String> delPrivileges) + { + this(); + this.authzObj = authzObj; + this.addPrivileges = addPrivileges; + this.delPrivileges = delPrivileges; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public TPrivilegeChanges(TPrivilegeChanges other) { + if (other.isSetAuthzObj()) { + this.authzObj = other.authzObj; + } + if (other.isSetAddPrivileges()) { + Map<String,String> __this__addPrivileges = new HashMap<String,String>(); + for (Map.Entry<String, String> other_element : other.addPrivileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__addPrivileges_copy_key = other_element_key; + + String __this__addPrivileges_copy_value = other_element_value; + + __this__addPrivileges.put(__this__addPrivileges_copy_key, __this__addPrivileges_copy_value); + } + this.addPrivileges = __this__addPrivileges; + } + if (other.isSetDelPrivileges()) { + Map<String,String> __this__delPrivileges = new HashMap<String,String>(); + for (Map.Entry<String, String> other_element : other.delPrivileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__delPrivileges_copy_key = other_element_key; + + String __this__delPrivileges_copy_value = other_element_value; + + __this__delPrivileges.put(__this__delPrivileges_copy_key, __this__delPrivileges_copy_value); + } + this.delPrivileges = __this__delPrivileges; + } + } + + public TPrivilegeChanges deepCopy() { + return new TPrivilegeChanges(this); + } + + @Override + public void clear() { + this.authzObj = null; + this.addPrivileges = null; + this.delPrivileges = null; + } + + public String getAuthzObj() { + return this.authzObj; + } + + public void setAuthzObj(String authzObj) { + this.authzObj = authzObj; + } + + public void unsetAuthzObj() { + this.authzObj = null; + } + + /** Returns true if field authzObj is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthzObj() { + return this.authzObj != null; + } + + public void setAuthzObjIsSet(boolean value) { + if (!value) { + this.authzObj = null; + } + } + + public int getAddPrivilegesSize() { + return (this.addPrivileges == null) ? 0 : this.addPrivileges.size(); + } + + public void putToAddPrivileges(String key, String val) { + if (this.addPrivileges == null) { + this.addPrivileges = new HashMap<String,String>(); + } + this.addPrivileges.put(key, val); + } + + public Map<String,String> getAddPrivileges() { + return this.addPrivileges; + } + + public void setAddPrivileges(Map<String,String> addPrivileges) { + this.addPrivileges = addPrivileges; + } + + public void unsetAddPrivileges() { + this.addPrivileges = null; + } + + /** Returns true if field addPrivileges is set (has been assigned a value) and false otherwise */ + public boolean isSetAddPrivileges() { + return this.addPrivileges != null; + } + + public void setAddPrivilegesIsSet(boolean value) { + if (!value) { + this.addPrivileges = null; + } + } + + public int getDelPrivilegesSize() { + return (this.delPrivileges == null) ? 0 : this.delPrivileges.size(); + } + + public void putToDelPrivileges(String key, String val) { + if (this.delPrivileges == null) { + this.delPrivileges = new HashMap<String,String>(); + } + this.delPrivileges.put(key, val); + } + + public Map<String,String> getDelPrivileges() { + return this.delPrivileges; + } + + public void setDelPrivileges(Map<String,String> delPrivileges) { + this.delPrivileges = delPrivileges; + } + + public void unsetDelPrivileges() { + this.delPrivileges = null; + } + + /** Returns true if field delPrivileges is set (has been assigned a value) and false otherwise */ + public boolean isSetDelPrivileges() { + return this.delPrivileges != null; + } + + public void setDelPrivilegesIsSet(boolean value) { + if (!value) { + this.delPrivileges = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AUTHZ_OBJ: + if (value == null) { + unsetAuthzObj(); + } else { + setAuthzObj((String)value); + } + break; + + case ADD_PRIVILEGES: + if (value == null) { + unsetAddPrivileges(); + } else { + setAddPrivileges((Map<String,String>)value); + } + break; + + case DEL_PRIVILEGES: + if (value == null) { + unsetDelPrivileges(); + } else { + setDelPrivileges((Map<String,String>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AUTHZ_OBJ: + return getAuthzObj(); + + case ADD_PRIVILEGES: + return getAddPrivileges(); + + case DEL_PRIVILEGES: + return getDelPrivileges(); + + } + 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 AUTHZ_OBJ: + return isSetAuthzObj(); + case ADD_PRIVILEGES: + return isSetAddPrivileges(); + case DEL_PRIVILEGES: + return isSetDelPrivileges(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPrivilegeChanges) + return this.equals((TPrivilegeChanges)that); + return false; + } + + public boolean equals(TPrivilegeChanges that) { + if (that == null) + return false; + + boolean this_present_authzObj = true && this.isSetAuthzObj(); + boolean that_present_authzObj = true && that.isSetAuthzObj(); + if (this_present_authzObj || that_present_authzObj) { + if (!(this_present_authzObj && that_present_authzObj)) + return false; + if (!this.authzObj.equals(that.authzObj)) + return false; + } + + boolean this_present_addPrivileges = true && this.isSetAddPrivileges(); + boolean that_present_addPrivileges = true && that.isSetAddPrivileges(); + if (this_present_addPrivileges || that_present_addPrivileges) { + if (!(this_present_addPrivileges && that_present_addPrivileges)) + return false; + if (!this.addPrivileges.equals(that.addPrivileges)) + return false; + } + + boolean this_present_delPrivileges = true && this.isSetDelPrivileges(); + boolean that_present_delPrivileges = true && that.isSetDelPrivileges(); + if (this_present_delPrivileges || that_present_delPrivileges) { + if (!(this_present_delPrivileges && that_present_delPrivileges)) + return false; + if (!this.delPrivileges.equals(that.delPrivileges)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_authzObj = true && (isSetAuthzObj()); + builder.append(present_authzObj); + if (present_authzObj) + builder.append(authzObj); + + boolean present_addPrivileges = true && (isSetAddPrivileges()); + builder.append(present_addPrivileges); + if (present_addPrivileges) + builder.append(addPrivileges); + + boolean present_delPrivileges = true && (isSetDelPrivileges()); + builder.append(present_delPrivileges); + if (present_delPrivileges) + builder.append(delPrivileges); + + return builder.toHashCode(); + } + + public int compareTo(TPrivilegeChanges other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TPrivilegeChanges typedOther = (TPrivilegeChanges)other; + + lastComparison = Boolean.valueOf(isSetAuthzObj()).compareTo(typedOther.isSetAuthzObj()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthzObj()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzObj, typedOther.authzObj); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAddPrivileges()).compareTo(typedOther.isSetAddPrivileges()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAddPrivileges()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addPrivileges, typedOther.addPrivileges); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDelPrivileges()).compareTo(typedOther.isSetDelPrivileges()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelPrivileges()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delPrivileges, typedOther.delPrivileges); + 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("TPrivilegeChanges("); + boolean first = true; + + sb.append("authzObj:"); + if (this.authzObj == null) { + sb.append("null"); + } else { + sb.append(this.authzObj); + } + first = false; + if (!first) sb.append(", "); + sb.append("addPrivileges:"); + if (this.addPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.addPrivileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("delPrivileges:"); + if (this.delPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.delPrivileges); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetAuthzObj()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzObj' is unset! Struct:" + toString()); + } + + if (!isSetAddPrivileges()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'addPrivileges' is unset! Struct:" + toString()); + } + + if (!isSetDelPrivileges()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'delPrivileges' 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 TPrivilegeChangesStandardSchemeFactory implements SchemeFactory { + public TPrivilegeChangesStandardScheme getScheme() { + return new TPrivilegeChangesStandardScheme(); + } + } + + private static class TPrivilegeChangesStandardScheme extends StandardScheme<TPrivilegeChanges> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPrivilegeChanges 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: // AUTHZ_OBJ + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.authzObj = iprot.readString(); + struct.setAuthzObjIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ADD_PRIVILEGES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map122 = iprot.readMapBegin(); + struct.addPrivileges = new HashMap<String,String>(2*_map122.size); + for (int _i123 = 0; _i123 < _map122.size; ++_i123) + { + String _key124; // required + String _val125; // required + _key124 = iprot.readString(); + _val125 = iprot.readString(); + struct.addPrivileges.put(_key124, _val125); + } + iprot.readMapEnd(); + } + struct.setAddPrivilegesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // DEL_PRIVILEGES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map126 = iprot.readMapBegin(); + struct.delPrivileges = new HashMap<String,String>(2*_map126.size); + for (int _i127 = 0; _i127 < _map126.size; ++_i127) + { + String _key128; // required + String _val129; // required + _key128 = iprot.readString(); + _val129 = iprot.readString(); + struct.delPrivileges.put(_key128, _val129); + } + iprot.readMapEnd(); + } + struct.setDelPrivilegesIsSet(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, TPrivilegeChanges struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.authzObj != null) { + oprot.writeFieldBegin(AUTHZ_OBJ_FIELD_DESC); + oprot.writeString(struct.authzObj); + oprot.writeFieldEnd(); + } + if (struct.addPrivileges != null) { + oprot.writeFieldBegin(ADD_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.addPrivileges.size())); + for (Map.Entry<String, String> _iter130 : struct.addPrivileges.entrySet()) + { + oprot.writeString(_iter130.getKey()); + oprot.writeString(_iter130.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.delPrivileges != null) { + oprot.writeFieldBegin(DEL_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.delPrivileges.size())); + for (Map.Entry<String, String> _iter131 : struct.delPrivileges.entrySet()) + { + oprot.writeString(_iter131.getKey()); + oprot.writeString(_iter131.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPrivilegeChangesTupleSchemeFactory implements SchemeFactory { + public TPrivilegeChangesTupleScheme getScheme() { + return new TPrivilegeChangesTupleScheme(); + } + } + + private static class TPrivilegeChangesTupleScheme extends TupleScheme<TPrivilegeChanges> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPrivilegeChanges struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.authzObj); + { + oprot.writeI32(struct.addPrivileges.size()); + for (Map.Entry<String, String> _iter132 : struct.addPrivileges.entrySet()) + { + oprot.writeString(_iter132.getKey()); + oprot.writeString(_iter132.getValue()); + } + } + { + oprot.writeI32(struct.delPrivileges.size()); + for (Map.Entry<String, String> _iter133 : struct.delPrivileges.entrySet()) + { + oprot.writeString(_iter133.getKey()); + oprot.writeString(_iter133.getValue()); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPrivilegeChanges struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.authzObj = iprot.readString(); + struct.setAuthzObjIsSet(true); + { + org.apache.thrift.protocol.TMap _map134 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.addPrivileges = new HashMap<String,String>(2*_map134.size); + for (int _i135 = 0; _i135 < _map134.size; ++_i135) + { + String _key136; // required + String _val137; // required + _key136 = iprot.readString(); + _val137 = iprot.readString(); + struct.addPrivileges.put(_key136, _val137); + } + } + struct.setAddPrivilegesIsSet(true); + { + org.apache.thrift.protocol.TMap _map138 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.delPrivileges = new HashMap<String,String>(2*_map138.size); + for (int _i139 = 0; _i139 < _map138.size; ++_i139) + { + String _key140; // required + String _val141; // required + _key140 = iprot.readString(); + _val141 = iprot.readString(); + struct.delPrivileges.put(_key140, _val141); + } + } + struct.setDelPrivilegesIsSet(true); + } + } + +} +
