sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shreepa...@apache.org
Subject git commit: SENTRY-100: Sentry Service version should be an int instead of an enum (Brock via Shreepadma)
Date Fri, 31 Jan 2014 22:57:35 GMT
Updated Branches:
  refs/heads/db_policy_store 23fb569fb -> 1e80802a5


SENTRY-100: Sentry Service version should be an int instead of an enum (Brock via Shreepadma)


Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/1e80802a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/1e80802a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/1e80802a

Branch: refs/heads/db_policy_store
Commit: 1e80802a5bffefe061f60d0ad8e6eb5492114f3d
Parents: 23fb569
Author: Shreepadma Venugopalan <shreepadma@apache.org>
Authored: Fri Jan 31 14:56:58 2014 -0800
Committer: Shreepadma Venugopalan <shreepadma@apache.org>
Committed: Fri Jan 31 14:56:58 2014 -0800

----------------------------------------------------------------------
 .../api/TAlterSentryRoleAddGroupsRequest.java   | 79 ++++++++------------
 .../TAlterSentryRoleDeleteGroupsRequest.java    | 79 ++++++++------------
 .../api/TCreateSentryPrivilegeRequest.java      | 79 ++++++++------------
 .../service/api/TCreateSentryRoleRequest.java   | 79 ++++++++------------
 .../service/api/TListSentryRolesRequest.java    | 79 ++++++++------------
 .../service/api/TSentryServiceVersion.java      | 42 -----------
 .../service/api/sentry_storeConstants.java      | 38 ++++++++++
 .../provider/db/service/thrift/Constants.java   |  7 +-
 .../db/service/thrift/sentry_store.thrift       | 17 ++---
 9 files changed, 212 insertions(+), 287 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleAddGroupsRequest.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleAddGroupsRequest.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleAddGroupsRequest.java
index 99d5221..1168591 100644
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleAddGroupsRequest.java
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleAddGroupsRequest.java
@@ -45,17 +45,13 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
     schemes.put(TupleScheme.class, new TAlterSentryRoleAddGroupsRequestTupleSchemeFactory());
   }
 
-  private TSentryServiceVersion protocol_version; // required
+  private int protocol_version; // required
   private String userName; // required
   private String roleName; // required
   private Set<TSentryGroup> groups; // 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 {
-    /**
-     * 
-     * @see TSentryServiceVersion
-     */
     PROTOCOL_VERSION((short)1, "protocol_version"),
     USER_NAME((short)2, "userName"),
     ROLE_NAME((short)3, "roleName"),
@@ -122,11 +118,13 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
   }
 
   // isset id assignments
+  private static final int __PROTOCOL_VERSION_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.PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("protocol_version", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TSentryServiceVersion.class)));
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.ROLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("roleName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
@@ -139,18 +137,19 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
   }
 
   public TAlterSentryRoleAddGroupsRequest() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
   }
 
   public TAlterSentryRoleAddGroupsRequest(
-    TSentryServiceVersion protocol_version,
+    int protocol_version,
     String userName,
     String roleName,
     Set<TSentryGroup> groups)
   {
     this();
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
     this.userName = userName;
     this.roleName = roleName;
     this.groups = groups;
@@ -160,9 +159,8 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
    * Performs a deep copy on <i>other</i>.
    */
   public TAlterSentryRoleAddGroupsRequest(TAlterSentryRoleAddGroupsRequest other) {
-    if (other.isSetProtocol_version()) {
-      this.protocol_version = other.protocol_version;
-    }
+    __isset_bitfield = other.__isset_bitfield;
+    this.protocol_version = other.protocol_version;
     if (other.isSetUserName()) {
       this.userName = other.userName;
     }
@@ -184,42 +182,33 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
 
   @Override
   public void clear() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
     this.userName = null;
     this.roleName = null;
     this.groups = null;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public TSentryServiceVersion getProtocol_version() {
+  public int getProtocol_version() {
     return this.protocol_version;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public void setProtocol_version(TSentryServiceVersion protocol_version) {
+  public void setProtocol_version(int protocol_version) {
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
   }
 
   public void unsetProtocol_version() {
-    this.protocol_version = null;
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   /** Returns true if field protocol_version is set (has been assigned a value) and false otherwise */
   public boolean isSetProtocol_version() {
-    return this.protocol_version != null;
+    return EncodingUtils.testBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   public void setProtocol_versionIsSet(boolean value) {
-    if (!value) {
-      this.protocol_version = null;
-    }
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID, value);
   }
 
   public String getUserName() {
@@ -312,7 +301,7 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
       if (value == null) {
         unsetProtocol_version();
       } else {
-        setProtocol_version((TSentryServiceVersion)value);
+        setProtocol_version((Integer)value);
       }
       break;
 
@@ -346,7 +335,7 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
   public Object getFieldValue(_Fields field) {
     switch (field) {
     case PROTOCOL_VERSION:
-      return getProtocol_version();
+      return Integer.valueOf(getProtocol_version());
 
     case USER_NAME:
       return getUserName();
@@ -393,12 +382,12 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
     if (that == null)
       return false;
 
-    boolean this_present_protocol_version = true && this.isSetProtocol_version();
-    boolean that_present_protocol_version = true && that.isSetProtocol_version();
+    boolean this_present_protocol_version = true;
+    boolean that_present_protocol_version = true;
     if (this_present_protocol_version || that_present_protocol_version) {
       if (!(this_present_protocol_version && that_present_protocol_version))
         return false;
-      if (!this.protocol_version.equals(that.protocol_version))
+      if (this.protocol_version != that.protocol_version)
         return false;
     }
 
@@ -436,10 +425,10 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
   public int hashCode() {
     HashCodeBuilder builder = new HashCodeBuilder();
 
-    boolean present_protocol_version = true && (isSetProtocol_version());
+    boolean present_protocol_version = true;
     builder.append(present_protocol_version);
     if (present_protocol_version)
-      builder.append(protocol_version.getValue());
+      builder.append(protocol_version);
 
     boolean present_userName = true && (isSetUserName());
     builder.append(present_userName);
@@ -528,11 +517,7 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
     boolean first = true;
 
     sb.append("protocol_version:");
-    if (this.protocol_version == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.protocol_version);
-    }
+    sb.append(this.protocol_version);
     first = false;
     if (!first) sb.append(", ");
     sb.append("userName:");
@@ -593,6 +578,8 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
 
   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);
@@ -619,7 +606,7 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
         switch (schemeField.id) {
           case 1: // PROTOCOL_VERSION
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+              struct.protocol_version = iprot.readI32();
               struct.setProtocol_versionIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -673,11 +660,9 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
       struct.validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.protocol_version != null) {
-        oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
-        oprot.writeI32(struct.protocol_version.getValue());
-        oprot.writeFieldEnd();
-      }
+      oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
+      oprot.writeI32(struct.protocol_version);
+      oprot.writeFieldEnd();
       if (struct.userName != null) {
         oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
         oprot.writeString(struct.userName);
@@ -717,7 +702,7 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, TAlterSentryRoleAddGroupsRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeI32(struct.protocol_version.getValue());
+      oprot.writeI32(struct.protocol_version);
       oprot.writeString(struct.userName);
       oprot.writeString(struct.roleName);
       {
@@ -732,7 +717,7 @@ public class TAlterSentryRoleAddGroupsRequest implements org.apache.thrift.TBase
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, TAlterSentryRoleAddGroupsRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+      struct.protocol_version = iprot.readI32();
       struct.setProtocol_versionIsSet(true);
       struct.userName = iprot.readString();
       struct.setUserNameIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleDeleteGroupsRequest.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleDeleteGroupsRequest.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleDeleteGroupsRequest.java
index 8932cee..e09d979 100644
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleDeleteGroupsRequest.java
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TAlterSentryRoleDeleteGroupsRequest.java
@@ -43,15 +43,11 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
     schemes.put(TupleScheme.class, new TAlterSentryRoleDeleteGroupsRequestTupleSchemeFactory());
   }
 
-  private TSentryServiceVersion protocol_version; // required
+  private int protocol_version; // required
   private String userName; // 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 {
-    /**
-     * 
-     * @see TSentryServiceVersion
-     */
     PROTOCOL_VERSION((short)1, "protocol_version"),
     USER_NAME((short)2, "userName");
 
@@ -112,11 +108,13 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
   }
 
   // isset id assignments
+  private static final int __PROTOCOL_VERSION_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.PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("protocol_version", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TSentryServiceVersion.class)));
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -124,16 +122,17 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
   }
 
   public TAlterSentryRoleDeleteGroupsRequest() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
   }
 
   public TAlterSentryRoleDeleteGroupsRequest(
-    TSentryServiceVersion protocol_version,
+    int protocol_version,
     String userName)
   {
     this();
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
     this.userName = userName;
   }
 
@@ -141,9 +140,8 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
    * Performs a deep copy on <i>other</i>.
    */
   public TAlterSentryRoleDeleteGroupsRequest(TAlterSentryRoleDeleteGroupsRequest other) {
-    if (other.isSetProtocol_version()) {
-      this.protocol_version = other.protocol_version;
-    }
+    __isset_bitfield = other.__isset_bitfield;
+    this.protocol_version = other.protocol_version;
     if (other.isSetUserName()) {
       this.userName = other.userName;
     }
@@ -155,40 +153,31 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
 
   @Override
   public void clear() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
     this.userName = null;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public TSentryServiceVersion getProtocol_version() {
+  public int getProtocol_version() {
     return this.protocol_version;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public void setProtocol_version(TSentryServiceVersion protocol_version) {
+  public void setProtocol_version(int protocol_version) {
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
   }
 
   public void unsetProtocol_version() {
-    this.protocol_version = null;
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   /** Returns true if field protocol_version is set (has been assigned a value) and false otherwise */
   public boolean isSetProtocol_version() {
-    return this.protocol_version != null;
+    return EncodingUtils.testBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   public void setProtocol_versionIsSet(boolean value) {
-    if (!value) {
-      this.protocol_version = null;
-    }
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID, value);
   }
 
   public String getUserName() {
@@ -220,7 +209,7 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
       if (value == null) {
         unsetProtocol_version();
       } else {
-        setProtocol_version((TSentryServiceVersion)value);
+        setProtocol_version((Integer)value);
       }
       break;
 
@@ -238,7 +227,7 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
   public Object getFieldValue(_Fields field) {
     switch (field) {
     case PROTOCOL_VERSION:
-      return getProtocol_version();
+      return Integer.valueOf(getProtocol_version());
 
     case USER_NAME:
       return getUserName();
@@ -275,12 +264,12 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
     if (that == null)
       return false;
 
-    boolean this_present_protocol_version = true && this.isSetProtocol_version();
-    boolean that_present_protocol_version = true && that.isSetProtocol_version();
+    boolean this_present_protocol_version = true;
+    boolean that_present_protocol_version = true;
     if (this_present_protocol_version || that_present_protocol_version) {
       if (!(this_present_protocol_version && that_present_protocol_version))
         return false;
-      if (!this.protocol_version.equals(that.protocol_version))
+      if (this.protocol_version != that.protocol_version)
         return false;
     }
 
@@ -300,10 +289,10 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
   public int hashCode() {
     HashCodeBuilder builder = new HashCodeBuilder();
 
-    boolean present_protocol_version = true && (isSetProtocol_version());
+    boolean present_protocol_version = true;
     builder.append(present_protocol_version);
     if (present_protocol_version)
-      builder.append(protocol_version.getValue());
+      builder.append(protocol_version);
 
     boolean present_userName = true && (isSetUserName());
     builder.append(present_userName);
@@ -362,11 +351,7 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
     boolean first = true;
 
     sb.append("protocol_version:");
-    if (this.protocol_version == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.protocol_version);
-    }
+    sb.append(this.protocol_version);
     first = false;
     if (!first) sb.append(", ");
     sb.append("userName:");
@@ -403,6 +388,8 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
 
   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);
@@ -429,7 +416,7 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
         switch (schemeField.id) {
           case 1: // PROTOCOL_VERSION
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+              struct.protocol_version = iprot.readI32();
               struct.setProtocol_versionIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -456,11 +443,9 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
       struct.validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.protocol_version != null) {
-        oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
-        oprot.writeI32(struct.protocol_version.getValue());
-        oprot.writeFieldEnd();
-      }
+      oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
+      oprot.writeI32(struct.protocol_version);
+      oprot.writeFieldEnd();
       if (struct.userName != null) {
         oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
         oprot.writeString(struct.userName);
@@ -483,14 +468,14 @@ public class TAlterSentryRoleDeleteGroupsRequest implements org.apache.thrift.TB
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, TAlterSentryRoleDeleteGroupsRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeI32(struct.protocol_version.getValue());
+      oprot.writeI32(struct.protocol_version);
       oprot.writeString(struct.userName);
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, TAlterSentryRoleDeleteGroupsRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+      struct.protocol_version = iprot.readI32();
       struct.setProtocol_versionIsSet(true);
       struct.userName = iprot.readString();
       struct.setUserNameIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryPrivilegeRequest.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryPrivilegeRequest.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryPrivilegeRequest.java
index 8c3f857..671c9ba 100644
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryPrivilegeRequest.java
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryPrivilegeRequest.java
@@ -44,16 +44,12 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
     schemes.put(TupleScheme.class, new TCreateSentryPrivilegeRequestTupleSchemeFactory());
   }
 
-  private TSentryServiceVersion protocol_version; // required
+  private int protocol_version; // required
   private String userName; // required
   private TSentryPrivilege privilege; // 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 {
-    /**
-     * 
-     * @see TSentryServiceVersion
-     */
     PROTOCOL_VERSION((short)1, "protocol_version"),
     USER_NAME((short)2, "userName"),
     PRIVILEGE((short)3, "privilege");
@@ -117,11 +113,13 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
   }
 
   // isset id assignments
+  private static final int __PROTOCOL_VERSION_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.PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("protocol_version", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TSentryServiceVersion.class)));
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.PRIVILEGE, new org.apache.thrift.meta_data.FieldMetaData("privilege", org.apache.thrift.TFieldRequirementType.REQUIRED, 
@@ -131,17 +129,18 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
   }
 
   public TCreateSentryPrivilegeRequest() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
   }
 
   public TCreateSentryPrivilegeRequest(
-    TSentryServiceVersion protocol_version,
+    int protocol_version,
     String userName,
     TSentryPrivilege privilege)
   {
     this();
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
     this.userName = userName;
     this.privilege = privilege;
   }
@@ -150,9 +149,8 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
    * Performs a deep copy on <i>other</i>.
    */
   public TCreateSentryPrivilegeRequest(TCreateSentryPrivilegeRequest other) {
-    if (other.isSetProtocol_version()) {
-      this.protocol_version = other.protocol_version;
-    }
+    __isset_bitfield = other.__isset_bitfield;
+    this.protocol_version = other.protocol_version;
     if (other.isSetUserName()) {
       this.userName = other.userName;
     }
@@ -167,41 +165,32 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
 
   @Override
   public void clear() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
     this.userName = null;
     this.privilege = null;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public TSentryServiceVersion getProtocol_version() {
+  public int getProtocol_version() {
     return this.protocol_version;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public void setProtocol_version(TSentryServiceVersion protocol_version) {
+  public void setProtocol_version(int protocol_version) {
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
   }
 
   public void unsetProtocol_version() {
-    this.protocol_version = null;
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   /** Returns true if field protocol_version is set (has been assigned a value) and false otherwise */
   public boolean isSetProtocol_version() {
-    return this.protocol_version != null;
+    return EncodingUtils.testBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   public void setProtocol_versionIsSet(boolean value) {
-    if (!value) {
-      this.protocol_version = null;
-    }
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID, value);
   }
 
   public String getUserName() {
@@ -256,7 +245,7 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
       if (value == null) {
         unsetProtocol_version();
       } else {
-        setProtocol_version((TSentryServiceVersion)value);
+        setProtocol_version((Integer)value);
       }
       break;
 
@@ -282,7 +271,7 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
   public Object getFieldValue(_Fields field) {
     switch (field) {
     case PROTOCOL_VERSION:
-      return getProtocol_version();
+      return Integer.valueOf(getProtocol_version());
 
     case USER_NAME:
       return getUserName();
@@ -324,12 +313,12 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
     if (that == null)
       return false;
 
-    boolean this_present_protocol_version = true && this.isSetProtocol_version();
-    boolean that_present_protocol_version = true && that.isSetProtocol_version();
+    boolean this_present_protocol_version = true;
+    boolean that_present_protocol_version = true;
     if (this_present_protocol_version || that_present_protocol_version) {
       if (!(this_present_protocol_version && that_present_protocol_version))
         return false;
-      if (!this.protocol_version.equals(that.protocol_version))
+      if (this.protocol_version != that.protocol_version)
         return false;
     }
 
@@ -358,10 +347,10 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
   public int hashCode() {
     HashCodeBuilder builder = new HashCodeBuilder();
 
-    boolean present_protocol_version = true && (isSetProtocol_version());
+    boolean present_protocol_version = true;
     builder.append(present_protocol_version);
     if (present_protocol_version)
-      builder.append(protocol_version.getValue());
+      builder.append(protocol_version);
 
     boolean present_userName = true && (isSetUserName());
     builder.append(present_userName);
@@ -435,11 +424,7 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
     boolean first = true;
 
     sb.append("protocol_version:");
-    if (this.protocol_version == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.protocol_version);
-    }
+    sb.append(this.protocol_version);
     first = false;
     if (!first) sb.append(", ");
     sb.append("userName:");
@@ -491,6 +476,8 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
 
   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);
@@ -517,7 +504,7 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
         switch (schemeField.id) {
           case 1: // PROTOCOL_VERSION
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+              struct.protocol_version = iprot.readI32();
               struct.setProtocol_versionIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -553,11 +540,9 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
       struct.validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.protocol_version != null) {
-        oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
-        oprot.writeI32(struct.protocol_version.getValue());
-        oprot.writeFieldEnd();
-      }
+      oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
+      oprot.writeI32(struct.protocol_version);
+      oprot.writeFieldEnd();
       if (struct.userName != null) {
         oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
         oprot.writeString(struct.userName);
@@ -585,7 +570,7 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, TCreateSentryPrivilegeRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeI32(struct.protocol_version.getValue());
+      oprot.writeI32(struct.protocol_version);
       oprot.writeString(struct.userName);
       struct.privilege.write(oprot);
     }
@@ -593,7 +578,7 @@ public class TCreateSentryPrivilegeRequest implements org.apache.thrift.TBase<TC
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, TCreateSentryPrivilegeRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+      struct.protocol_version = iprot.readI32();
       struct.setProtocol_versionIsSet(true);
       struct.userName = iprot.readString();
       struct.setUserNameIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryRoleRequest.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryRoleRequest.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryRoleRequest.java
index 7548661..da661bb 100644
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryRoleRequest.java
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TCreateSentryRoleRequest.java
@@ -44,16 +44,12 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
     schemes.put(TupleScheme.class, new TCreateSentryRoleRequestTupleSchemeFactory());
   }
 
-  private TSentryServiceVersion protocol_version; // required
+  private int protocol_version; // required
   private String userName; // required
   private TSentryRole role; // 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 {
-    /**
-     * 
-     * @see TSentryServiceVersion
-     */
     PROTOCOL_VERSION((short)1, "protocol_version"),
     USER_NAME((short)2, "userName"),
     ROLE((short)3, "role");
@@ -117,11 +113,13 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
   }
 
   // isset id assignments
+  private static final int __PROTOCOL_VERSION_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.PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("protocol_version", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TSentryServiceVersion.class)));
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.REQUIRED, 
@@ -131,17 +129,18 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
   }
 
   public TCreateSentryRoleRequest() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
   }
 
   public TCreateSentryRoleRequest(
-    TSentryServiceVersion protocol_version,
+    int protocol_version,
     String userName,
     TSentryRole role)
   {
     this();
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
     this.userName = userName;
     this.role = role;
   }
@@ -150,9 +149,8 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
    * Performs a deep copy on <i>other</i>.
    */
   public TCreateSentryRoleRequest(TCreateSentryRoleRequest other) {
-    if (other.isSetProtocol_version()) {
-      this.protocol_version = other.protocol_version;
-    }
+    __isset_bitfield = other.__isset_bitfield;
+    this.protocol_version = other.protocol_version;
     if (other.isSetUserName()) {
       this.userName = other.userName;
     }
@@ -167,41 +165,32 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
 
   @Override
   public void clear() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
     this.userName = null;
     this.role = null;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public TSentryServiceVersion getProtocol_version() {
+  public int getProtocol_version() {
     return this.protocol_version;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public void setProtocol_version(TSentryServiceVersion protocol_version) {
+  public void setProtocol_version(int protocol_version) {
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
   }
 
   public void unsetProtocol_version() {
-    this.protocol_version = null;
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   /** Returns true if field protocol_version is set (has been assigned a value) and false otherwise */
   public boolean isSetProtocol_version() {
-    return this.protocol_version != null;
+    return EncodingUtils.testBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   public void setProtocol_versionIsSet(boolean value) {
-    if (!value) {
-      this.protocol_version = null;
-    }
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID, value);
   }
 
   public String getUserName() {
@@ -256,7 +245,7 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
       if (value == null) {
         unsetProtocol_version();
       } else {
-        setProtocol_version((TSentryServiceVersion)value);
+        setProtocol_version((Integer)value);
       }
       break;
 
@@ -282,7 +271,7 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
   public Object getFieldValue(_Fields field) {
     switch (field) {
     case PROTOCOL_VERSION:
-      return getProtocol_version();
+      return Integer.valueOf(getProtocol_version());
 
     case USER_NAME:
       return getUserName();
@@ -324,12 +313,12 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
     if (that == null)
       return false;
 
-    boolean this_present_protocol_version = true && this.isSetProtocol_version();
-    boolean that_present_protocol_version = true && that.isSetProtocol_version();
+    boolean this_present_protocol_version = true;
+    boolean that_present_protocol_version = true;
     if (this_present_protocol_version || that_present_protocol_version) {
       if (!(this_present_protocol_version && that_present_protocol_version))
         return false;
-      if (!this.protocol_version.equals(that.protocol_version))
+      if (this.protocol_version != that.protocol_version)
         return false;
     }
 
@@ -358,10 +347,10 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
   public int hashCode() {
     HashCodeBuilder builder = new HashCodeBuilder();
 
-    boolean present_protocol_version = true && (isSetProtocol_version());
+    boolean present_protocol_version = true;
     builder.append(present_protocol_version);
     if (present_protocol_version)
-      builder.append(protocol_version.getValue());
+      builder.append(protocol_version);
 
     boolean present_userName = true && (isSetUserName());
     builder.append(present_userName);
@@ -435,11 +424,7 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
     boolean first = true;
 
     sb.append("protocol_version:");
-    if (this.protocol_version == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.protocol_version);
-    }
+    sb.append(this.protocol_version);
     first = false;
     if (!first) sb.append(", ");
     sb.append("userName:");
@@ -491,6 +476,8 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
 
   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);
@@ -517,7 +504,7 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
         switch (schemeField.id) {
           case 1: // PROTOCOL_VERSION
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+              struct.protocol_version = iprot.readI32();
               struct.setProtocol_versionIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -553,11 +540,9 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
       struct.validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.protocol_version != null) {
-        oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
-        oprot.writeI32(struct.protocol_version.getValue());
-        oprot.writeFieldEnd();
-      }
+      oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
+      oprot.writeI32(struct.protocol_version);
+      oprot.writeFieldEnd();
       if (struct.userName != null) {
         oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
         oprot.writeString(struct.userName);
@@ -585,7 +570,7 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, TCreateSentryRoleRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeI32(struct.protocol_version.getValue());
+      oprot.writeI32(struct.protocol_version);
       oprot.writeString(struct.userName);
       struct.role.write(oprot);
     }
@@ -593,7 +578,7 @@ public class TCreateSentryRoleRequest implements org.apache.thrift.TBase<TCreate
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, TCreateSentryRoleRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+      struct.protocol_version = iprot.readI32();
       struct.setProtocol_versionIsSet(true);
       struct.userName = iprot.readString();
       struct.setUserNameIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TListSentryRolesRequest.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TListSentryRolesRequest.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TListSentryRolesRequest.java
index e643292..a98ddcd 100644
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TListSentryRolesRequest.java
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TListSentryRolesRequest.java
@@ -45,17 +45,13 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
     schemes.put(TupleScheme.class, new TListSentryRolesRequestTupleSchemeFactory());
   }
 
-  private TSentryServiceVersion protocol_version; // required
+  private int protocol_version; // required
   private String userName; // required
   private String groupName; // optional
   private String roleName; // 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 {
-    /**
-     * 
-     * @see TSentryServiceVersion
-     */
     PROTOCOL_VERSION((short)1, "protocol_version"),
     USER_NAME((short)2, "userName"),
     GROUP_NAME((short)3, "groupName"),
@@ -122,12 +118,14 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
   }
 
   // isset id assignments
+  private static final int __PROTOCOL_VERSION_ISSET_ID = 0;
+  private byte __isset_bitfield = 0;
   private _Fields optionals[] = {_Fields.GROUP_NAME,_Fields.ROLE_NAME};
   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.PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("protocol_version", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TSentryServiceVersion.class)));
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.GROUP_NAME, new org.apache.thrift.meta_data.FieldMetaData("groupName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
@@ -139,16 +137,17 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
   }
 
   public TListSentryRolesRequest() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
   }
 
   public TListSentryRolesRequest(
-    TSentryServiceVersion protocol_version,
+    int protocol_version,
     String userName)
   {
     this();
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
     this.userName = userName;
   }
 
@@ -156,9 +155,8 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
    * Performs a deep copy on <i>other</i>.
    */
   public TListSentryRolesRequest(TListSentryRolesRequest other) {
-    if (other.isSetProtocol_version()) {
-      this.protocol_version = other.protocol_version;
-    }
+    __isset_bitfield = other.__isset_bitfield;
+    this.protocol_version = other.protocol_version;
     if (other.isSetUserName()) {
       this.userName = other.userName;
     }
@@ -176,42 +174,33 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
 
   @Override
   public void clear() {
-    this.protocol_version = org.apache.sentry.service.api.TSentryServiceVersion.V1;
+    this.protocol_version = 1;
 
     this.userName = null;
     this.groupName = null;
     this.roleName = null;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public TSentryServiceVersion getProtocol_version() {
+  public int getProtocol_version() {
     return this.protocol_version;
   }
 
-  /**
-   * 
-   * @see TSentryServiceVersion
-   */
-  public void setProtocol_version(TSentryServiceVersion protocol_version) {
+  public void setProtocol_version(int protocol_version) {
     this.protocol_version = protocol_version;
+    setProtocol_versionIsSet(true);
   }
 
   public void unsetProtocol_version() {
-    this.protocol_version = null;
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   /** Returns true if field protocol_version is set (has been assigned a value) and false otherwise */
   public boolean isSetProtocol_version() {
-    return this.protocol_version != null;
+    return EncodingUtils.testBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
   }
 
   public void setProtocol_versionIsSet(boolean value) {
-    if (!value) {
-      this.protocol_version = null;
-    }
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID, value);
   }
 
   public String getUserName() {
@@ -289,7 +278,7 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
       if (value == null) {
         unsetProtocol_version();
       } else {
-        setProtocol_version((TSentryServiceVersion)value);
+        setProtocol_version((Integer)value);
       }
       break;
 
@@ -323,7 +312,7 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
   public Object getFieldValue(_Fields field) {
     switch (field) {
     case PROTOCOL_VERSION:
-      return getProtocol_version();
+      return Integer.valueOf(getProtocol_version());
 
     case USER_NAME:
       return getUserName();
@@ -370,12 +359,12 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
     if (that == null)
       return false;
 
-    boolean this_present_protocol_version = true && this.isSetProtocol_version();
-    boolean that_present_protocol_version = true && that.isSetProtocol_version();
+    boolean this_present_protocol_version = true;
+    boolean that_present_protocol_version = true;
     if (this_present_protocol_version || that_present_protocol_version) {
       if (!(this_present_protocol_version && that_present_protocol_version))
         return false;
-      if (!this.protocol_version.equals(that.protocol_version))
+      if (this.protocol_version != that.protocol_version)
         return false;
     }
 
@@ -413,10 +402,10 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
   public int hashCode() {
     HashCodeBuilder builder = new HashCodeBuilder();
 
-    boolean present_protocol_version = true && (isSetProtocol_version());
+    boolean present_protocol_version = true;
     builder.append(present_protocol_version);
     if (present_protocol_version)
-      builder.append(protocol_version.getValue());
+      builder.append(protocol_version);
 
     boolean present_userName = true && (isSetUserName());
     builder.append(present_userName);
@@ -505,11 +494,7 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
     boolean first = true;
 
     sb.append("protocol_version:");
-    if (this.protocol_version == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.protocol_version);
-    }
+    sb.append(this.protocol_version);
     first = false;
     if (!first) sb.append(", ");
     sb.append("userName:");
@@ -566,6 +551,8 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
 
   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);
@@ -592,7 +579,7 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
         switch (schemeField.id) {
           case 1: // PROTOCOL_VERSION
             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
-              struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+              struct.protocol_version = iprot.readI32();
               struct.setProtocol_versionIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -635,11 +622,9 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
       struct.validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.protocol_version != null) {
-        oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
-        oprot.writeI32(struct.protocol_version.getValue());
-        oprot.writeFieldEnd();
-      }
+      oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
+      oprot.writeI32(struct.protocol_version);
+      oprot.writeFieldEnd();
       if (struct.userName != null) {
         oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
         oprot.writeString(struct.userName);
@@ -676,7 +661,7 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, TListSentryRolesRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol oprot = (TTupleProtocol) prot;
-      oprot.writeI32(struct.protocol_version.getValue());
+      oprot.writeI32(struct.protocol_version);
       oprot.writeString(struct.userName);
       BitSet optionals = new BitSet();
       if (struct.isSetGroupName()) {
@@ -697,7 +682,7 @@ public class TListSentryRolesRequest implements org.apache.thrift.TBase<TListSen
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, TListSentryRolesRequest struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      struct.protocol_version = TSentryServiceVersion.findByValue(iprot.readI32());
+      struct.protocol_version = iprot.readI32();
       struct.setProtocol_versionIsSet(true);
       struct.userName = iprot.readString();
       struct.setUserNameIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TSentryServiceVersion.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TSentryServiceVersion.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TSentryServiceVersion.java
deleted file mode 100644
index debcde2..0000000
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/TSentryServiceVersion.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * 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.service.api;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum TSentryServiceVersion implements org.apache.thrift.TEnum {
-  V1(0);
-
-  private final int value;
-
-  private TSentryServiceVersion(int value) {
-    this.value = value;
-  }
-
-  /**
-   * Get the integer value of this enum value, as defined in the Thrift IDL.
-   */
-  public int getValue() {
-    return value;
-  }
-
-  /**
-   * Find a the enum type by its integer value, as defined in the Thrift IDL.
-   * @return null if the value is not found.
-   */
-  public static TSentryServiceVersion findByValue(int value) { 
-    switch (value) {
-      case 0:
-        return V1;
-      default:
-        return null;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/sentry_storeConstants.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/sentry_storeConstants.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/sentry_storeConstants.java
new file mode 100644
index 0000000..440d22b
--- /dev/null
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/service/api/sentry_storeConstants.java
@@ -0,0 +1,38 @@
+/**
+ * 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.service.api;
+
+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 sentry_storeConstants {
+
+  public static final int TSENTRY_SERVICE_V1 = 1;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/Constants.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/Constants.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/Constants.java
index 62f7e4e..51b1827 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/Constants.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/Constants.java
@@ -21,7 +21,6 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.security.sasl.Sasl;
-
 import com.google.common.collect.ImmutableMap;
 
 public class Constants {
@@ -61,4 +60,10 @@ public class Constants {
     public static final int SERVER_RPC_CONN_TIMEOUT_DEFAULT = 200000;
   }
 
+  /**
+   * Thrift generates terrible constant class names
+   */
+  public static class ThriftConstants extends org.apache.sentry.service.api.sentry_storeConstants {
+    public static final int TSENTRY_SERVICE_VERSION_CURRENT = TSENTRY_SERVICE_V1;
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1e80802a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/sentry_store.thrift
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/sentry_store.thrift b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/sentry_store.thrift
index 9729fa4..ba8406d 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/sentry_store.thrift
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/sentry_store.thrift
@@ -28,9 +28,8 @@ namespace java org.apache.sentry.service.api
 namespace php sentryservice
 namespace cpp Apache.Sentry
 
-enum TSentryServiceVersion {
-V1
-}
+
+const i32 TSENTRY_SERVICE_V1 = 1;
 
 enum TSentryStatus {
 OK,
@@ -70,7 +69,7 @@ struct TSentryGroup {
 }
 
 struct TCreateSentryRoleRequest {
-1: required TSentryServiceVersion protocol_version = TSentryServiceVersion.V1,
+1: required i32 protocol_version = TSENTRY_SERVICE_V1,
 2: required string userName,
 3: required TSentryRole role
 }
@@ -79,7 +78,7 @@ struct TCreateSentryRoleResponse {
 }
 
 struct TCreateSentryPrivilegeRequest {
-1: required TSentryServiceVersion protocol_version = TSentryServiceVersion.V1,
+1: required i32 protocol_version = TSENTRY_SERVICE_V1,
 2: required string userName,
 3: required TSentryPrivilege privilege
 }
@@ -88,7 +87,7 @@ struct TCreateSentryPrivilegeResponse {
 }
 
 struct TCreateSentryPrivilegeRequest {
-1: required TSentryServiceVersion protocol_version = TSentryServiceVersion.V1,
+1: required i32 protocol_version = TSENTRY_SERVICE_V1,
 2: required string userName,
 3: required TSentryPrivilege privilege
 }
@@ -97,7 +96,7 @@ struct TCreateSentryPrivilegeResponse {
 }
 
 struct TAlterSentryRoleAddGroupsRequest {
-1: required TSentryServiceVersion protocol_version = TSentryServiceVersion.V1,
+1: required i32 protocol_version = TSENTRY_SERVICE_V1,
 2: required string userName,
 3: required string roleName,
 4: required set<TSentryGroup> groups
@@ -107,7 +106,7 @@ struct TAlterSentryRoleAddGroupsResponse {
 }
 
 struct TAlterSentryRoleDeleteGroupsRequest {
-1: required TSentryServiceVersion protocol_version = TSentryServiceVersion.V1,
+1: required i32 protocol_version = TSENTRY_SERVICE_V1,
 2: required string userName,
 }
 struct TAlterSentryRoleDeleteGroupsResponse {
@@ -115,7 +114,7 @@ struct TAlterSentryRoleDeleteGroupsResponse {
 }
 
 struct TListSentryRolesRequest {
-1: required TSentryServiceVersion protocol_version = TSentryServiceVersion.V1,
+1: required i32 protocol_version = TSENTRY_SERVICE_V1,
 2: required string userName,
 3: optional string groupName,
 4: optional string roleName


Mime
View raw message