Return-Path: X-Original-To: apmail-sentry-commits-archive@minotaur.apache.org Delivered-To: apmail-sentry-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C700C11F96 for ; Mon, 15 Sep 2014 21:09:29 +0000 (UTC) Received: (qmail 72176 invoked by uid 500); 15 Sep 2014 21:09:26 -0000 Delivered-To: apmail-sentry-commits-archive@sentry.apache.org Received: (qmail 72128 invoked by uid 500); 15 Sep 2014 21:09:26 -0000 Mailing-List: contact commits-help@sentry.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sentry.incubator.apache.org Delivered-To: mailing list commits@sentry.incubator.apache.org Received: (qmail 72119 invoked by uid 99); 15 Sep 2014 21:09:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2014 21:09:26 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 15 Sep 2014 21:07:43 +0000 Received: (qmail 64704 invoked by uid 99); 15 Sep 2014 21:07:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2014 21:07:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6AF83A143D8; Mon, 15 Sep 2014 21:07:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: prasadm@apache.org To: commits@sentry.incubator.apache.org Date: Mon, 15 Sep 2014 21:07:44 -0000 Message-Id: <150561c930f5480c971c396dc3801a63@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [06/25] SENTRY-432. HDFS ingration. Initial patch X-Virus-Checked: Checked by ClamAV on apache.org 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/TListSentryRolesResponse.java ---------------------------------------------------------------------- diff --git a/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesResponse.java b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesResponse.java new file mode 100644 index 0000000..13f22ff --- /dev/null +++ b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TListSentryRolesResponse.java @@ -0,0 +1,554 @@ +/** + * 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 TListSentryRolesResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TListSentryRolesResponse"); + + private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField ROLES_FIELD_DESC = new org.apache.thrift.protocol.TField("roles", org.apache.thrift.protocol.TType.SET, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TListSentryRolesResponseStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TListSentryRolesResponseTupleSchemeFactory()); + } + + private org.apache.sentry.service.thrift.TSentryResponseStatus status; // required + private Set roles; // 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 { + STATUS((short)1, "status"), + ROLES((short)2, "roles"); + + private static final Map byName = new HashMap(); + + 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: // STATUS + return STATUS; + case 2: // ROLES + return ROLES; + 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 _Fields optionals[] = {_Fields.ROLES}; + 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.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.sentry.service.thrift.TSentryResponseStatus.class))); + tmpMap.put(_Fields.ROLES, new org.apache.thrift.meta_data.FieldMetaData("roles", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSentryRole.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TListSentryRolesResponse.class, metaDataMap); + } + + public TListSentryRolesResponse() { + } + + public TListSentryRolesResponse( + org.apache.sentry.service.thrift.TSentryResponseStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TListSentryRolesResponse(TListSentryRolesResponse other) { + if (other.isSetStatus()) { + this.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(other.status); + } + if (other.isSetRoles()) { + Set __this__roles = new HashSet(); + for (TSentryRole other_element : other.roles) { + __this__roles.add(new TSentryRole(other_element)); + } + this.roles = __this__roles; + } + } + + public TListSentryRolesResponse deepCopy() { + return new TListSentryRolesResponse(this); + } + + @Override + public void clear() { + this.status = null; + this.roles = null; + } + + public org.apache.sentry.service.thrift.TSentryResponseStatus getStatus() { + return this.status; + } + + public void setStatus(org.apache.sentry.service.thrift.TSentryResponseStatus status) { + this.status = status; + } + + public void unsetStatus() { + this.status = null; + } + + /** Returns true if field status is set (has been assigned a value) and false otherwise */ + public boolean isSetStatus() { + return this.status != null; + } + + public void setStatusIsSet(boolean value) { + if (!value) { + this.status = null; + } + } + + public int getRolesSize() { + return (this.roles == null) ? 0 : this.roles.size(); + } + + public java.util.Iterator getRolesIterator() { + return (this.roles == null) ? null : this.roles.iterator(); + } + + public void addToRoles(TSentryRole elem) { + if (this.roles == null) { + this.roles = new HashSet(); + } + this.roles.add(elem); + } + + public Set getRoles() { + return this.roles; + } + + public void setRoles(Set roles) { + this.roles = roles; + } + + public void unsetRoles() { + this.roles = null; + } + + /** Returns true if field roles is set (has been assigned a value) and false otherwise */ + public boolean isSetRoles() { + return this.roles != null; + } + + public void setRolesIsSet(boolean value) { + if (!value) { + this.roles = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((org.apache.sentry.service.thrift.TSentryResponseStatus)value); + } + break; + + case ROLES: + if (value == null) { + unsetRoles(); + } else { + setRoles((Set)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case ROLES: + return getRoles(); + + } + 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 STATUS: + return isSetStatus(); + case ROLES: + return isSetRoles(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TListSentryRolesResponse) + return this.equals((TListSentryRolesResponse)that); + return false; + } + + public boolean equals(TListSentryRolesResponse that) { + if (that == null) + return false; + + boolean this_present_status = true && this.isSetStatus(); + boolean that_present_status = true && that.isSetStatus(); + if (this_present_status || that_present_status) { + if (!(this_present_status && that_present_status)) + return false; + if (!this.status.equals(that.status)) + return false; + } + + boolean this_present_roles = true && this.isSetRoles(); + boolean that_present_roles = true && that.isSetRoles(); + if (this_present_roles || that_present_roles) { + if (!(this_present_roles && that_present_roles)) + return false; + if (!this.roles.equals(that.roles)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_status = true && (isSetStatus()); + builder.append(present_status); + if (present_status) + builder.append(status); + + boolean present_roles = true && (isSetRoles()); + builder.append(present_roles); + if (present_roles) + builder.append(roles); + + return builder.toHashCode(); + } + + public int compareTo(TListSentryRolesResponse other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TListSentryRolesResponse typedOther = (TListSentryRolesResponse)other; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRoles()).compareTo(typedOther.isSetRoles()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRoles()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roles, typedOther.roles); + 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("TListSentryRolesResponse("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetRoles()) { + if (!first) sb.append(", "); + sb.append("roles:"); + if (this.roles == null) { + sb.append("null"); + } else { + sb.append(this.roles); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TListSentryRolesResponseStandardSchemeFactory implements SchemeFactory { + public TListSentryRolesResponseStandardScheme getScheme() { + return new TListSentryRolesResponseStandardScheme(); + } + } + + private static class TListSentryRolesResponseStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TListSentryRolesResponse 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: // STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROLES + if (schemeField.type == org.apache.thrift.protocol.TType.SET) { + { + org.apache.thrift.protocol.TSet _set24 = iprot.readSetBegin(); + struct.roles = new HashSet(2*_set24.size); + for (int _i25 = 0; _i25 < _set24.size; ++_i25) + { + TSentryRole _elem26; // required + _elem26 = new TSentryRole(); + _elem26.read(iprot); + struct.roles.add(_elem26); + } + iprot.readSetEnd(); + } + struct.setRolesIsSet(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, TListSentryRolesResponse struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.status != null) { + oprot.writeFieldBegin(STATUS_FIELD_DESC); + struct.status.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.roles != null) { + if (struct.isSetRoles()) { + oprot.writeFieldBegin(ROLES_FIELD_DESC); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.roles.size())); + for (TSentryRole _iter27 : struct.roles) + { + _iter27.write(oprot); + } + oprot.writeSetEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TListSentryRolesResponseTupleSchemeFactory implements SchemeFactory { + public TListSentryRolesResponseTupleScheme getScheme() { + return new TListSentryRolesResponseTupleScheme(); + } + } + + private static class TListSentryRolesResponseTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TListSentryRolesResponse struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetRoles()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetRoles()) { + { + oprot.writeI32(struct.roles.size()); + for (TSentryRole _iter28 : struct.roles) + { + _iter28.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TListSentryRolesResponse struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TSet _set29 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.roles = new HashSet(2*_set29.size); + for (int _i30 = 0; _i30 < _set29.size; ++_i30) + { + TSentryRole _elem31; // required + _elem31 = new TSentryRole(); + _elem31.read(iprot); + struct.roles.add(_elem31); + } + } + struct.setRolesIsSet(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/TPathChanges.java ---------------------------------------------------------------------- diff --git a/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathChanges.java b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathChanges.java new file mode 100644 index 0000000..c692099 --- /dev/null +++ b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathChanges.java @@ -0,0 +1,765 @@ +/** + * 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 TPathChanges implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPathChanges"); + + 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_PATHS_FIELD_DESC = new org.apache.thrift.protocol.TField("addPaths", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField DEL_PATHS_FIELD_DESC = new org.apache.thrift.protocol.TField("delPaths", org.apache.thrift.protocol.TType.LIST, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPathChangesStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPathChangesTupleSchemeFactory()); + } + + private String authzObj; // required + private List> addPaths; // required + private List> delPaths; // 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_PATHS((short)2, "addPaths"), + DEL_PATHS((short)3, "delPaths"); + + private static final Map byName = new HashMap(); + + 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_PATHS + return ADD_PATHS; + case 3: // DEL_PATHS + return DEL_PATHS; + 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_PATHS, new org.apache.thrift.meta_data.FieldMetaData("addPaths", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); + tmpMap.put(_Fields.DEL_PATHS, new org.apache.thrift.meta_data.FieldMetaData("delPaths", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPathChanges.class, metaDataMap); + } + + public TPathChanges() { + } + + public TPathChanges( + String authzObj, + List> addPaths, + List> delPaths) + { + this(); + this.authzObj = authzObj; + this.addPaths = addPaths; + this.delPaths = delPaths; + } + + /** + * Performs a deep copy on other. + */ + public TPathChanges(TPathChanges other) { + if (other.isSetAuthzObj()) { + this.authzObj = other.authzObj; + } + if (other.isSetAddPaths()) { + List> __this__addPaths = new ArrayList>(); + for (List other_element : other.addPaths) { + List __this__addPaths_copy = new ArrayList(); + for (String other_element_element : other_element) { + __this__addPaths_copy.add(other_element_element); + } + __this__addPaths.add(__this__addPaths_copy); + } + this.addPaths = __this__addPaths; + } + if (other.isSetDelPaths()) { + List> __this__delPaths = new ArrayList>(); + for (List other_element : other.delPaths) { + List __this__delPaths_copy = new ArrayList(); + for (String other_element_element : other_element) { + __this__delPaths_copy.add(other_element_element); + } + __this__delPaths.add(__this__delPaths_copy); + } + this.delPaths = __this__delPaths; + } + } + + public TPathChanges deepCopy() { + return new TPathChanges(this); + } + + @Override + public void clear() { + this.authzObj = null; + this.addPaths = null; + this.delPaths = 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 getAddPathsSize() { + return (this.addPaths == null) ? 0 : this.addPaths.size(); + } + + public java.util.Iterator> getAddPathsIterator() { + return (this.addPaths == null) ? null : this.addPaths.iterator(); + } + + public void addToAddPaths(List elem) { + if (this.addPaths == null) { + this.addPaths = new ArrayList>(); + } + this.addPaths.add(elem); + } + + public List> getAddPaths() { + return this.addPaths; + } + + public void setAddPaths(List> addPaths) { + this.addPaths = addPaths; + } + + public void unsetAddPaths() { + this.addPaths = null; + } + + /** Returns true if field addPaths is set (has been assigned a value) and false otherwise */ + public boolean isSetAddPaths() { + return this.addPaths != null; + } + + public void setAddPathsIsSet(boolean value) { + if (!value) { + this.addPaths = null; + } + } + + public int getDelPathsSize() { + return (this.delPaths == null) ? 0 : this.delPaths.size(); + } + + public java.util.Iterator> getDelPathsIterator() { + return (this.delPaths == null) ? null : this.delPaths.iterator(); + } + + public void addToDelPaths(List elem) { + if (this.delPaths == null) { + this.delPaths = new ArrayList>(); + } + this.delPaths.add(elem); + } + + public List> getDelPaths() { + return this.delPaths; + } + + public void setDelPaths(List> delPaths) { + this.delPaths = delPaths; + } + + public void unsetDelPaths() { + this.delPaths = null; + } + + /** Returns true if field delPaths is set (has been assigned a value) and false otherwise */ + public boolean isSetDelPaths() { + return this.delPaths != null; + } + + public void setDelPathsIsSet(boolean value) { + if (!value) { + this.delPaths = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AUTHZ_OBJ: + if (value == null) { + unsetAuthzObj(); + } else { + setAuthzObj((String)value); + } + break; + + case ADD_PATHS: + if (value == null) { + unsetAddPaths(); + } else { + setAddPaths((List>)value); + } + break; + + case DEL_PATHS: + if (value == null) { + unsetDelPaths(); + } else { + setDelPaths((List>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AUTHZ_OBJ: + return getAuthzObj(); + + case ADD_PATHS: + return getAddPaths(); + + case DEL_PATHS: + return getDelPaths(); + + } + 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_PATHS: + return isSetAddPaths(); + case DEL_PATHS: + return isSetDelPaths(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPathChanges) + return this.equals((TPathChanges)that); + return false; + } + + public boolean equals(TPathChanges 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_addPaths = true && this.isSetAddPaths(); + boolean that_present_addPaths = true && that.isSetAddPaths(); + if (this_present_addPaths || that_present_addPaths) { + if (!(this_present_addPaths && that_present_addPaths)) + return false; + if (!this.addPaths.equals(that.addPaths)) + return false; + } + + boolean this_present_delPaths = true && this.isSetDelPaths(); + boolean that_present_delPaths = true && that.isSetDelPaths(); + if (this_present_delPaths || that_present_delPaths) { + if (!(this_present_delPaths && that_present_delPaths)) + return false; + if (!this.delPaths.equals(that.delPaths)) + 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_addPaths = true && (isSetAddPaths()); + builder.append(present_addPaths); + if (present_addPaths) + builder.append(addPaths); + + boolean present_delPaths = true && (isSetDelPaths()); + builder.append(present_delPaths); + if (present_delPaths) + builder.append(delPaths); + + return builder.toHashCode(); + } + + public int compareTo(TPathChanges other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TPathChanges typedOther = (TPathChanges)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(isSetAddPaths()).compareTo(typedOther.isSetAddPaths()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAddPaths()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addPaths, typedOther.addPaths); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDelPaths()).compareTo(typedOther.isSetDelPaths()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelPaths()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delPaths, typedOther.delPaths); + 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("TPathChanges("); + 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("addPaths:"); + if (this.addPaths == null) { + sb.append("null"); + } else { + sb.append(this.addPaths); + } + first = false; + if (!first) sb.append(", "); + sb.append("delPaths:"); + if (this.delPaths == null) { + sb.append("null"); + } else { + sb.append(this.delPaths); + } + 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 (!isSetAddPaths()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'addPaths' is unset! Struct:" + toString()); + } + + if (!isSetDelPaths()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'delPaths' 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 TPathChangesStandardSchemeFactory implements SchemeFactory { + public TPathChangesStandardScheme getScheme() { + return new TPathChangesStandardScheme(); + } + } + + private static class TPathChangesStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPathChanges 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_PATHS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); + struct.addPaths = new ArrayList>(_list64.size); + for (int _i65 = 0; _i65 < _list64.size; ++_i65) + { + List _elem66; // required + { + org.apache.thrift.protocol.TList _list67 = iprot.readListBegin(); + _elem66 = new ArrayList(_list67.size); + for (int _i68 = 0; _i68 < _list67.size; ++_i68) + { + String _elem69; // required + _elem69 = iprot.readString(); + _elem66.add(_elem69); + } + iprot.readListEnd(); + } + struct.addPaths.add(_elem66); + } + iprot.readListEnd(); + } + struct.setAddPathsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // DEL_PATHS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); + struct.delPaths = new ArrayList>(_list70.size); + for (int _i71 = 0; _i71 < _list70.size; ++_i71) + { + List _elem72; // required + { + org.apache.thrift.protocol.TList _list73 = iprot.readListBegin(); + _elem72 = new ArrayList(_list73.size); + for (int _i74 = 0; _i74 < _list73.size; ++_i74) + { + String _elem75; // required + _elem75 = iprot.readString(); + _elem72.add(_elem75); + } + iprot.readListEnd(); + } + struct.delPaths.add(_elem72); + } + iprot.readListEnd(); + } + struct.setDelPathsIsSet(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, TPathChanges 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.addPaths != null) { + oprot.writeFieldBegin(ADD_PATHS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.addPaths.size())); + for (List _iter76 : struct.addPaths) + { + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter76.size())); + for (String _iter77 : _iter76) + { + oprot.writeString(_iter77); + } + oprot.writeListEnd(); + } + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.delPaths != null) { + oprot.writeFieldBegin(DEL_PATHS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.delPaths.size())); + for (List _iter78 : struct.delPaths) + { + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter78.size())); + for (String _iter79 : _iter78) + { + oprot.writeString(_iter79); + } + oprot.writeListEnd(); + } + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPathChangesTupleSchemeFactory implements SchemeFactory { + public TPathChangesTupleScheme getScheme() { + return new TPathChangesTupleScheme(); + } + } + + private static class TPathChangesTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPathChanges struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.authzObj); + { + oprot.writeI32(struct.addPaths.size()); + for (List _iter80 : struct.addPaths) + { + { + oprot.writeI32(_iter80.size()); + for (String _iter81 : _iter80) + { + oprot.writeString(_iter81); + } + } + } + } + { + oprot.writeI32(struct.delPaths.size()); + for (List _iter82 : struct.delPaths) + { + { + oprot.writeI32(_iter82.size()); + for (String _iter83 : _iter82) + { + oprot.writeString(_iter83); + } + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPathChanges struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.authzObj = iprot.readString(); + struct.setAuthzObjIsSet(true); + { + org.apache.thrift.protocol.TList _list84 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.addPaths = new ArrayList>(_list84.size); + for (int _i85 = 0; _i85 < _list84.size; ++_i85) + { + List _elem86; // required + { + org.apache.thrift.protocol.TList _list87 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + _elem86 = new ArrayList(_list87.size); + for (int _i88 = 0; _i88 < _list87.size; ++_i88) + { + String _elem89; // required + _elem89 = iprot.readString(); + _elem86.add(_elem89); + } + } + struct.addPaths.add(_elem86); + } + } + struct.setAddPathsIsSet(true); + { + org.apache.thrift.protocol.TList _list90 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.delPaths = new ArrayList>(_list90.size); + for (int _i91 = 0; _i91 < _list90.size; ++_i91) + { + List _elem92; // required + { + org.apache.thrift.protocol.TList _list93 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + _elem92 = new ArrayList(_list93.size); + for (int _i94 = 0; _i94 < _list93.size; ++_i94) + { + String _elem95; // required + _elem95 = iprot.readString(); + _elem92.add(_elem95); + } + } + struct.delPaths.add(_elem92); + } + } + struct.setDelPathsIsSet(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/TPathEntry.java ---------------------------------------------------------------------- diff --git a/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathEntry.java b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathEntry.java new file mode 100644 index 0000000..9e72802 --- /dev/null +++ b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathEntry.java @@ -0,0 +1,747 @@ +/** + * 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 TPathEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPathEntry"); + + private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.BYTE, (short)1); + private static final org.apache.thrift.protocol.TField PATH_ELEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("pathElement", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)3); + private static final org.apache.thrift.protocol.TField CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("children", org.apache.thrift.protocol.TType.SET, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPathEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPathEntryTupleSchemeFactory()); + } + + private byte type; // required + private String pathElement; // required + private String authzObj; // optional + private Set children; // 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 { + TYPE((short)1, "type"), + PATH_ELEMENT((short)2, "pathElement"), + AUTHZ_OBJ((short)3, "authzObj"), + CHILDREN((short)4, "children"); + + private static final Map byName = new HashMap(); + + 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: // TYPE + return TYPE; + case 2: // PATH_ELEMENT + return PATH_ELEMENT; + case 3: // AUTHZ_OBJ + return AUTHZ_OBJ; + case 4: // CHILDREN + return CHILDREN; + 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 __TYPE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.AUTHZ_OBJ}; + 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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); + tmpMap.put(_Fields.PATH_ELEMENT, new org.apache.thrift.meta_data.FieldMetaData("pathElement", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.AUTHZ_OBJ, new org.apache.thrift.meta_data.FieldMetaData("authzObj", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("children", 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.I32)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPathEntry.class, metaDataMap); + } + + public TPathEntry() { + } + + public TPathEntry( + byte type, + String pathElement, + Set children) + { + this(); + this.type = type; + setTypeIsSet(true); + this.pathElement = pathElement; + this.children = children; + } + + /** + * Performs a deep copy on other. + */ + public TPathEntry(TPathEntry other) { + __isset_bitfield = other.__isset_bitfield; + this.type = other.type; + if (other.isSetPathElement()) { + this.pathElement = other.pathElement; + } + if (other.isSetAuthzObj()) { + this.authzObj = other.authzObj; + } + if (other.isSetChildren()) { + Set __this__children = new HashSet(); + for (Integer other_element : other.children) { + __this__children.add(other_element); + } + this.children = __this__children; + } + } + + public TPathEntry deepCopy() { + return new TPathEntry(this); + } + + @Override + public void clear() { + setTypeIsSet(false); + this.type = 0; + this.pathElement = null; + this.authzObj = null; + this.children = null; + } + + public byte getType() { + return this.type; + } + + public void setType(byte type) { + this.type = type; + setTypeIsSet(true); + } + + public void unsetType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TYPE_ISSET_ID); + } + + /** Returns true if field type is set (has been assigned a value) and false otherwise */ + public boolean isSetType() { + return EncodingUtils.testBit(__isset_bitfield, __TYPE_ISSET_ID); + } + + public void setTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TYPE_ISSET_ID, value); + } + + public String getPathElement() { + return this.pathElement; + } + + public void setPathElement(String pathElement) { + this.pathElement = pathElement; + } + + public void unsetPathElement() { + this.pathElement = null; + } + + /** Returns true if field pathElement is set (has been assigned a value) and false otherwise */ + public boolean isSetPathElement() { + return this.pathElement != null; + } + + public void setPathElementIsSet(boolean value) { + if (!value) { + this.pathElement = 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 getChildrenSize() { + return (this.children == null) ? 0 : this.children.size(); + } + + public java.util.Iterator getChildrenIterator() { + return (this.children == null) ? null : this.children.iterator(); + } + + public void addToChildren(int elem) { + if (this.children == null) { + this.children = new HashSet(); + } + this.children.add(elem); + } + + public Set getChildren() { + return this.children; + } + + public void setChildren(Set children) { + this.children = children; + } + + public void unsetChildren() { + this.children = null; + } + + /** Returns true if field children is set (has been assigned a value) and false otherwise */ + public boolean isSetChildren() { + return this.children != null; + } + + public void setChildrenIsSet(boolean value) { + if (!value) { + this.children = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((Byte)value); + } + break; + + case PATH_ELEMENT: + if (value == null) { + unsetPathElement(); + } else { + setPathElement((String)value); + } + break; + + case AUTHZ_OBJ: + if (value == null) { + unsetAuthzObj(); + } else { + setAuthzObj((String)value); + } + break; + + case CHILDREN: + if (value == null) { + unsetChildren(); + } else { + setChildren((Set)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TYPE: + return Byte.valueOf(getType()); + + case PATH_ELEMENT: + return getPathElement(); + + case AUTHZ_OBJ: + return getAuthzObj(); + + case CHILDREN: + return getChildren(); + + } + 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 TYPE: + return isSetType(); + case PATH_ELEMENT: + return isSetPathElement(); + case AUTHZ_OBJ: + return isSetAuthzObj(); + case CHILDREN: + return isSetChildren(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPathEntry) + return this.equals((TPathEntry)that); + return false; + } + + public boolean equals(TPathEntry that) { + if (that == null) + return false; + + boolean this_present_type = true; + boolean that_present_type = true; + if (this_present_type || that_present_type) { + if (!(this_present_type && that_present_type)) + return false; + if (this.type != that.type) + return false; + } + + boolean this_present_pathElement = true && this.isSetPathElement(); + boolean that_present_pathElement = true && that.isSetPathElement(); + if (this_present_pathElement || that_present_pathElement) { + if (!(this_present_pathElement && that_present_pathElement)) + return false; + if (!this.pathElement.equals(that.pathElement)) + 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_children = true && this.isSetChildren(); + boolean that_present_children = true && that.isSetChildren(); + if (this_present_children || that_present_children) { + if (!(this_present_children && that_present_children)) + return false; + if (!this.children.equals(that.children)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_type = true; + builder.append(present_type); + if (present_type) + builder.append(type); + + boolean present_pathElement = true && (isSetPathElement()); + builder.append(present_pathElement); + if (present_pathElement) + builder.append(pathElement); + + boolean present_authzObj = true && (isSetAuthzObj()); + builder.append(present_authzObj); + if (present_authzObj) + builder.append(authzObj); + + boolean present_children = true && (isSetChildren()); + builder.append(present_children); + if (present_children) + builder.append(children); + + return builder.toHashCode(); + } + + public int compareTo(TPathEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TPathEntry typedOther = (TPathEntry)other; + + lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPathElement()).compareTo(typedOther.isSetPathElement()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPathElement()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pathElement, typedOther.pathElement); + if (lastComparison != 0) { + return lastComparison; + } + } + 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(isSetChildren()).compareTo(typedOther.isSetChildren()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetChildren()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, typedOther.children); + 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("TPathEntry("); + boolean first = true; + + sb.append("type:"); + sb.append(this.type); + first = false; + if (!first) sb.append(", "); + sb.append("pathElement:"); + if (this.pathElement == null) { + sb.append("null"); + } else { + sb.append(this.pathElement); + } + first = false; + if (isSetAuthzObj()) { + if (!first) sb.append(", "); + sb.append("authzObj:"); + if (this.authzObj == null) { + sb.append("null"); + } else { + sb.append(this.authzObj); + } + first = false; + } + if (!first) sb.append(", "); + sb.append("children:"); + if (this.children == null) { + sb.append("null"); + } else { + sb.append(this.children); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString()); + } + + if (!isSetPathElement()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'pathElement' is unset! Struct:" + toString()); + } + + if (!isSetChildren()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'children' 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 TPathEntryStandardSchemeFactory implements SchemeFactory { + public TPathEntryStandardScheme getScheme() { + return new TPathEntryStandardScheme(); + } + } + + private static class TPathEntryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPathEntry 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: // TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { + struct.type = iprot.readByte(); + struct.setTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PATH_ELEMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.pathElement = iprot.readString(); + struct.setPathElementIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // 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 4: // CHILDREN + if (schemeField.type == org.apache.thrift.protocol.TType.SET) { + { + org.apache.thrift.protocol.TSet _set96 = iprot.readSetBegin(); + struct.children = new HashSet(2*_set96.size); + for (int _i97 = 0; _i97 < _set96.size; ++_i97) + { + int _elem98; // required + _elem98 = iprot.readI32(); + struct.children.add(_elem98); + } + iprot.readSetEnd(); + } + struct.setChildrenIsSet(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, TPathEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeByte(struct.type); + oprot.writeFieldEnd(); + if (struct.pathElement != null) { + oprot.writeFieldBegin(PATH_ELEMENT_FIELD_DESC); + oprot.writeString(struct.pathElement); + oprot.writeFieldEnd(); + } + if (struct.authzObj != null) { + if (struct.isSetAuthzObj()) { + oprot.writeFieldBegin(AUTHZ_OBJ_FIELD_DESC); + oprot.writeString(struct.authzObj); + oprot.writeFieldEnd(); + } + } + if (struct.children != null) { + oprot.writeFieldBegin(CHILDREN_FIELD_DESC); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.children.size())); + for (int _iter99 : struct.children) + { + oprot.writeI32(_iter99); + } + oprot.writeSetEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPathEntryTupleSchemeFactory implements SchemeFactory { + public TPathEntryTupleScheme getScheme() { + return new TPathEntryTupleScheme(); + } + } + + private static class TPathEntryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPathEntry struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeByte(struct.type); + oprot.writeString(struct.pathElement); + { + oprot.writeI32(struct.children.size()); + for (int _iter100 : struct.children) + { + oprot.writeI32(_iter100); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetAuthzObj()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetAuthzObj()) { + oprot.writeString(struct.authzObj); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPathEntry struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.type = iprot.readByte(); + struct.setTypeIsSet(true); + struct.pathElement = iprot.readString(); + struct.setPathElementIsSet(true); + { + org.apache.thrift.protocol.TSet _set101 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.children = new HashSet(2*_set101.size); + for (int _i102 = 0; _i102 < _set101.size; ++_i102) + { + int _elem103; // required + _elem103 = iprot.readI32(); + struct.children.add(_elem103); + } + } + struct.setChildrenIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.authzObj = iprot.readString(); + struct.setAuthzObjIsSet(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/TPathsDump.java ---------------------------------------------------------------------- diff --git a/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathsDump.java b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathsDump.java new file mode 100644 index 0000000..869d2bc --- /dev/null +++ b/sentry-service-client/src/gen/thrift/gen-javabean/org/apache/sentry/provider/db/service/thrift/TPathsDump.java @@ -0,0 +1,549 @@ +/** + * 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 TPathsDump implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPathsDump"); + + private static final org.apache.thrift.protocol.TField ROOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("rootId", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField NODE_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeMap", org.apache.thrift.protocol.TType.MAP, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPathsDumpStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPathsDumpTupleSchemeFactory()); + } + + private int rootId; // required + private Map nodeMap; // 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 { + ROOT_ID((short)1, "rootId"), + NODE_MAP((short)2, "nodeMap"); + + private static final Map byName = new HashMap(); + + 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: // ROOT_ID + return ROOT_ID; + case 2: // NODE_MAP + return NODE_MAP; + 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 __ROOTID_ISSET_ID = 0; + 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.ROOT_ID, new org.apache.thrift.meta_data.FieldMetaData("rootId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.NODE_MAP, new org.apache.thrift.meta_data.FieldMetaData("nodeMap", 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.I32), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPathEntry.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPathsDump.class, metaDataMap); + } + + public TPathsDump() { + } + + public TPathsDump( + int rootId, + Map nodeMap) + { + this(); + this.rootId = rootId; + setRootIdIsSet(true); + this.nodeMap = nodeMap; + } + + /** + * Performs a deep copy on other. + */ + public TPathsDump(TPathsDump other) { + __isset_bitfield = other.__isset_bitfield; + this.rootId = other.rootId; + if (other.isSetNodeMap()) { + Map __this__nodeMap = new HashMap(); + for (Map.Entry other_element : other.nodeMap.entrySet()) { + + Integer other_element_key = other_element.getKey(); + TPathEntry other_element_value = other_element.getValue(); + + Integer __this__nodeMap_copy_key = other_element_key; + + TPathEntry __this__nodeMap_copy_value = new TPathEntry(other_element_value); + + __this__nodeMap.put(__this__nodeMap_copy_key, __this__nodeMap_copy_value); + } + this.nodeMap = __this__nodeMap; + } + } + + public TPathsDump deepCopy() { + return new TPathsDump(this); + } + + @Override + public void clear() { + setRootIdIsSet(false); + this.rootId = 0; + this.nodeMap = null; + } + + public int getRootId() { + return this.rootId; + } + + public void setRootId(int rootId) { + this.rootId = rootId; + setRootIdIsSet(true); + } + + public void unsetRootId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ROOTID_ISSET_ID); + } + + /** Returns true if field rootId is set (has been assigned a value) and false otherwise */ + public boolean isSetRootId() { + return EncodingUtils.testBit(__isset_bitfield, __ROOTID_ISSET_ID); + } + + public void setRootIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ROOTID_ISSET_ID, value); + } + + public int getNodeMapSize() { + return (this.nodeMap == null) ? 0 : this.nodeMap.size(); + } + + public void putToNodeMap(int key, TPathEntry val) { + if (this.nodeMap == null) { + this.nodeMap = new HashMap(); + } + this.nodeMap.put(key, val); + } + + public Map getNodeMap() { + return this.nodeMap; + } + + public void setNodeMap(Map nodeMap) { + this.nodeMap = nodeMap; + } + + public void unsetNodeMap() { + this.nodeMap = null; + } + + /** Returns true if field nodeMap is set (has been assigned a value) and false otherwise */ + public boolean isSetNodeMap() { + return this.nodeMap != null; + } + + public void setNodeMapIsSet(boolean value) { + if (!value) { + this.nodeMap = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROOT_ID: + if (value == null) { + unsetRootId(); + } else { + setRootId((Integer)value); + } + break; + + case NODE_MAP: + if (value == null) { + unsetNodeMap(); + } else { + setNodeMap((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROOT_ID: + return Integer.valueOf(getRootId()); + + case NODE_MAP: + return getNodeMap(); + + } + 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 ROOT_ID: + return isSetRootId(); + case NODE_MAP: + return isSetNodeMap(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPathsDump) + return this.equals((TPathsDump)that); + return false; + } + + public boolean equals(TPathsDump that) { + if (that == null) + return false; + + boolean this_present_rootId = true; + boolean that_present_rootId = true; + if (this_present_rootId || that_present_rootId) { + if (!(this_present_rootId && that_present_rootId)) + return false; + if (this.rootId != that.rootId) + return false; + } + + boolean this_present_nodeMap = true && this.isSetNodeMap(); + boolean that_present_nodeMap = true && that.isSetNodeMap(); + if (this_present_nodeMap || that_present_nodeMap) { + if (!(this_present_nodeMap && that_present_nodeMap)) + return false; + if (!this.nodeMap.equals(that.nodeMap)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_rootId = true; + builder.append(present_rootId); + if (present_rootId) + builder.append(rootId); + + boolean present_nodeMap = true && (isSetNodeMap()); + builder.append(present_nodeMap); + if (present_nodeMap) + builder.append(nodeMap); + + return builder.toHashCode(); + } + + public int compareTo(TPathsDump other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TPathsDump typedOther = (TPathsDump)other; + + lastComparison = Boolean.valueOf(isSetRootId()).compareTo(typedOther.isSetRootId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRootId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rootId, typedOther.rootId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNodeMap()).compareTo(typedOther.isSetNodeMap()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNodeMap()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeMap, typedOther.nodeMap); + 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("TPathsDump("); + boolean first = true; + + sb.append("rootId:"); + sb.append(this.rootId); + first = false; + if (!first) sb.append(", "); + sb.append("nodeMap:"); + if (this.nodeMap == null) { + sb.append("null"); + } else { + sb.append(this.nodeMap); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetRootId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'rootId' is unset! Struct:" + toString()); + } + + if (!isSetNodeMap()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nodeMap' 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 TPathsDumpStandardSchemeFactory implements SchemeFactory { + public TPathsDumpStandardScheme getScheme() { + return new TPathsDumpStandardScheme(); + } + } + + private static class TPathsDumpStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPathsDump 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: // ROOT_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.rootId = iprot.readI32(); + struct.setRootIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NODE_MAP + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map104 = iprot.readMapBegin(); + struct.nodeMap = new HashMap(2*_map104.size); + for (int _i105 = 0; _i105 < _map104.size; ++_i105) + { + int _key106; // required + TPathEntry _val107; // required + _key106 = iprot.readI32(); + _val107 = new TPathEntry(); + _val107.read(iprot); + struct.nodeMap.put(_key106, _val107); + } + iprot.readMapEnd(); + } + struct.setNodeMapIsSet(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, TPathsDump struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ROOT_ID_FIELD_DESC); + oprot.writeI32(struct.rootId); + oprot.writeFieldEnd(); + if (struct.nodeMap != null) { + oprot.writeFieldBegin(NODE_MAP_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.nodeMap.size())); + for (Map.Entry _iter108 : struct.nodeMap.entrySet()) + { + oprot.writeI32(_iter108.getKey()); + _iter108.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPathsDumpTupleSchemeFactory implements SchemeFactory { + public TPathsDumpTupleScheme getScheme() { + return new TPathsDumpTupleScheme(); + } + } + + private static class TPathsDumpTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPathsDump struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.rootId); + { + oprot.writeI32(struct.nodeMap.size()); + for (Map.Entry _iter109 : struct.nodeMap.entrySet()) + { + oprot.writeI32(_iter109.getKey()); + _iter109.getValue().write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPathsDump struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.rootId = iprot.readI32(); + struct.setRootIdIsSet(true); + { + org.apache.thrift.protocol.TMap _map110 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.nodeMap = new HashMap(2*_map110.size); + for (int _i111 = 0; _i111 < _map110.size; ++_i111) + { + int _key112; // required + TPathEntry _val113; // required + _key112 = iprot.readI32(); + _val113 = new TPathEntry(); + _val113.read(iprot); + struct.nodeMap.put(_key112, _val113); + } + } + struct.setNodeMapIsSet(true); + } + } + +} +