You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by sr...@apache.org on 2015/12/17 07:44:16 UTC

[1/3] incubator-sentry git commit: SENTRY-953: External Partitions which are referenced by more than one table can cause some unexpected behavior with Sentry HDFS sync ( Hao Hao, Reviewed by: Sravya Tirukkovalur)

Repository: incubator-sentry
Updated Branches:
  refs/heads/master 9fe720232 -> 4b33ad929


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryAuthorizationInfo.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryAuthorizationInfo.java b/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryAuthorizationInfo.java
index c9accc1..c8d56be 100644
--- a/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryAuthorizationInfo.java
+++ b/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryAuthorizationInfo.java
@@ -17,9 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ThreadFactory;
@@ -126,6 +124,7 @@ public class SentryAuthorizationInfo implements Runnable {
   }
 
   private boolean update() {
+    //Looks like getting same updates multiple times
     SentryAuthzUpdate updates = updater.getUpdates();
     // Updates can be null if Sentry Service is un-reachable
     if (updates != null) {
@@ -274,13 +273,24 @@ public class SentryAuthorizationInfo implements Runnable {
   public List<AclEntry> getAclEntries(String[] pathElements) {
     lock.readLock().lock();
     try {
-      String authzObj = authzPaths.findAuthzObject(pathElements);
+      Set<String> authzObjs = authzPaths.findAuthzObject(pathElements);
       // Apparently setFAcl throws error if 'group::---' is not present
       AclEntry noGroup = AclEntry.parseAclEntry("group::---", true);
-      ArrayList<AclEntry> retList = Lists.newArrayList(noGroup);
-      retList.addAll((authzObj != null) ? authzPermissions.getAcls(authzObj)
-          : Collections.EMPTY_LIST);
-      return retList;
+
+      Set<AclEntry> retSet = new HashSet<AclEntry>();
+      retSet.add(noGroup);
+
+      if (authzObjs == null) {
+        retSet.addAll(Collections.EMPTY_LIST);
+        return new ArrayList<AclEntry>(retSet);
+      }
+
+      // No duplicate acls should be added.
+      for (String authzObj: authzObjs) {
+        retSet.addAll(authzPermissions.getAcls(authzObj));
+      }
+
+      return new ArrayList<AclEntry>(retSet);
     } finally {
       lock.readLock().unlock();
     }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryPermissions.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryPermissions.java b/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryPermissions.java
index 2c50ea9..daa87cf 100644
--- a/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryPermissions.java
+++ b/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/SentryPermissions.java
@@ -17,13 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 import org.apache.hadoop.fs.permission.AclEntry;
 import org.apache.hadoop.fs.permission.AclEntryScope;
@@ -79,9 +73,12 @@ public class SentryPermissions implements AuthzPermissions {
     }
   }
 
-  private final Map<String, PrivilegeInfo> privileges = new HashMap<String, PrivilegeInfo>();
+  // Comparison of authorizable object should be case insensitive.
+  private final Map<String, PrivilegeInfo> privileges = new TreeMap<String, PrivilegeInfo>(String.CASE_INSENSITIVE_ORDER);
+  private Map<String, Set<String>> authzObjChildren = new TreeMap<String, Set<String>>(String.CASE_INSENSITIVE_ORDER);
+
+  // Should the comparison of role be case insensitive?
   private final Map<String, RoleInfo> roles = new HashMap<String, RoleInfo>();
-  private Map<String, Set<String>> authzObjChildren = new HashMap<String, Set<String>>();
 
   String getParentAuthzObject(String authzObject) {
     int dot = authzObject.indexOf('.');

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-service/src/test/java/org/apache/sentry/hdfs/TestMetastoreCacheInitializer.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/test/java/org/apache/sentry/hdfs/TestMetastoreCacheInitializer.java b/sentry-hdfs/sentry-hdfs-service/src/test/java/org/apache/sentry/hdfs/TestMetastoreCacheInitializer.java
index 437ba94..2c9e19d 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/test/java/org/apache/sentry/hdfs/TestMetastoreCacheInitializer.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/test/java/org/apache/sentry/hdfs/TestMetastoreCacheInitializer.java
@@ -29,6 +29,8 @@ import org.junit.Test;
 import org.mockito.Mockito;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 
 public class TestMetastoreCacheInitializer {
 
@@ -113,19 +115,19 @@ public class TestMetastoreCacheInitializer {
             MetastoreCacheInitializer(hmsHandler, conf);
     UpdateableAuthzPaths update = cacheInitializer.createInitialUpdate();
 
-    Assert.assertEquals("db1", update.findAuthzObjectExactMatch(new
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1")), update.findAuthzObjectExactMatches(new
             String[]{"db1"}));
-    Assert.assertEquals("db2", update.findAuthzObjectExactMatch(new
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db2")), update.findAuthzObjectExactMatches(new
             String[]{"db2"}));
-    Assert.assertEquals("db2.tab21", update.findAuthzObjectExactMatch(new
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db2.tab21")), update.findAuthzObjectExactMatches(new
             String[]{"db2", "tab21"}));
-    Assert.assertEquals("db3", update.findAuthzObjectExactMatch(new
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db3")), update.findAuthzObjectExactMatches(new
             String[]{"db3"}));
-    Assert.assertEquals("db3.tab31", update.findAuthzObjectExactMatch(new
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db3.tab31")), update.findAuthzObjectExactMatches(new
             String[]{"db3", "tab31"}));
-    Assert.assertEquals("db3.tab31", update.findAuthzObjectExactMatch(new
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db3.tab31")), update.findAuthzObjectExactMatches(new
             String[]{"db3", "tab31", "part311"}));
-    Assert.assertEquals("db3.tab31", update.findAuthzObjectExactMatch(new
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db3.tab31")), update.findAuthzObjectExactMatches(new
             String[]{"db3", "tab31", "part312"}));
     cacheInitializer.close();
 

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
index 208c93b..5a93ba0 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java
@@ -76,8 +76,8 @@ import org.apache.hadoop.mapred.TextOutputFormat;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.sentry.binding.hive.SentryHiveAuthorizationTaskFactoryImpl;
 import org.apache.sentry.binding.hive.conf.HiveAuthzConf;
-import org.apache.sentry.hdfs.SentryAuthorizationConstants;
 import org.apache.sentry.hdfs.SentryAuthorizationProvider;
+import org.apache.sentry.provider.db.SentryAlreadyExistsException;
 import org.apache.sentry.provider.db.SimpleDBProviderBackend;
 import org.apache.sentry.provider.file.LocalGroupResourceAuthorizationProvider;
 import org.apache.sentry.provider.file.PolicyFile;
@@ -1124,6 +1124,203 @@ public class TestHDFSIntegration {
     conn.close();
   }
 
+  /* SENTRY-953 */
+  @Test
+  public void testAuthzObjOnPartitionMultipleTables() throws Throwable {
+    String dbName = "db1";
+
+    tmpHDFSDir = new Path("/tmp/external");
+    miniDFS.getFileSystem().mkdirs(tmpHDFSDir);
+    Path partitionDir = new Path("/tmp/external/p1");
+    miniDFS.getFileSystem().mkdirs(partitionDir);
+
+    dbNames = new String[]{dbName};
+    roles = new String[]{"admin_role", "tab1_role", "tab2_role", "tab3_role"};
+    admin = StaticUserGroup.ADMIN1;
+
+    Connection conn;
+    Statement stmt;
+
+    conn = hiveServer2.createConnection("hive", "hive");
+    stmt = conn.createStatement();
+
+    stmt.execute("create role admin_role");
+    stmt.execute("grant all on server server1 to role admin_role");
+    stmt.execute("grant role admin_role to group " + StaticUserGroup.ADMINGROUP);
+
+    // Create external table tab1 on location '/tmp/external/p1'.
+    // Create tab1_role, and grant it with insert permission on table tab1 to user_group1.
+    conn = hiveServer2.createConnection(StaticUserGroup.ADMIN1, StaticUserGroup.ADMIN1);
+    stmt = conn.createStatement();
+    stmt.execute("create database " + dbName);
+    stmt.execute("use " + dbName);
+    stmt.execute("create external table tab1 (s string) partitioned by (month int) location '/tmp/external/p1'");
+    stmt.execute("create role tab1_role");
+    stmt.execute("grant insert on table tab1 to role tab1_role");
+    stmt.execute("grant role tab1_role to group " + StaticUserGroup.USERGROUP1);
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+
+    // Verify that user_group1 has insert(write_execute) permission on '/tmp/external/p1'.
+    verifyOnAllSubDirs("/tmp/external/p1", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP1, true);
+
+    // Create external table tab2 and partition on location '/tmp/external'.
+    // Create tab2_role, and grant it with select permission on table tab2 to user_group2.
+    stmt.execute("create external table tab2 (s string) partitioned by (month int)");
+    stmt.execute("alter table tab2 add partition (month = 1) location '/tmp/external'");
+    stmt.execute("create role tab2_role");
+    stmt.execute("grant select on table tab2 to role tab2_role");
+    stmt.execute("grant role tab2_role to group " + StaticUserGroup.USERGROUP2);
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+
+    // Verify that user_group2 have select(read_execute) permission on both paths.
+    verifyOnAllSubDirs("/user/hive/warehouse/" + dbName + ".db/tab2", FsAction.READ_EXECUTE, StaticUserGroup.USERGROUP2, true);
+    verifyOnPath("/tmp/external", FsAction.READ_EXECUTE, StaticUserGroup.USERGROUP2, true);
+
+    // Create table tab3 and partition on the same location '/tmp/external' as tab2.
+    // Create tab3_role, and grant it with insert permission on table tab3 to user_group3.
+    stmt.execute("create table tab3 (s string) partitioned by (month int)");
+    stmt.execute("alter table tab3 add partition (month = 1) location '/tmp/external'");
+    stmt.execute("create role tab3_role");
+    stmt.execute("grant insert on table tab3 to role tab3_role");
+    stmt.execute("grant role tab3_role to group " + StaticUserGroup.USERGROUP3);
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+
+    // When two partitions of different tables pointing to the same location with different grants,
+    // ACLs should have union (no duplicates) of both rules.
+    verifyOnAllSubDirs("/user/hive/warehouse/" + dbName + ".db/tab3", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP3, true);
+    verifyOnPath("/tmp/external", FsAction.READ_EXECUTE, StaticUserGroup.USERGROUP2, true);
+    verifyOnPath("/tmp/external", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP3, true);
+
+    // When alter the table name (tab2 to be tabx), ACLs should remain the same.
+    stmt.execute("alter table tab2 rename to tabx");
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+    verifyOnPath("/tmp/external", FsAction.READ_EXECUTE, StaticUserGroup.USERGROUP2, true);
+    verifyOnPath("/tmp/external", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP3, true);
+
+    // When drop a partition that shares the same location with other partition belonging to
+    // other table, should still have the other table permissions.
+    stmt.execute("ALTER TABLE tabx DROP PARTITION (month = 1)");
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+    verifyOnAllSubDirs("/user/hive/warehouse/" + dbName + ".db/tab3", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP3, true);
+    verifyOnPath("/tmp/external", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP3, true);
+
+    // When drop a table that has a partition shares the same location with other partition
+    // belonging to other table, should still have the other table permissions.
+    stmt.execute("DROP TABLE IF EXISTS tabx");
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+    verifyOnAllSubDirs("/user/hive/warehouse/" + dbName + ".db/tab3", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP3, true);
+    verifyOnPath("/tmp/external", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP3, true);
+
+    stmt.close();
+    conn.close();
+
+    miniDFS.getFileSystem().delete(partitionDir, true);
+  }
+
+  /* SENTRY-953 */
+  @Test
+  public void testAuthzObjOnPartitionSameTable() throws Throwable {
+    String dbName = "db1";
+
+    tmpHDFSDir = new Path("/tmp/external/p1");
+    miniDFS.getFileSystem().mkdirs(tmpHDFSDir);
+
+    dbNames = new String[]{dbName};
+    roles = new String[]{"admin_role", "tab1_role"};
+    admin = StaticUserGroup.ADMIN1;
+
+    Connection conn;
+    Statement stmt;
+
+    conn = hiveServer2.createConnection("hive", "hive");
+    stmt = conn.createStatement();
+
+    stmt.execute("create role admin_role");
+    stmt.execute("grant all on server server1 to role admin_role");
+    stmt.execute("grant role admin_role to group " + StaticUserGroup.ADMINGROUP);
+
+    // Create table tab1 and partition on the same location '/tmp/external/p1'.
+    // Create tab1_role, and grant it with insert permission on table tab1 to user_group1.
+    conn = hiveServer2.createConnection(StaticUserGroup.ADMIN1, StaticUserGroup.ADMIN1);
+    stmt = conn.createStatement();
+    stmt.execute("create database " + dbName);
+    stmt.execute("use " + dbName);
+    stmt.execute("create table tab1 (s string) partitioned by (month int)");
+    stmt.execute("alter table tab1 add partition (month = 1) location '/tmp/external/p1'");
+    stmt.execute("create role tab1_role");
+    stmt.execute("grant insert on table tab1 to role tab1_role");
+    stmt.execute("grant role tab1_role to group " + StaticUserGroup.USERGROUP1);
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+
+    // Verify that user_group1 has insert(write_execute) permission on '/tmp/external/p1'.
+    verifyOnAllSubDirs("/tmp/external/p1", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP1, true);
+
+    // When two partitions of the same table pointing to the same location,
+    // ACLS should not be repeated. Exception will be thrown if there are duplicates.
+    stmt.execute("alter table tab1 add partition (month = 2) location '/tmp/external/p1'");
+    verifyOnPath("/tmp/external/p1", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP1, true);
+
+    stmt.close();
+    conn.close();
+  }
+
+  /* SENTRY-953 */
+  @Test
+  public void testAuthzObjOnMultipleTables() throws Throwable {
+    String dbName = "db1";
+
+    tmpHDFSDir = new Path("/tmp/external/p1");
+    miniDFS.getFileSystem().mkdirs(tmpHDFSDir);
+
+    dbNames = new String[]{dbName};
+    roles = new String[]{"admin_role", "tab1_role", "tab2_role"};
+    admin = StaticUserGroup.ADMIN1;
+
+    Connection conn;
+    Statement stmt;
+
+    conn = hiveServer2.createConnection("hive", "hive");
+    stmt = conn.createStatement();
+
+    stmt.execute("create role admin_role");
+    stmt.execute("grant all on server server1 to role admin_role");
+    stmt.execute("grant role admin_role to group " + StaticUserGroup.ADMINGROUP);
+
+    // Create external table tab1 on location '/tmp/external/p1'.
+    // Create tab1_role, and grant it with insert permission on table tab1 to user_group1.
+    conn = hiveServer2.createConnection(StaticUserGroup.ADMIN1, StaticUserGroup.ADMIN1);
+    stmt = conn.createStatement();
+    stmt.execute("create database " + dbName);
+    stmt.execute("use " + dbName);
+    stmt.execute("create external table tab1 (s string) partitioned by (month int) location '/tmp/external/p1'");
+    stmt.execute("create role tab1_role");
+    stmt.execute("grant insert on table tab1 to role tab1_role");
+    stmt.execute("grant role tab1_role to group " + StaticUserGroup.USERGROUP1);
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+
+    // Verify that user_group1 has insert(write_execute) permission on '/tmp/external/p1'.
+    verifyOnAllSubDirs("/tmp/external/p1", FsAction.WRITE_EXECUTE, StaticUserGroup.USERGROUP1, true);
+
+    // Create table tab2 on the same location '/tmp/external/p1' as table tab1.
+    // Create tab2_role, and grant it with select permission on table tab2 to user_group1.
+    stmt.execute("create table tab2 (s string) partitioned by (month int) location '/tmp/external/p1'");
+    stmt.execute("create role tab2_role");
+    stmt.execute("grant select on table tab2 to role tab2_role");
+    stmt.execute("grant role tab2_role to group " + StaticUserGroup.USERGROUP1);
+
+    // When two tables pointing to the same location, ACLS should have union (no duplicates)
+    // of both rules.
+    verifyOnPath("/tmp/external/p1", FsAction.ALL, StaticUserGroup.USERGROUP1, true);
+
+    // When drop table tab1, ACLs of tab2 still remain.
+    stmt.execute("DROP TABLE IF EXISTS tab1");
+    Thread.sleep(CACHE_REFRESH);//Wait till sentry cache is updated in Namenode
+    verifyOnPath("/tmp/external/p1", FsAction.READ_EXECUTE, StaticUserGroup.USERGROUP1, true);
+
+    stmt.close();
+    conn.close();
+  }
+
   private void verifyAccessToPath(String user, String group, String path, boolean hasPermission) throws Exception{
     Path p = new Path(path);
     UserGroupInformation hadoopUser =
@@ -1305,7 +1502,13 @@ public class TestHDFSIntegration {
     Map<String, FsAction> acls = new HashMap<String, FsAction>();
     for (AclEntry ent : aclStatus.getEntries()) {
       if (ent.getType().equals(AclEntryType.GROUP)) {
-        acls.put(ent.getName(), ent.getPermission());
+
+        // In case of duplicate acl exist, exception should be thrown.
+        if (acls.containsKey(ent.getName())) {
+          throw new SentryAlreadyExistsException("The acl " + ent.getName() + " already exists.\n");
+        } else {
+          acls.put(ent.getName(), ent.getPermission());
+        }
       }
     }
     return acls;


[3/3] incubator-sentry git commit: SENTRY-953: External Partitions which are referenced by more than one table can cause some unexpected behavior with Sentry HDFS sync ( Hao Hao, Reviewed by: Sravya Tirukkovalur)

Posted by sr...@apache.org.
SENTRY-953: External Partitions which are referenced by more than one table can cause some unexpected behavior with Sentry HDFS sync ( Hao Hao, Reviewed by: Sravya Tirukkovalur)

Change-Id: Ibcda4929bb008f518e4fd2bc4abb95406423488c


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

Branch: refs/heads/master
Commit: 4b33ad92988a8bc0e0bc6d03962dbc7cda58827e
Parents: 9fe7202
Author: Sravya Tirukkovalur <sr...@cloudera.com>
Authored: Wed Dec 16 22:42:41 2015 -0800
Committer: Sravya Tirukkovalur <sr...@cloudera.com>
Committed: Wed Dec 16 22:42:41 2015 -0800

----------------------------------------------------------------------
 .../hdfs/service/thrift/SentryHDFSService.java  | 211 +++++-------
 .../service/thrift/TAuthzUpdateResponse.java    |  99 +++---
 .../hdfs/service/thrift/TPathChanges.java       |  52 ++-
 .../sentry/hdfs/service/thrift/TPathEntry.java  | 317 ++++++++++---------
 .../sentry/hdfs/service/thrift/TPathsDump.java  |  88 +++--
 .../hdfs/service/thrift/TPathsUpdate.java       | 104 +++---
 .../hdfs/service/thrift/TPermissionsUpdate.java | 169 +++++-----
 .../hdfs/service/thrift/TPrivilegeChanges.java  | 140 ++++----
 .../hdfs/service/thrift/TRoleChanges.java       | 116 +++----
 .../java/org/apache/sentry/hdfs/AuthzPaths.java |  41 ++-
 .../java/org/apache/sentry/hdfs/HMSPaths.java   | 196 +++++++++---
 .../org/apache/sentry/hdfs/HMSPathsDumper.java  |  24 +-
 .../org/apache/sentry/hdfs/PathsUpdate.java     |   3 +
 .../java/org/apache/sentry/hdfs/Updateable.java |   2 +-
 .../sentry/hdfs/UpdateableAuthzPaths.java       |   7 +-
 .../main/resources/sentry_hdfs_service.thrift   |  36 ++-
 .../org/apache/sentry/hdfs/TestHMSPaths.java    |  36 ++-
 .../sentry/hdfs/TestHMSPathsFullDump.java       |  36 +--
 .../sentry/hdfs/TestUpdateableAuthzPaths.java   |  69 ++--
 .../sentry/hdfs/SentryAuthorizationInfo.java    |  26 +-
 .../apache/sentry/hdfs/SentryPermissions.java   |  15 +-
 .../hdfs/TestMetastoreCacheInitializer.java     |  16 +-
 .../tests/e2e/hdfs/TestHDFSIntegration.java     | 207 +++++++++++-
 23 files changed, 1133 insertions(+), 877 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/SentryHDFSService.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/SentryHDFSService.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/SentryHDFSService.java
index 663fe4e..5db39a7 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/SentryHDFSService.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/SentryHDFSService.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -434,7 +433,7 @@ public class SentryHDFSService {
       schemes.put(TupleScheme.class, new handle_hms_notification_argsTupleSchemeFactory());
     }
 
-    private TPathsUpdate pathsUpdate; // required
+    public TPathsUpdate pathsUpdate; // 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 {
@@ -536,8 +535,9 @@ public class SentryHDFSService {
       return this.pathsUpdate;
     }
 
-    public void setPathsUpdate(TPathsUpdate pathsUpdate) {
+    public handle_hms_notification_args setPathsUpdate(TPathsUpdate pathsUpdate) {
       this.pathsUpdate = pathsUpdate;
+      return this;
     }
 
     public void unsetPathsUpdate() {
@@ -617,14 +617,7 @@ public class SentryHDFSService {
 
     @Override
     public int hashCode() {
-      HashCodeBuilder builder = new HashCodeBuilder();
-
-      boolean present_pathsUpdate = true && (isSetPathsUpdate());
-      builder.append(present_pathsUpdate);
-      if (present_pathsUpdate)
-        builder.append(pathsUpdate);
-
-      return builder.toHashCode();
+      return 0;
     }
 
     public int compareTo(handle_hms_notification_args other) {
@@ -733,6 +726,8 @@ public class SentryHDFSService {
           iprot.readFieldEnd();
         }
         iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
         struct.validate();
       }
 
@@ -916,9 +911,7 @@ public class SentryHDFSService {
 
     @Override
     public int hashCode() {
-      HashCodeBuilder builder = new HashCodeBuilder();
-
-      return builder.toHashCode();
+      return 0;
     }
 
     public int compareTo(handle_hms_notification_result other) {
@@ -998,6 +991,8 @@ public class SentryHDFSService {
           iprot.readFieldEnd();
         }
         iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
         struct.validate();
       }
 
@@ -1043,7 +1038,7 @@ public class SentryHDFSService {
       schemes.put(TupleScheme.class, new check_hms_seq_num_argsTupleSchemeFactory());
     }
 
-    private long pathSeqNum; // required
+    public long pathSeqNum; // 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 {
@@ -1148,9 +1143,10 @@ public class SentryHDFSService {
       return this.pathSeqNum;
     }
 
-    public void setPathSeqNum(long pathSeqNum) {
+    public check_hms_seq_num_args setPathSeqNum(long pathSeqNum) {
       this.pathSeqNum = pathSeqNum;
       setPathSeqNumIsSet(true);
+      return this;
     }
 
     public void unsetPathSeqNum() {
@@ -1228,14 +1224,7 @@ public class SentryHDFSService {
 
     @Override
     public int hashCode() {
-      HashCodeBuilder builder = new HashCodeBuilder();
-
-      boolean present_pathSeqNum = true;
-      builder.append(present_pathSeqNum);
-      if (present_pathSeqNum)
-        builder.append(pathSeqNum);
-
-      return builder.toHashCode();
+      return 0;
     }
 
     public int compareTo(check_hms_seq_num_args other) {
@@ -1338,6 +1327,8 @@ public class SentryHDFSService {
           iprot.readFieldEnd();
         }
         iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
         struct.validate();
       }
 
@@ -1399,7 +1390,7 @@ public class SentryHDFSService {
       schemes.put(TupleScheme.class, new check_hms_seq_num_resultTupleSchemeFactory());
     }
 
-    private long success; // required
+    public long success; // 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 {
@@ -1504,9 +1495,10 @@ public class SentryHDFSService {
       return this.success;
     }
 
-    public void setSuccess(long success) {
+    public check_hms_seq_num_result setSuccess(long success) {
       this.success = success;
       setSuccessIsSet(true);
+      return this;
     }
 
     public void unsetSuccess() {
@@ -1584,14 +1576,7 @@ public class SentryHDFSService {
 
     @Override
     public int hashCode() {
-      HashCodeBuilder builder = new HashCodeBuilder();
-
-      boolean present_success = true;
-      builder.append(present_success);
-      if (present_success)
-        builder.append(success);
-
-      return builder.toHashCode();
+      return 0;
     }
 
     public int compareTo(check_hms_seq_num_result other) {
@@ -1694,6 +1679,8 @@ public class SentryHDFSService {
           iprot.readFieldEnd();
         }
         iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
         struct.validate();
       }
 
@@ -1758,8 +1745,8 @@ public class SentryHDFSService {
       schemes.put(TupleScheme.class, new get_all_authz_updates_from_argsTupleSchemeFactory());
     }
 
-    private long permSeqNum; // required
-    private long pathSeqNum; // required
+    public long permSeqNum; // required
+    public long pathSeqNum; // 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 {
@@ -1876,9 +1863,10 @@ public class SentryHDFSService {
       return this.permSeqNum;
     }
 
-    public void setPermSeqNum(long permSeqNum) {
+    public get_all_authz_updates_from_args setPermSeqNum(long permSeqNum) {
       this.permSeqNum = permSeqNum;
       setPermSeqNumIsSet(true);
+      return this;
     }
 
     public void unsetPermSeqNum() {
@@ -1898,9 +1886,10 @@ public class SentryHDFSService {
       return this.pathSeqNum;
     }
 
-    public void setPathSeqNum(long pathSeqNum) {
+    public get_all_authz_updates_from_args setPathSeqNum(long pathSeqNum) {
       this.pathSeqNum = pathSeqNum;
       setPathSeqNumIsSet(true);
+      return this;
     }
 
     public void unsetPathSeqNum() {
@@ -2000,19 +1989,7 @@ public class SentryHDFSService {
 
     @Override
     public int hashCode() {
-      HashCodeBuilder builder = new HashCodeBuilder();
-
-      boolean present_permSeqNum = true;
-      builder.append(present_permSeqNum);
-      if (present_permSeqNum)
-        builder.append(permSeqNum);
-
-      boolean present_pathSeqNum = true;
-      builder.append(present_pathSeqNum);
-      if (present_pathSeqNum)
-        builder.append(pathSeqNum);
-
-      return builder.toHashCode();
+      return 0;
     }
 
     public int compareTo(get_all_authz_updates_from_args other) {
@@ -2137,6 +2114,8 @@ public class SentryHDFSService {
           iprot.readFieldEnd();
         }
         iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
         struct.validate();
       }
 
@@ -2211,7 +2190,7 @@ public class SentryHDFSService {
       schemes.put(TupleScheme.class, new get_all_authz_updates_from_resultTupleSchemeFactory());
     }
 
-    private TAuthzUpdateResponse success; // required
+    public TAuthzUpdateResponse success; // 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 {
@@ -2313,8 +2292,9 @@ public class SentryHDFSService {
       return this.success;
     }
 
-    public void setSuccess(TAuthzUpdateResponse success) {
+    public get_all_authz_updates_from_result setSuccess(TAuthzUpdateResponse success) {
       this.success = success;
+      return this;
     }
 
     public void unsetSuccess() {
@@ -2394,14 +2374,7 @@ public class SentryHDFSService {
 
     @Override
     public int hashCode() {
-      HashCodeBuilder builder = new HashCodeBuilder();
-
-      boolean present_success = true && (isSetSuccess());
-      builder.append(present_success);
-      if (present_success)
-        builder.append(success);
-
-      return builder.toHashCode();
+      return 0;
     }
 
     public int compareTo(get_all_authz_updates_from_result other) {
@@ -2510,6 +2483,8 @@ public class SentryHDFSService {
           iprot.readFieldEnd();
         }
         iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
         struct.validate();
       }
 
@@ -2575,8 +2550,8 @@ public class SentryHDFSService {
       schemes.put(TupleScheme.class, new get_all_related_paths_argsTupleSchemeFactory());
     }
 
-    private String path; // required
-    private boolean exactMatch; // required
+    public String path; // required
+    public boolean exactMatch; // 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 {
@@ -2692,8 +2667,9 @@ public class SentryHDFSService {
       return this.path;
     }
 
-    public void setPath(String path) {
+    public get_all_related_paths_args setPath(String path) {
       this.path = path;
+      return this;
     }
 
     public void unsetPath() {
@@ -2715,9 +2691,10 @@ public class SentryHDFSService {
       return this.exactMatch;
     }
 
-    public void setExactMatch(boolean exactMatch) {
+    public get_all_related_paths_args setExactMatch(boolean exactMatch) {
       this.exactMatch = exactMatch;
       setExactMatchIsSet(true);
+      return this;
     }
 
     public void unsetExactMatch() {
@@ -2817,19 +2794,7 @@ public class SentryHDFSService {
 
     @Override
     public int hashCode() {
-      HashCodeBuilder builder = new HashCodeBuilder();
-
-      boolean present_path = true && (isSetPath());
-      builder.append(present_path);
-      if (present_path)
-        builder.append(path);
-
-      boolean present_exactMatch = true;
-      builder.append(present_exactMatch);
-      if (present_exactMatch)
-        builder.append(exactMatch);
-
-      return builder.toHashCode();
+      return 0;
     }
 
     public int compareTo(get_all_related_paths_args other) {
@@ -2958,6 +2923,8 @@ public class SentryHDFSService {
           iprot.readFieldEnd();
         }
         iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
         struct.validate();
       }
 
@@ -3034,7 +3001,7 @@ public class SentryHDFSService {
       schemes.put(TupleScheme.class, new get_all_related_paths_resultTupleSchemeFactory());
     }
 
-    private Map<String,List<String>> success; // required
+    public Map<String,List<String>> success; // 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 {
@@ -3165,8 +3132,9 @@ public class SentryHDFSService {
       return this.success;
     }
 
-    public void setSuccess(Map<String,List<String>> success) {
+    public get_all_related_paths_result setSuccess(Map<String,List<String>> success) {
       this.success = success;
+      return this;
     }
 
     public void unsetSuccess() {
@@ -3246,14 +3214,7 @@ public class SentryHDFSService {
 
     @Override
     public int hashCode() {
-      HashCodeBuilder builder = new HashCodeBuilder();
-
-      boolean present_success = true && (isSetSuccess());
-      builder.append(present_success);
-      if (present_success)
-        builder.append(success);
-
-      return builder.toHashCode();
+      return 0;
     }
 
     public int compareTo(get_all_related_paths_result other) {
@@ -3347,25 +3308,25 @@ public class SentryHDFSService {
             case 0: // SUCCESS
               if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                 {
-                  org.apache.thrift.protocol.TMap _map130 = iprot.readMapBegin();
-                  struct.success = new HashMap<String,List<String>>(2*_map130.size);
-                  for (int _i131 = 0; _i131 < _map130.size; ++_i131)
+                  org.apache.thrift.protocol.TMap _map138 = iprot.readMapBegin();
+                  struct.success = new HashMap<String,List<String>>(2*_map138.size);
+                  for (int _i139 = 0; _i139 < _map138.size; ++_i139)
                   {
-                    String _key132; // required
-                    List<String> _val133; // required
-                    _key132 = iprot.readString();
+                    String _key140; // required
+                    List<String> _val141; // required
+                    _key140 = iprot.readString();
                     {
-                      org.apache.thrift.protocol.TList _list134 = iprot.readListBegin();
-                      _val133 = new ArrayList<String>(_list134.size);
-                      for (int _i135 = 0; _i135 < _list134.size; ++_i135)
+                      org.apache.thrift.protocol.TList _list142 = iprot.readListBegin();
+                      _val141 = new ArrayList<String>(_list142.size);
+                      for (int _i143 = 0; _i143 < _list142.size; ++_i143)
                       {
-                        String _elem136; // required
-                        _elem136 = iprot.readString();
-                        _val133.add(_elem136);
+                        String _elem144; // required
+                        _elem144 = iprot.readString();
+                        _val141.add(_elem144);
                       }
                       iprot.readListEnd();
                     }
-                    struct.success.put(_key132, _val133);
+                    struct.success.put(_key140, _val141);
                   }
                   iprot.readMapEnd();
                 }
@@ -3380,6 +3341,8 @@ public class SentryHDFSService {
           iprot.readFieldEnd();
         }
         iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
         struct.validate();
       }
 
@@ -3391,14 +3354,14 @@ public class SentryHDFSService {
           oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
           {
             oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, struct.success.size()));
-            for (Map.Entry<String, List<String>> _iter137 : struct.success.entrySet())
+            for (Map.Entry<String, List<String>> _iter145 : struct.success.entrySet())
             {
-              oprot.writeString(_iter137.getKey());
+              oprot.writeString(_iter145.getKey());
               {
-                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter137.getValue().size()));
-                for (String _iter138 : _iter137.getValue())
+                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter145.getValue().size()));
+                for (String _iter146 : _iter145.getValue())
                 {
-                  oprot.writeString(_iter138);
+                  oprot.writeString(_iter146);
                 }
                 oprot.writeListEnd();
               }
@@ -3432,14 +3395,14 @@ public class SentryHDFSService {
         if (struct.isSetSuccess()) {
           {
             oprot.writeI32(struct.success.size());
-            for (Map.Entry<String, List<String>> _iter139 : struct.success.entrySet())
+            for (Map.Entry<String, List<String>> _iter147 : struct.success.entrySet())
             {
-              oprot.writeString(_iter139.getKey());
+              oprot.writeString(_iter147.getKey());
               {
-                oprot.writeI32(_iter139.getValue().size());
-                for (String _iter140 : _iter139.getValue())
+                oprot.writeI32(_iter147.getValue().size());
+                for (String _iter148 : _iter147.getValue())
                 {
-                  oprot.writeString(_iter140);
+                  oprot.writeString(_iter148);
                 }
               }
             }
@@ -3453,24 +3416,24 @@ public class SentryHDFSService {
         BitSet incoming = iprot.readBitSet(1);
         if (incoming.get(0)) {
           {
-            org.apache.thrift.protocol.TMap _map141 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
-            struct.success = new HashMap<String,List<String>>(2*_map141.size);
-            for (int _i142 = 0; _i142 < _map141.size; ++_i142)
+            org.apache.thrift.protocol.TMap _map149 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
+            struct.success = new HashMap<String,List<String>>(2*_map149.size);
+            for (int _i150 = 0; _i150 < _map149.size; ++_i150)
             {
-              String _key143; // required
-              List<String> _val144; // required
-              _key143 = iprot.readString();
+              String _key151; // required
+              List<String> _val152; // required
+              _key151 = iprot.readString();
               {
-                org.apache.thrift.protocol.TList _list145 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-                _val144 = new ArrayList<String>(_list145.size);
-                for (int _i146 = 0; _i146 < _list145.size; ++_i146)
+                org.apache.thrift.protocol.TList _list153 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+                _val152 = new ArrayList<String>(_list153.size);
+                for (int _i154 = 0; _i154 < _list153.size; ++_i154)
                 {
-                  String _elem147; // required
-                  _elem147 = iprot.readString();
-                  _val144.add(_elem147);
+                  String _elem155; // required
+                  _elem155 = iprot.readString();
+                  _val152.add(_elem155);
                 }
               }
-              struct.success.put(_key143, _val144);
+              struct.success.put(_key151, _val152);
             }
           }
           struct.setSuccessIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java
index 480c264..e42d710 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -43,8 +42,8 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
     schemes.put(TupleScheme.class, new TAuthzUpdateResponseTupleSchemeFactory());
   }
 
-  private List<TPathsUpdate> authzPathUpdate; // optional
-  private List<TPermissionsUpdate> authzPermUpdate; // optional
+  public List<TPathsUpdate> authzPathUpdate; // optional
+  public List<TPermissionsUpdate> authzPermUpdate; // 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 {
@@ -174,8 +173,9 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
     return this.authzPathUpdate;
   }
 
-  public void setAuthzPathUpdate(List<TPathsUpdate> authzPathUpdate) {
+  public TAuthzUpdateResponse setAuthzPathUpdate(List<TPathsUpdate> authzPathUpdate) {
     this.authzPathUpdate = authzPathUpdate;
+    return this;
   }
 
   public void unsetAuthzPathUpdate() {
@@ -212,8 +212,9 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
     return this.authzPermUpdate;
   }
 
-  public void setAuthzPermUpdate(List<TPermissionsUpdate> authzPermUpdate) {
+  public TAuthzUpdateResponse setAuthzPermUpdate(List<TPermissionsUpdate> authzPermUpdate) {
     this.authzPermUpdate = authzPermUpdate;
+    return this;
   }
 
   public void unsetAuthzPermUpdate() {
@@ -315,19 +316,7 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
 
   @Override
   public int hashCode() {
-    HashCodeBuilder builder = new HashCodeBuilder();
-
-    boolean present_authzPathUpdate = true && (isSetAuthzPathUpdate());
-    builder.append(present_authzPathUpdate);
-    if (present_authzPathUpdate)
-      builder.append(authzPathUpdate);
-
-    boolean present_authzPermUpdate = true && (isSetAuthzPermUpdate());
-    builder.append(present_authzPermUpdate);
-    if (present_authzPermUpdate)
-      builder.append(authzPermUpdate);
-
-    return builder.toHashCode();
+    return 0;
   }
 
   public int compareTo(TAuthzUpdateResponse other) {
@@ -443,14 +432,14 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
           case 1: // AUTHZ_PATH_UPDATE
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list114 = iprot.readListBegin();
-                struct.authzPathUpdate = new ArrayList<TPathsUpdate>(_list114.size);
-                for (int _i115 = 0; _i115 < _list114.size; ++_i115)
+                org.apache.thrift.protocol.TList _list122 = iprot.readListBegin();
+                struct.authzPathUpdate = new ArrayList<TPathsUpdate>(_list122.size);
+                for (int _i123 = 0; _i123 < _list122.size; ++_i123)
                 {
-                  TPathsUpdate _elem116; // required
-                  _elem116 = new TPathsUpdate();
-                  _elem116.read(iprot);
-                  struct.authzPathUpdate.add(_elem116);
+                  TPathsUpdate _elem124; // required
+                  _elem124 = new TPathsUpdate();
+                  _elem124.read(iprot);
+                  struct.authzPathUpdate.add(_elem124);
                 }
                 iprot.readListEnd();
               }
@@ -462,14 +451,14 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
           case 2: // AUTHZ_PERM_UPDATE
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list117 = iprot.readListBegin();
-                struct.authzPermUpdate = new ArrayList<TPermissionsUpdate>(_list117.size);
-                for (int _i118 = 0; _i118 < _list117.size; ++_i118)
+                org.apache.thrift.protocol.TList _list125 = iprot.readListBegin();
+                struct.authzPermUpdate = new ArrayList<TPermissionsUpdate>(_list125.size);
+                for (int _i126 = 0; _i126 < _list125.size; ++_i126)
                 {
-                  TPermissionsUpdate _elem119; // required
-                  _elem119 = new TPermissionsUpdate();
-                  _elem119.read(iprot);
-                  struct.authzPermUpdate.add(_elem119);
+                  TPermissionsUpdate _elem127; // required
+                  _elem127 = new TPermissionsUpdate();
+                  _elem127.read(iprot);
+                  struct.authzPermUpdate.add(_elem127);
                 }
                 iprot.readListEnd();
               }
@@ -484,6 +473,8 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
         iprot.readFieldEnd();
       }
       iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
       struct.validate();
     }
 
@@ -496,9 +487,9 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
           oprot.writeFieldBegin(AUTHZ_PATH_UPDATE_FIELD_DESC);
           {
             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.authzPathUpdate.size()));
-            for (TPathsUpdate _iter120 : struct.authzPathUpdate)
+            for (TPathsUpdate _iter128 : struct.authzPathUpdate)
             {
-              _iter120.write(oprot);
+              _iter128.write(oprot);
             }
             oprot.writeListEnd();
           }
@@ -510,9 +501,9 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
           oprot.writeFieldBegin(AUTHZ_PERM_UPDATE_FIELD_DESC);
           {
             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.authzPermUpdate.size()));
-            for (TPermissionsUpdate _iter121 : struct.authzPermUpdate)
+            for (TPermissionsUpdate _iter129 : struct.authzPermUpdate)
             {
-              _iter121.write(oprot);
+              _iter129.write(oprot);
             }
             oprot.writeListEnd();
           }
@@ -547,18 +538,18 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
       if (struct.isSetAuthzPathUpdate()) {
         {
           oprot.writeI32(struct.authzPathUpdate.size());
-          for (TPathsUpdate _iter122 : struct.authzPathUpdate)
+          for (TPathsUpdate _iter130 : struct.authzPathUpdate)
           {
-            _iter122.write(oprot);
+            _iter130.write(oprot);
           }
         }
       }
       if (struct.isSetAuthzPermUpdate()) {
         {
           oprot.writeI32(struct.authzPermUpdate.size());
-          for (TPermissionsUpdate _iter123 : struct.authzPermUpdate)
+          for (TPermissionsUpdate _iter131 : struct.authzPermUpdate)
           {
-            _iter123.write(oprot);
+            _iter131.write(oprot);
           }
         }
       }
@@ -570,28 +561,28 @@ public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdat
       BitSet incoming = iprot.readBitSet(2);
       if (incoming.get(0)) {
         {
-          org.apache.thrift.protocol.TList _list124 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.authzPathUpdate = new ArrayList<TPathsUpdate>(_list124.size);
-          for (int _i125 = 0; _i125 < _list124.size; ++_i125)
+          org.apache.thrift.protocol.TList _list132 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.authzPathUpdate = new ArrayList<TPathsUpdate>(_list132.size);
+          for (int _i133 = 0; _i133 < _list132.size; ++_i133)
           {
-            TPathsUpdate _elem126; // required
-            _elem126 = new TPathsUpdate();
-            _elem126.read(iprot);
-            struct.authzPathUpdate.add(_elem126);
+            TPathsUpdate _elem134; // required
+            _elem134 = new TPathsUpdate();
+            _elem134.read(iprot);
+            struct.authzPathUpdate.add(_elem134);
           }
         }
         struct.setAuthzPathUpdateIsSet(true);
       }
       if (incoming.get(1)) {
         {
-          org.apache.thrift.protocol.TList _list127 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.authzPermUpdate = new ArrayList<TPermissionsUpdate>(_list127.size);
-          for (int _i128 = 0; _i128 < _list127.size; ++_i128)
+          org.apache.thrift.protocol.TList _list135 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.authzPermUpdate = new ArrayList<TPermissionsUpdate>(_list135.size);
+          for (int _i136 = 0; _i136 < _list135.size; ++_i136)
           {
-            TPermissionsUpdate _elem129; // required
-            _elem129 = new TPermissionsUpdate();
-            _elem129.read(iprot);
-            struct.authzPermUpdate.add(_elem129);
+            TPermissionsUpdate _elem137; // required
+            _elem137 = new TPermissionsUpdate();
+            _elem137.read(iprot);
+            struct.authzPermUpdate.add(_elem137);
           }
         }
         struct.setAuthzPermUpdateIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java
index 85254d7..148c30d 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -44,9 +43,9 @@ public class TPathChanges implements org.apache.thrift.TBase<TPathChanges, TPath
     schemes.put(TupleScheme.class, new TPathChangesTupleSchemeFactory());
   }
 
-  private String authzObj; // required
-  private List<List<String>> addPaths; // required
-  private List<List<String>> delPaths; // required
+  public String authzObj; // required
+  public List<List<String>> addPaths; // required
+  public List<List<String>> 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 {
@@ -190,8 +189,9 @@ public class TPathChanges implements org.apache.thrift.TBase<TPathChanges, TPath
     return this.authzObj;
   }
 
-  public void setAuthzObj(String authzObj) {
+  public TPathChanges setAuthzObj(String authzObj) {
     this.authzObj = authzObj;
+    return this;
   }
 
   public void unsetAuthzObj() {
@@ -228,8 +228,9 @@ public class TPathChanges implements org.apache.thrift.TBase<TPathChanges, TPath
     return this.addPaths;
   }
 
-  public void setAddPaths(List<List<String>> addPaths) {
+  public TPathChanges setAddPaths(List<List<String>> addPaths) {
     this.addPaths = addPaths;
+    return this;
   }
 
   public void unsetAddPaths() {
@@ -266,8 +267,9 @@ public class TPathChanges implements org.apache.thrift.TBase<TPathChanges, TPath
     return this.delPaths;
   }
 
-  public void setDelPaths(List<List<String>> delPaths) {
+  public TPathChanges setDelPaths(List<List<String>> delPaths) {
     this.delPaths = delPaths;
+    return this;
   }
 
   public void unsetDelPaths() {
@@ -391,24 +393,7 @@ public class TPathChanges implements org.apache.thrift.TBase<TPathChanges, TPath
 
   @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();
+    return 0;
   }
 
   public int compareTo(TPathChanges other) {
@@ -498,18 +483,15 @@ public class TPathChanges implements org.apache.thrift.TBase<TPathChanges, TPath
 
   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 (authzObj == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzObj' was not present! Struct: " + toString());
     }
-
-    if (!isSetAddPaths()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'addPaths' is unset! Struct:" + toString());
+    if (addPaths == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'addPaths' was not present! Struct: " + toString());
     }
-
-    if (!isSetDelPaths()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'delPaths' is unset! Struct:" + toString());
+    if (delPaths == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'delPaths' was not present! Struct: " + toString());
     }
-
     // check for sub-struct validity
   }
 
@@ -617,6 +599,8 @@ public class TPathChanges implements org.apache.thrift.TBase<TPathChanges, TPath
         iprot.readFieldEnd();
       }
       iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
       struct.validate();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java
index a2a7f7b..35c059d 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -36,8 +35,8 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
 
   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 org.apache.thrift.protocol.TField AUTHZ_OBJS_FIELD_DESC = new org.apache.thrift.protocol.TField("authzObjs", org.apache.thrift.protocol.TType.SET, (short)5);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -45,17 +44,17 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
     schemes.put(TupleScheme.class, new TPathEntryTupleSchemeFactory());
   }
 
-  private byte type; // required
-  private String pathElement; // required
-  private String authzObj; // optional
-  private Set<Integer> children; // required
+  public byte type; // required
+  public String pathElement; // required
+  public Set<Integer> children; // required
+  public Set<String> authzObjs; // 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 {
     TYPE((short)1, "type"),
     PATH_ELEMENT((short)2, "pathElement"),
-    AUTHZ_OBJ((short)3, "authzObj"),
-    CHILDREN((short)4, "children");
+    CHILDREN((short)4, "children"),
+    AUTHZ_OBJS((short)5, "authzObjs");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -74,10 +73,10 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
           return TYPE;
         case 2: // PATH_ELEMENT
           return PATH_ELEMENT;
-        case 3: // AUTHZ_OBJ
-          return AUTHZ_OBJ;
         case 4: // CHILDREN
           return CHILDREN;
+        case 5: // AUTHZ_OBJS
+          return AUTHZ_OBJS;
         default:
           return null;
       }
@@ -120,7 +119,7 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
   // isset id assignments
   private static final int __TYPE_ISSET_ID = 0;
   private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.AUTHZ_OBJ};
+  private _Fields optionals[] = {_Fields.AUTHZ_OBJS};
   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);
@@ -128,11 +127,12 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
         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))));
+    tmpMap.put(_Fields.AUTHZ_OBJS, new org.apache.thrift.meta_data.FieldMetaData("authzObjs", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        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.STRING))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPathEntry.class, metaDataMap);
   }
@@ -161,9 +161,6 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
     if (other.isSetPathElement()) {
       this.pathElement = other.pathElement;
     }
-    if (other.isSetAuthzObj()) {
-      this.authzObj = other.authzObj;
-    }
     if (other.isSetChildren()) {
       Set<Integer> __this__children = new HashSet<Integer>();
       for (Integer other_element : other.children) {
@@ -171,6 +168,13 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
       }
       this.children = __this__children;
     }
+    if (other.isSetAuthzObjs()) {
+      Set<String> __this__authzObjs = new HashSet<String>();
+      for (String other_element : other.authzObjs) {
+        __this__authzObjs.add(other_element);
+      }
+      this.authzObjs = __this__authzObjs;
+    }
   }
 
   public TPathEntry deepCopy() {
@@ -182,17 +186,18 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
     setTypeIsSet(false);
     this.type = 0;
     this.pathElement = null;
-    this.authzObj = null;
     this.children = null;
+    this.authzObjs = null;
   }
 
   public byte getType() {
     return this.type;
   }
 
-  public void setType(byte type) {
+  public TPathEntry setType(byte type) {
     this.type = type;
     setTypeIsSet(true);
+    return this;
   }
 
   public void unsetType() {
@@ -212,8 +217,9 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
     return this.pathElement;
   }
 
-  public void setPathElement(String pathElement) {
+  public TPathEntry setPathElement(String pathElement) {
     this.pathElement = pathElement;
+    return this;
   }
 
   public void unsetPathElement() {
@@ -231,29 +237,6 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
     }
   }
 
-  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();
   }
@@ -273,8 +256,9 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
     return this.children;
   }
 
-  public void setChildren(Set<Integer> children) {
+  public TPathEntry setChildren(Set<Integer> children) {
     this.children = children;
+    return this;
   }
 
   public void unsetChildren() {
@@ -292,6 +276,45 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
     }
   }
 
+  public int getAuthzObjsSize() {
+    return (this.authzObjs == null) ? 0 : this.authzObjs.size();
+  }
+
+  public java.util.Iterator<String> getAuthzObjsIterator() {
+    return (this.authzObjs == null) ? null : this.authzObjs.iterator();
+  }
+
+  public void addToAuthzObjs(String elem) {
+    if (this.authzObjs == null) {
+      this.authzObjs = new HashSet<String>();
+    }
+    this.authzObjs.add(elem);
+  }
+
+  public Set<String> getAuthzObjs() {
+    return this.authzObjs;
+  }
+
+  public TPathEntry setAuthzObjs(Set<String> authzObjs) {
+    this.authzObjs = authzObjs;
+    return this;
+  }
+
+  public void unsetAuthzObjs() {
+    this.authzObjs = null;
+  }
+
+  /** Returns true if field authzObjs is set (has been assigned a value) and false otherwise */
+  public boolean isSetAuthzObjs() {
+    return this.authzObjs != null;
+  }
+
+  public void setAuthzObjsIsSet(boolean value) {
+    if (!value) {
+      this.authzObjs = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case TYPE:
@@ -310,19 +333,19 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
       }
       break;
 
-    case AUTHZ_OBJ:
+    case CHILDREN:
       if (value == null) {
-        unsetAuthzObj();
+        unsetChildren();
       } else {
-        setAuthzObj((String)value);
+        setChildren((Set<Integer>)value);
       }
       break;
 
-    case CHILDREN:
+    case AUTHZ_OBJS:
       if (value == null) {
-        unsetChildren();
+        unsetAuthzObjs();
       } else {
-        setChildren((Set<Integer>)value);
+        setAuthzObjs((Set<String>)value);
       }
       break;
 
@@ -337,12 +360,12 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
     case PATH_ELEMENT:
       return getPathElement();
 
-    case AUTHZ_OBJ:
-      return getAuthzObj();
-
     case CHILDREN:
       return getChildren();
 
+    case AUTHZ_OBJS:
+      return getAuthzObjs();
+
     }
     throw new IllegalStateException();
   }
@@ -358,10 +381,10 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
       return isSetType();
     case PATH_ELEMENT:
       return isSetPathElement();
-    case AUTHZ_OBJ:
-      return isSetAuthzObj();
     case CHILDREN:
       return isSetChildren();
+    case AUTHZ_OBJS:
+      return isSetAuthzObjs();
     }
     throw new IllegalStateException();
   }
@@ -397,15 +420,6 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
         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) {
@@ -415,34 +429,21 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
         return false;
     }
 
+    boolean this_present_authzObjs = true && this.isSetAuthzObjs();
+    boolean that_present_authzObjs = true && that.isSetAuthzObjs();
+    if (this_present_authzObjs || that_present_authzObjs) {
+      if (!(this_present_authzObjs && that_present_authzObjs))
+        return false;
+      if (!this.authzObjs.equals(that.authzObjs))
+        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();
+    return 0;
   }
 
   public int compareTo(TPathEntry other) {
@@ -473,22 +474,22 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetAuthzObj()).compareTo(typedOther.isSetAuthzObj());
+    lastComparison = Boolean.valueOf(isSetChildren()).compareTo(typedOther.isSetChildren());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    if (isSetAuthzObj()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzObj, typedOther.authzObj);
+    if (isSetChildren()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, typedOther.children);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetChildren()).compareTo(typedOther.isSetChildren());
+    lastComparison = Boolean.valueOf(isSetAuthzObjs()).compareTo(typedOther.isSetAuthzObjs());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    if (isSetChildren()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, typedOther.children);
+    if (isSetAuthzObjs()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzObjs, typedOther.authzObjs);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -524,16 +525,6 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
       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) {
@@ -542,24 +533,29 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
       sb.append(this.children);
     }
     first = false;
+    if (isSetAuthzObjs()) {
+      if (!first) sb.append(", ");
+      sb.append("authzObjs:");
+      if (this.authzObjs == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.authzObjs);
+      }
+      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());
+    // alas, we cannot check 'type' because it's a primitive and you chose the non-beans generator.
+    if (pathElement == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'pathElement' was not present! 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());
+    if (children == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'children' was not present! Struct: " + toString());
     }
-
     // check for sub-struct validity
   }
 
@@ -615,14 +611,6 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
               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) {
               {
@@ -641,12 +629,35 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 5: // AUTHZ_OBJS
+            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
+              {
+                org.apache.thrift.protocol.TSet _set35 = iprot.readSetBegin();
+                struct.authzObjs = new HashSet<String>(2*_set35.size);
+                for (int _i36 = 0; _i36 < _set35.size; ++_i36)
+                {
+                  String _elem37; // required
+                  _elem37 = iprot.readString();
+                  struct.authzObjs.add(_elem37);
+                }
+                iprot.readSetEnd();
+              }
+              struct.setAuthzObjsIsSet(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();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      if (!struct.isSetType()) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' was not found in serialized data! Struct: " + toString());
+      }
       struct.validate();
     }
 
@@ -662,25 +673,32 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
         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 _iter35 : struct.children)
+          for (int _iter38 : struct.children)
           {
-            oprot.writeI32(_iter35);
+            oprot.writeI32(_iter38);
           }
           oprot.writeSetEnd();
         }
         oprot.writeFieldEnd();
       }
+      if (struct.authzObjs != null) {
+        if (struct.isSetAuthzObjs()) {
+          oprot.writeFieldBegin(AUTHZ_OBJS_FIELD_DESC);
+          {
+            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.authzObjs.size()));
+            for (String _iter39 : struct.authzObjs)
+            {
+              oprot.writeString(_iter39);
+            }
+            oprot.writeSetEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -702,18 +720,24 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
       oprot.writeString(struct.pathElement);
       {
         oprot.writeI32(struct.children.size());
-        for (int _iter36 : struct.children)
+        for (int _iter40 : struct.children)
         {
-          oprot.writeI32(_iter36);
+          oprot.writeI32(_iter40);
         }
       }
       BitSet optionals = new BitSet();
-      if (struct.isSetAuthzObj()) {
+      if (struct.isSetAuthzObjs()) {
         optionals.set(0);
       }
       oprot.writeBitSet(optionals, 1);
-      if (struct.isSetAuthzObj()) {
-        oprot.writeString(struct.authzObj);
+      if (struct.isSetAuthzObjs()) {
+        {
+          oprot.writeI32(struct.authzObjs.size());
+          for (String _iter41 : struct.authzObjs)
+          {
+            oprot.writeString(_iter41);
+          }
+        }
       }
     }
 
@@ -725,20 +749,29 @@ public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntr
       struct.pathElement = iprot.readString();
       struct.setPathElementIsSet(true);
       {
-        org.apache.thrift.protocol.TSet _set37 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
-        struct.children = new HashSet<Integer>(2*_set37.size);
-        for (int _i38 = 0; _i38 < _set37.size; ++_i38)
+        org.apache.thrift.protocol.TSet _set42 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
+        struct.children = new HashSet<Integer>(2*_set42.size);
+        for (int _i43 = 0; _i43 < _set42.size; ++_i43)
         {
-          int _elem39; // required
-          _elem39 = iprot.readI32();
-          struct.children.add(_elem39);
+          int _elem44; // required
+          _elem44 = iprot.readI32();
+          struct.children.add(_elem44);
         }
       }
       struct.setChildrenIsSet(true);
       BitSet incoming = iprot.readBitSet(1);
       if (incoming.get(0)) {
-        struct.authzObj = iprot.readString();
-        struct.setAuthzObjIsSet(true);
+        {
+          org.apache.thrift.protocol.TSet _set45 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+          struct.authzObjs = new HashSet<String>(2*_set45.size);
+          for (int _i46 = 0; _i46 < _set45.size; ++_i46)
+          {
+            String _elem47; // required
+            _elem47 = iprot.readString();
+            struct.authzObjs.add(_elem47);
+          }
+        }
+        struct.setAuthzObjsIsSet(true);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsDump.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsDump.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsDump.java
index 200ecad..e599b3e 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsDump.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsDump.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -43,8 +42,8 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
     schemes.put(TupleScheme.class, new TPathsDumpTupleSchemeFactory());
   }
 
-  private int rootId; // required
-  private Map<Integer,TPathEntry> nodeMap; // required
+  public int rootId; // required
+  public Map<Integer,TPathEntry> 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 {
@@ -174,9 +173,10 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
     return this.rootId;
   }
 
-  public void setRootId(int rootId) {
+  public TPathsDump setRootId(int rootId) {
     this.rootId = rootId;
     setRootIdIsSet(true);
+    return this;
   }
 
   public void unsetRootId() {
@@ -207,8 +207,9 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
     return this.nodeMap;
   }
 
-  public void setNodeMap(Map<Integer,TPathEntry> nodeMap) {
+  public TPathsDump setNodeMap(Map<Integer,TPathEntry> nodeMap) {
     this.nodeMap = nodeMap;
+    return this;
   }
 
   public void unsetNodeMap() {
@@ -310,19 +311,7 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
 
   @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();
+    return 0;
   }
 
   public int compareTo(TPathsDump other) {
@@ -390,14 +379,10 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
 
   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());
+    // alas, we cannot check 'rootId' because it's a primitive and you chose the non-beans generator.
+    if (nodeMap == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'nodeMap' was not present! Struct: " + toString());
     }
-
-    if (!isSetNodeMap()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'nodeMap' is unset! Struct:" + toString());
-    }
-
     // check for sub-struct validity
   }
 
@@ -448,16 +433,16 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
           case 2: // NODE_MAP
             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
               {
-                org.apache.thrift.protocol.TMap _map40 = iprot.readMapBegin();
-                struct.nodeMap = new HashMap<Integer,TPathEntry>(2*_map40.size);
-                for (int _i41 = 0; _i41 < _map40.size; ++_i41)
+                org.apache.thrift.protocol.TMap _map48 = iprot.readMapBegin();
+                struct.nodeMap = new HashMap<Integer,TPathEntry>(2*_map48.size);
+                for (int _i49 = 0; _i49 < _map48.size; ++_i49)
                 {
-                  int _key42; // required
-                  TPathEntry _val43; // required
-                  _key42 = iprot.readI32();
-                  _val43 = new TPathEntry();
-                  _val43.read(iprot);
-                  struct.nodeMap.put(_key42, _val43);
+                  int _key50; // required
+                  TPathEntry _val51; // required
+                  _key50 = iprot.readI32();
+                  _val51 = new TPathEntry();
+                  _val51.read(iprot);
+                  struct.nodeMap.put(_key50, _val51);
                 }
                 iprot.readMapEnd();
               }
@@ -472,6 +457,11 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
         iprot.readFieldEnd();
       }
       iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      if (!struct.isSetRootId()) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'rootId' was not found in serialized data! Struct: " + toString());
+      }
       struct.validate();
     }
 
@@ -486,10 +476,10 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
         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<Integer, TPathEntry> _iter44 : struct.nodeMap.entrySet())
+          for (Map.Entry<Integer, TPathEntry> _iter52 : struct.nodeMap.entrySet())
           {
-            oprot.writeI32(_iter44.getKey());
-            _iter44.getValue().write(oprot);
+            oprot.writeI32(_iter52.getKey());
+            _iter52.getValue().write(oprot);
           }
           oprot.writeMapEnd();
         }
@@ -515,10 +505,10 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
       oprot.writeI32(struct.rootId);
       {
         oprot.writeI32(struct.nodeMap.size());
-        for (Map.Entry<Integer, TPathEntry> _iter45 : struct.nodeMap.entrySet())
+        for (Map.Entry<Integer, TPathEntry> _iter53 : struct.nodeMap.entrySet())
         {
-          oprot.writeI32(_iter45.getKey());
-          _iter45.getValue().write(oprot);
+          oprot.writeI32(_iter53.getKey());
+          _iter53.getValue().write(oprot);
         }
       }
     }
@@ -529,16 +519,16 @@ public class TPathsDump implements org.apache.thrift.TBase<TPathsDump, TPathsDum
       struct.rootId = iprot.readI32();
       struct.setRootIdIsSet(true);
       {
-        org.apache.thrift.protocol.TMap _map46 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-        struct.nodeMap = new HashMap<Integer,TPathEntry>(2*_map46.size);
-        for (int _i47 = 0; _i47 < _map46.size; ++_i47)
+        org.apache.thrift.protocol.TMap _map54 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+        struct.nodeMap = new HashMap<Integer,TPathEntry>(2*_map54.size);
+        for (int _i55 = 0; _i55 < _map54.size; ++_i55)
         {
-          int _key48; // required
-          TPathEntry _val49; // required
-          _key48 = iprot.readI32();
-          _val49 = new TPathEntry();
-          _val49.read(iprot);
-          struct.nodeMap.put(_key48, _val49);
+          int _key56; // required
+          TPathEntry _val57; // required
+          _key56 = iprot.readI32();
+          _val57 = new TPathEntry();
+          _val57.read(iprot);
+          struct.nodeMap.put(_key56, _val57);
         }
       }
       struct.setNodeMapIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsUpdate.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsUpdate.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsUpdate.java
index d0ee6b6..626ac18 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsUpdate.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathsUpdate.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -45,10 +44,10 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
     schemes.put(TupleScheme.class, new TPathsUpdateTupleSchemeFactory());
   }
 
-  private boolean hasFullImage; // required
-  private TPathsDump pathsDump; // optional
-  private long seqNum; // required
-  private List<TPathChanges> pathChanges; // required
+  public boolean hasFullImage; // required
+  public TPathsDump pathsDump; // optional
+  public long seqNum; // required
+  public List<TPathChanges> pathChanges; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -191,9 +190,10 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
     return this.hasFullImage;
   }
 
-  public void setHasFullImage(boolean hasFullImage) {
+  public TPathsUpdate setHasFullImage(boolean hasFullImage) {
     this.hasFullImage = hasFullImage;
     setHasFullImageIsSet(true);
+    return this;
   }
 
   public void unsetHasFullImage() {
@@ -213,8 +213,9 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
     return this.pathsDump;
   }
 
-  public void setPathsDump(TPathsDump pathsDump) {
+  public TPathsUpdate setPathsDump(TPathsDump pathsDump) {
     this.pathsDump = pathsDump;
+    return this;
   }
 
   public void unsetPathsDump() {
@@ -236,9 +237,10 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
     return this.seqNum;
   }
 
-  public void setSeqNum(long seqNum) {
+  public TPathsUpdate setSeqNum(long seqNum) {
     this.seqNum = seqNum;
     setSeqNumIsSet(true);
+    return this;
   }
 
   public void unsetSeqNum() {
@@ -273,8 +275,9 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
     return this.pathChanges;
   }
 
-  public void setPathChanges(List<TPathChanges> pathChanges) {
+  public TPathsUpdate setPathChanges(List<TPathChanges> pathChanges) {
     this.pathChanges = pathChanges;
+    return this;
   }
 
   public void unsetPathChanges() {
@@ -420,29 +423,7 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
 
   @Override
   public int hashCode() {
-    HashCodeBuilder builder = new HashCodeBuilder();
-
-    boolean present_hasFullImage = true;
-    builder.append(present_hasFullImage);
-    if (present_hasFullImage)
-      builder.append(hasFullImage);
-
-    boolean present_pathsDump = true && (isSetPathsDump());
-    builder.append(present_pathsDump);
-    if (present_pathsDump)
-      builder.append(pathsDump);
-
-    boolean present_seqNum = true;
-    builder.append(present_seqNum);
-    if (present_seqNum)
-      builder.append(seqNum);
-
-    boolean present_pathChanges = true && (isSetPathChanges());
-    builder.append(present_pathChanges);
-    if (present_pathChanges)
-      builder.append(pathChanges);
-
-    return builder.toHashCode();
+    return 0;
   }
 
   public int compareTo(TPathsUpdate other) {
@@ -544,18 +525,11 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
-    if (!isSetHasFullImage()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasFullImage' is unset! Struct:" + toString());
-    }
-
-    if (!isSetSeqNum()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'seqNum' is unset! Struct:" + toString());
-    }
-
-    if (!isSetPathChanges()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'pathChanges' is unset! Struct:" + toString());
+    // alas, we cannot check 'hasFullImage' because it's a primitive and you chose the non-beans generator.
+    // alas, we cannot check 'seqNum' because it's a primitive and you chose the non-beans generator.
+    if (pathChanges == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'pathChanges' was not present! Struct: " + toString());
     }
-
     // check for sub-struct validity
     if (pathsDump != null) {
       pathsDump.validate();
@@ -626,14 +600,14 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
           case 4: // PATH_CHANGES
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list50 = iprot.readListBegin();
-                struct.pathChanges = new ArrayList<TPathChanges>(_list50.size);
-                for (int _i51 = 0; _i51 < _list50.size; ++_i51)
+                org.apache.thrift.protocol.TList _list58 = iprot.readListBegin();
+                struct.pathChanges = new ArrayList<TPathChanges>(_list58.size);
+                for (int _i59 = 0; _i59 < _list58.size; ++_i59)
                 {
-                  TPathChanges _elem52; // required
-                  _elem52 = new TPathChanges();
-                  _elem52.read(iprot);
-                  struct.pathChanges.add(_elem52);
+                  TPathChanges _elem60; // required
+                  _elem60 = new TPathChanges();
+                  _elem60.read(iprot);
+                  struct.pathChanges.add(_elem60);
                 }
                 iprot.readListEnd();
               }
@@ -648,6 +622,14 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
         iprot.readFieldEnd();
       }
       iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      if (!struct.isSetHasFullImage()) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasFullImage' was not found in serialized data! Struct: " + toString());
+      }
+      if (!struct.isSetSeqNum()) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'seqNum' was not found in serialized data! Struct: " + toString());
+      }
       struct.validate();
     }
 
@@ -672,9 +654,9 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
         oprot.writeFieldBegin(PATH_CHANGES_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.pathChanges.size()));
-          for (TPathChanges _iter53 : struct.pathChanges)
+          for (TPathChanges _iter61 : struct.pathChanges)
           {
-            _iter53.write(oprot);
+            _iter61.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -701,9 +683,9 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
       oprot.writeI64(struct.seqNum);
       {
         oprot.writeI32(struct.pathChanges.size());
-        for (TPathChanges _iter54 : struct.pathChanges)
+        for (TPathChanges _iter62 : struct.pathChanges)
         {
-          _iter54.write(oprot);
+          _iter62.write(oprot);
         }
       }
       BitSet optionals = new BitSet();
@@ -724,14 +706,14 @@ public class TPathsUpdate implements org.apache.thrift.TBase<TPathsUpdate, TPath
       struct.seqNum = iprot.readI64();
       struct.setSeqNumIsSet(true);
       {
-        org.apache.thrift.protocol.TList _list55 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-        struct.pathChanges = new ArrayList<TPathChanges>(_list55.size);
-        for (int _i56 = 0; _i56 < _list55.size; ++_i56)
+        org.apache.thrift.protocol.TList _list63 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+        struct.pathChanges = new ArrayList<TPathChanges>(_list63.size);
+        for (int _i64 = 0; _i64 < _list63.size; ++_i64)
         {
-          TPathChanges _elem57; // required
-          _elem57 = new TPathChanges();
-          _elem57.read(iprot);
-          struct.pathChanges.add(_elem57);
+          TPathChanges _elem65; // required
+          _elem65 = new TPathChanges();
+          _elem65.read(iprot);
+          struct.pathChanges.add(_elem65);
         }
       }
       struct.setPathChangesIsSet(true);


[2/3] incubator-sentry git commit: SENTRY-953: External Partitions which are referenced by more than one table can cause some unexpected behavior with Sentry HDFS sync ( Hao Hao, Reviewed by: Sravya Tirukkovalur)

Posted by sr...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPermissionsUpdate.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPermissionsUpdate.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPermissionsUpdate.java
index 850404b..f2fefda 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPermissionsUpdate.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPermissionsUpdate.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -45,10 +44,10 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
     schemes.put(TupleScheme.class, new TPermissionsUpdateTupleSchemeFactory());
   }
 
-  private boolean hasfullImage; // required
-  private long seqNum; // required
-  private Map<String,TPrivilegeChanges> privilegeChanges; // required
-  private Map<String,TRoleChanges> roleChanges; // required
+  public boolean hasfullImage; // required
+  public long seqNum; // required
+  public Map<String,TPrivilegeChanges> privilegeChanges; // required
+  public Map<String,TRoleChanges> roleChanges; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -215,9 +214,10 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
     return this.hasfullImage;
   }
 
-  public void setHasfullImage(boolean hasfullImage) {
+  public TPermissionsUpdate setHasfullImage(boolean hasfullImage) {
     this.hasfullImage = hasfullImage;
     setHasfullImageIsSet(true);
+    return this;
   }
 
   public void unsetHasfullImage() {
@@ -237,9 +237,10 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
     return this.seqNum;
   }
 
-  public void setSeqNum(long seqNum) {
+  public TPermissionsUpdate setSeqNum(long seqNum) {
     this.seqNum = seqNum;
     setSeqNumIsSet(true);
+    return this;
   }
 
   public void unsetSeqNum() {
@@ -270,8 +271,9 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
     return this.privilegeChanges;
   }
 
-  public void setPrivilegeChanges(Map<String,TPrivilegeChanges> privilegeChanges) {
+  public TPermissionsUpdate setPrivilegeChanges(Map<String,TPrivilegeChanges> privilegeChanges) {
     this.privilegeChanges = privilegeChanges;
+    return this;
   }
 
   public void unsetPrivilegeChanges() {
@@ -304,8 +306,9 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
     return this.roleChanges;
   }
 
-  public void setRoleChanges(Map<String,TRoleChanges> roleChanges) {
+  public TPermissionsUpdate setRoleChanges(Map<String,TRoleChanges> roleChanges) {
     this.roleChanges = roleChanges;
+    return this;
   }
 
   public void unsetRoleChanges() {
@@ -451,29 +454,7 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
 
   @Override
   public int hashCode() {
-    HashCodeBuilder builder = new HashCodeBuilder();
-
-    boolean present_hasfullImage = true;
-    builder.append(present_hasfullImage);
-    if (present_hasfullImage)
-      builder.append(hasfullImage);
-
-    boolean present_seqNum = true;
-    builder.append(present_seqNum);
-    if (present_seqNum)
-      builder.append(seqNum);
-
-    boolean present_privilegeChanges = true && (isSetPrivilegeChanges());
-    builder.append(present_privilegeChanges);
-    if (present_privilegeChanges)
-      builder.append(privilegeChanges);
-
-    boolean present_roleChanges = true && (isSetRoleChanges());
-    builder.append(present_roleChanges);
-    if (present_roleChanges)
-      builder.append(roleChanges);
-
-    return builder.toHashCode();
+    return 0;
   }
 
   public int compareTo(TPermissionsUpdate other) {
@@ -573,22 +554,14 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
-    if (!isSetHasfullImage()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasfullImage' is unset! Struct:" + toString());
+    // alas, we cannot check 'hasfullImage' because it's a primitive and you chose the non-beans generator.
+    // alas, we cannot check 'seqNum' because it's a primitive and you chose the non-beans generator.
+    if (privilegeChanges == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'privilegeChanges' was not present! Struct: " + toString());
     }
-
-    if (!isSetSeqNum()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'seqNum' is unset! Struct:" + toString());
+    if (roleChanges == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleChanges' was not present! Struct: " + toString());
     }
-
-    if (!isSetPrivilegeChanges()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'privilegeChanges' is unset! Struct:" + toString());
-    }
-
-    if (!isSetRoleChanges()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleChanges' is unset! Struct:" + toString());
-    }
-
     // check for sub-struct validity
   }
 
@@ -647,16 +620,16 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
           case 3: // PRIVILEGE_CHANGES
             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
               {
-                org.apache.thrift.protocol.TMap _map94 = iprot.readMapBegin();
-                struct.privilegeChanges = new HashMap<String,TPrivilegeChanges>(2*_map94.size);
-                for (int _i95 = 0; _i95 < _map94.size; ++_i95)
+                org.apache.thrift.protocol.TMap _map102 = iprot.readMapBegin();
+                struct.privilegeChanges = new HashMap<String,TPrivilegeChanges>(2*_map102.size);
+                for (int _i103 = 0; _i103 < _map102.size; ++_i103)
                 {
-                  String _key96; // required
-                  TPrivilegeChanges _val97; // required
-                  _key96 = iprot.readString();
-                  _val97 = new TPrivilegeChanges();
-                  _val97.read(iprot);
-                  struct.privilegeChanges.put(_key96, _val97);
+                  String _key104; // required
+                  TPrivilegeChanges _val105; // required
+                  _key104 = iprot.readString();
+                  _val105 = new TPrivilegeChanges();
+                  _val105.read(iprot);
+                  struct.privilegeChanges.put(_key104, _val105);
                 }
                 iprot.readMapEnd();
               }
@@ -668,16 +641,16 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
           case 4: // ROLE_CHANGES
             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
               {
-                org.apache.thrift.protocol.TMap _map98 = iprot.readMapBegin();
-                struct.roleChanges = new HashMap<String,TRoleChanges>(2*_map98.size);
-                for (int _i99 = 0; _i99 < _map98.size; ++_i99)
+                org.apache.thrift.protocol.TMap _map106 = iprot.readMapBegin();
+                struct.roleChanges = new HashMap<String,TRoleChanges>(2*_map106.size);
+                for (int _i107 = 0; _i107 < _map106.size; ++_i107)
                 {
-                  String _key100; // required
-                  TRoleChanges _val101; // required
-                  _key100 = iprot.readString();
-                  _val101 = new TRoleChanges();
-                  _val101.read(iprot);
-                  struct.roleChanges.put(_key100, _val101);
+                  String _key108; // required
+                  TRoleChanges _val109; // required
+                  _key108 = iprot.readString();
+                  _val109 = new TRoleChanges();
+                  _val109.read(iprot);
+                  struct.roleChanges.put(_key108, _val109);
                 }
                 iprot.readMapEnd();
               }
@@ -692,6 +665,14 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
         iprot.readFieldEnd();
       }
       iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      if (!struct.isSetHasfullImage()) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasfullImage' was not found in serialized data! Struct: " + toString());
+      }
+      if (!struct.isSetSeqNum()) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'seqNum' was not found in serialized data! Struct: " + toString());
+      }
       struct.validate();
     }
 
@@ -709,10 +690,10 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
         oprot.writeFieldBegin(PRIVILEGE_CHANGES_FIELD_DESC);
         {
           oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.privilegeChanges.size()));
-          for (Map.Entry<String, TPrivilegeChanges> _iter102 : struct.privilegeChanges.entrySet())
+          for (Map.Entry<String, TPrivilegeChanges> _iter110 : struct.privilegeChanges.entrySet())
           {
-            oprot.writeString(_iter102.getKey());
-            _iter102.getValue().write(oprot);
+            oprot.writeString(_iter110.getKey());
+            _iter110.getValue().write(oprot);
           }
           oprot.writeMapEnd();
         }
@@ -722,10 +703,10 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
         oprot.writeFieldBegin(ROLE_CHANGES_FIELD_DESC);
         {
           oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.roleChanges.size()));
-          for (Map.Entry<String, TRoleChanges> _iter103 : struct.roleChanges.entrySet())
+          for (Map.Entry<String, TRoleChanges> _iter111 : struct.roleChanges.entrySet())
           {
-            oprot.writeString(_iter103.getKey());
-            _iter103.getValue().write(oprot);
+            oprot.writeString(_iter111.getKey());
+            _iter111.getValue().write(oprot);
           }
           oprot.writeMapEnd();
         }
@@ -752,18 +733,18 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
       oprot.writeI64(struct.seqNum);
       {
         oprot.writeI32(struct.privilegeChanges.size());
-        for (Map.Entry<String, TPrivilegeChanges> _iter104 : struct.privilegeChanges.entrySet())
+        for (Map.Entry<String, TPrivilegeChanges> _iter112 : struct.privilegeChanges.entrySet())
         {
-          oprot.writeString(_iter104.getKey());
-          _iter104.getValue().write(oprot);
+          oprot.writeString(_iter112.getKey());
+          _iter112.getValue().write(oprot);
         }
       }
       {
         oprot.writeI32(struct.roleChanges.size());
-        for (Map.Entry<String, TRoleChanges> _iter105 : struct.roleChanges.entrySet())
+        for (Map.Entry<String, TRoleChanges> _iter113 : struct.roleChanges.entrySet())
         {
-          oprot.writeString(_iter105.getKey());
-          _iter105.getValue().write(oprot);
+          oprot.writeString(_iter113.getKey());
+          _iter113.getValue().write(oprot);
         }
       }
     }
@@ -776,30 +757,30 @@ public class TPermissionsUpdate implements org.apache.thrift.TBase<TPermissionsU
       struct.seqNum = iprot.readI64();
       struct.setSeqNumIsSet(true);
       {
-        org.apache.thrift.protocol.TMap _map106 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-        struct.privilegeChanges = new HashMap<String,TPrivilegeChanges>(2*_map106.size);
-        for (int _i107 = 0; _i107 < _map106.size; ++_i107)
+        org.apache.thrift.protocol.TMap _map114 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+        struct.privilegeChanges = new HashMap<String,TPrivilegeChanges>(2*_map114.size);
+        for (int _i115 = 0; _i115 < _map114.size; ++_i115)
         {
-          String _key108; // required
-          TPrivilegeChanges _val109; // required
-          _key108 = iprot.readString();
-          _val109 = new TPrivilegeChanges();
-          _val109.read(iprot);
-          struct.privilegeChanges.put(_key108, _val109);
+          String _key116; // required
+          TPrivilegeChanges _val117; // required
+          _key116 = iprot.readString();
+          _val117 = new TPrivilegeChanges();
+          _val117.read(iprot);
+          struct.privilegeChanges.put(_key116, _val117);
         }
       }
       struct.setPrivilegeChangesIsSet(true);
       {
-        org.apache.thrift.protocol.TMap _map110 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-        struct.roleChanges = new HashMap<String,TRoleChanges>(2*_map110.size);
-        for (int _i111 = 0; _i111 < _map110.size; ++_i111)
+        org.apache.thrift.protocol.TMap _map118 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+        struct.roleChanges = new HashMap<String,TRoleChanges>(2*_map118.size);
+        for (int _i119 = 0; _i119 < _map118.size; ++_i119)
         {
-          String _key112; // required
-          TRoleChanges _val113; // required
-          _key112 = iprot.readString();
-          _val113 = new TRoleChanges();
-          _val113.read(iprot);
-          struct.roleChanges.put(_key112, _val113);
+          String _key120; // required
+          TRoleChanges _val121; // required
+          _key120 = iprot.readString();
+          _val121 = new TRoleChanges();
+          _val121.read(iprot);
+          struct.roleChanges.put(_key120, _val121);
         }
       }
       struct.setRoleChangesIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPrivilegeChanges.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPrivilegeChanges.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPrivilegeChanges.java
index 76720b9..8aab38c 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPrivilegeChanges.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPrivilegeChanges.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -44,9 +43,9 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
     schemes.put(TupleScheme.class, new TPrivilegeChangesTupleSchemeFactory());
   }
 
-  private String authzObj; // required
-  private Map<String,String> addPrivileges; // required
-  private Map<String,String> delPrivileges; // required
+  public String authzObj; // required
+  public Map<String,String> addPrivileges; // required
+  public Map<String,String> delPrivileges; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -198,8 +197,9 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
     return this.authzObj;
   }
 
-  public void setAuthzObj(String authzObj) {
+  public TPrivilegeChanges setAuthzObj(String authzObj) {
     this.authzObj = authzObj;
+    return this;
   }
 
   public void unsetAuthzObj() {
@@ -232,8 +232,9 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
     return this.addPrivileges;
   }
 
-  public void setAddPrivileges(Map<String,String> addPrivileges) {
+  public TPrivilegeChanges setAddPrivileges(Map<String,String> addPrivileges) {
     this.addPrivileges = addPrivileges;
+    return this;
   }
 
   public void unsetAddPrivileges() {
@@ -266,8 +267,9 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
     return this.delPrivileges;
   }
 
-  public void setDelPrivileges(Map<String,String> delPrivileges) {
+  public TPrivilegeChanges setDelPrivileges(Map<String,String> delPrivileges) {
     this.delPrivileges = delPrivileges;
+    return this;
   }
 
   public void unsetDelPrivileges() {
@@ -391,24 +393,7 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
 
   @Override
   public int hashCode() {
-    HashCodeBuilder builder = new HashCodeBuilder();
-
-    boolean present_authzObj = true && (isSetAuthzObj());
-    builder.append(present_authzObj);
-    if (present_authzObj)
-      builder.append(authzObj);
-
-    boolean present_addPrivileges = true && (isSetAddPrivileges());
-    builder.append(present_addPrivileges);
-    if (present_addPrivileges)
-      builder.append(addPrivileges);
-
-    boolean present_delPrivileges = true && (isSetDelPrivileges());
-    builder.append(present_delPrivileges);
-    if (present_delPrivileges)
-      builder.append(delPrivileges);
-
-    return builder.toHashCode();
+    return 0;
   }
 
   public int compareTo(TPrivilegeChanges other) {
@@ -498,18 +483,15 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
 
   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 (authzObj == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzObj' was not present! Struct: " + toString());
     }
-
-    if (!isSetAddPrivileges()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'addPrivileges' is unset! Struct:" + toString());
+    if (addPrivileges == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'addPrivileges' was not present! Struct: " + toString());
     }
-
-    if (!isSetDelPrivileges()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'delPrivileges' is unset! Struct:" + toString());
+    if (delPrivileges == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'delPrivileges' was not present! Struct: " + toString());
     }
-
     // check for sub-struct validity
   }
 
@@ -558,15 +540,15 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
           case 2: // ADD_PRIVILEGES
             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
               {
-                org.apache.thrift.protocol.TMap _map58 = iprot.readMapBegin();
-                struct.addPrivileges = new HashMap<String,String>(2*_map58.size);
-                for (int _i59 = 0; _i59 < _map58.size; ++_i59)
+                org.apache.thrift.protocol.TMap _map66 = iprot.readMapBegin();
+                struct.addPrivileges = new HashMap<String,String>(2*_map66.size);
+                for (int _i67 = 0; _i67 < _map66.size; ++_i67)
                 {
-                  String _key60; // required
-                  String _val61; // required
-                  _key60 = iprot.readString();
-                  _val61 = iprot.readString();
-                  struct.addPrivileges.put(_key60, _val61);
+                  String _key68; // required
+                  String _val69; // required
+                  _key68 = iprot.readString();
+                  _val69 = iprot.readString();
+                  struct.addPrivileges.put(_key68, _val69);
                 }
                 iprot.readMapEnd();
               }
@@ -578,15 +560,15 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
           case 3: // DEL_PRIVILEGES
             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
               {
-                org.apache.thrift.protocol.TMap _map62 = iprot.readMapBegin();
-                struct.delPrivileges = new HashMap<String,String>(2*_map62.size);
-                for (int _i63 = 0; _i63 < _map62.size; ++_i63)
+                org.apache.thrift.protocol.TMap _map70 = iprot.readMapBegin();
+                struct.delPrivileges = new HashMap<String,String>(2*_map70.size);
+                for (int _i71 = 0; _i71 < _map70.size; ++_i71)
                 {
-                  String _key64; // required
-                  String _val65; // required
-                  _key64 = iprot.readString();
-                  _val65 = iprot.readString();
-                  struct.delPrivileges.put(_key64, _val65);
+                  String _key72; // required
+                  String _val73; // required
+                  _key72 = iprot.readString();
+                  _val73 = iprot.readString();
+                  struct.delPrivileges.put(_key72, _val73);
                 }
                 iprot.readMapEnd();
               }
@@ -601,6 +583,8 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
         iprot.readFieldEnd();
       }
       iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
       struct.validate();
     }
 
@@ -617,10 +601,10 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
         oprot.writeFieldBegin(ADD_PRIVILEGES_FIELD_DESC);
         {
           oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.addPrivileges.size()));
-          for (Map.Entry<String, String> _iter66 : struct.addPrivileges.entrySet())
+          for (Map.Entry<String, String> _iter74 : struct.addPrivileges.entrySet())
           {
-            oprot.writeString(_iter66.getKey());
-            oprot.writeString(_iter66.getValue());
+            oprot.writeString(_iter74.getKey());
+            oprot.writeString(_iter74.getValue());
           }
           oprot.writeMapEnd();
         }
@@ -630,10 +614,10 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
         oprot.writeFieldBegin(DEL_PRIVILEGES_FIELD_DESC);
         {
           oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.delPrivileges.size()));
-          for (Map.Entry<String, String> _iter67 : struct.delPrivileges.entrySet())
+          for (Map.Entry<String, String> _iter75 : struct.delPrivileges.entrySet())
           {
-            oprot.writeString(_iter67.getKey());
-            oprot.writeString(_iter67.getValue());
+            oprot.writeString(_iter75.getKey());
+            oprot.writeString(_iter75.getValue());
           }
           oprot.writeMapEnd();
         }
@@ -659,18 +643,18 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
       oprot.writeString(struct.authzObj);
       {
         oprot.writeI32(struct.addPrivileges.size());
-        for (Map.Entry<String, String> _iter68 : struct.addPrivileges.entrySet())
+        for (Map.Entry<String, String> _iter76 : struct.addPrivileges.entrySet())
         {
-          oprot.writeString(_iter68.getKey());
-          oprot.writeString(_iter68.getValue());
+          oprot.writeString(_iter76.getKey());
+          oprot.writeString(_iter76.getValue());
         }
       }
       {
         oprot.writeI32(struct.delPrivileges.size());
-        for (Map.Entry<String, String> _iter69 : struct.delPrivileges.entrySet())
+        for (Map.Entry<String, String> _iter77 : struct.delPrivileges.entrySet())
         {
-          oprot.writeString(_iter69.getKey());
-          oprot.writeString(_iter69.getValue());
+          oprot.writeString(_iter77.getKey());
+          oprot.writeString(_iter77.getValue());
         }
       }
     }
@@ -681,28 +665,28 @@ public class TPrivilegeChanges implements org.apache.thrift.TBase<TPrivilegeChan
       struct.authzObj = iprot.readString();
       struct.setAuthzObjIsSet(true);
       {
-        org.apache.thrift.protocol.TMap _map70 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-        struct.addPrivileges = new HashMap<String,String>(2*_map70.size);
-        for (int _i71 = 0; _i71 < _map70.size; ++_i71)
+        org.apache.thrift.protocol.TMap _map78 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+        struct.addPrivileges = new HashMap<String,String>(2*_map78.size);
+        for (int _i79 = 0; _i79 < _map78.size; ++_i79)
         {
-          String _key72; // required
-          String _val73; // required
-          _key72 = iprot.readString();
-          _val73 = iprot.readString();
-          struct.addPrivileges.put(_key72, _val73);
+          String _key80; // required
+          String _val81; // required
+          _key80 = iprot.readString();
+          _val81 = iprot.readString();
+          struct.addPrivileges.put(_key80, _val81);
         }
       }
       struct.setAddPrivilegesIsSet(true);
       {
-        org.apache.thrift.protocol.TMap _map74 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-        struct.delPrivileges = new HashMap<String,String>(2*_map74.size);
-        for (int _i75 = 0; _i75 < _map74.size; ++_i75)
+        org.apache.thrift.protocol.TMap _map82 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+        struct.delPrivileges = new HashMap<String,String>(2*_map82.size);
+        for (int _i83 = 0; _i83 < _map82.size; ++_i83)
         {
-          String _key76; // required
-          String _val77; // required
-          _key76 = iprot.readString();
-          _val77 = iprot.readString();
-          struct.delPrivileges.put(_key76, _val77);
+          String _key84; // required
+          String _val85; // required
+          _key84 = iprot.readString();
+          _val85 = iprot.readString();
+          struct.delPrivileges.put(_key84, _val85);
         }
       }
       struct.setDelPrivilegesIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TRoleChanges.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TRoleChanges.java b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TRoleChanges.java
index 87ef02d..41ede03 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TRoleChanges.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TRoleChanges.java
@@ -6,7 +6,6 @@
  */
 package org.apache.sentry.hdfs.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;
@@ -44,9 +43,9 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
     schemes.put(TupleScheme.class, new TRoleChangesTupleSchemeFactory());
   }
 
-  private String role; // required
-  private List<String> addGroups; // required
-  private List<String> delGroups; // required
+  public String role; // required
+  public List<String> addGroups; // required
+  public List<String> delGroups; // 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 {
@@ -180,8 +179,9 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
     return this.role;
   }
 
-  public void setRole(String role) {
+  public TRoleChanges setRole(String role) {
     this.role = role;
+    return this;
   }
 
   public void unsetRole() {
@@ -218,8 +218,9 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
     return this.addGroups;
   }
 
-  public void setAddGroups(List<String> addGroups) {
+  public TRoleChanges setAddGroups(List<String> addGroups) {
     this.addGroups = addGroups;
+    return this;
   }
 
   public void unsetAddGroups() {
@@ -256,8 +257,9 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
     return this.delGroups;
   }
 
-  public void setDelGroups(List<String> delGroups) {
+  public TRoleChanges setDelGroups(List<String> delGroups) {
     this.delGroups = delGroups;
+    return this;
   }
 
   public void unsetDelGroups() {
@@ -381,24 +383,7 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
 
   @Override
   public int hashCode() {
-    HashCodeBuilder builder = new HashCodeBuilder();
-
-    boolean present_role = true && (isSetRole());
-    builder.append(present_role);
-    if (present_role)
-      builder.append(role);
-
-    boolean present_addGroups = true && (isSetAddGroups());
-    builder.append(present_addGroups);
-    if (present_addGroups)
-      builder.append(addGroups);
-
-    boolean present_delGroups = true && (isSetDelGroups());
-    builder.append(present_delGroups);
-    if (present_delGroups)
-      builder.append(delGroups);
-
-    return builder.toHashCode();
+    return 0;
   }
 
   public int compareTo(TRoleChanges other) {
@@ -488,18 +473,15 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
-    if (!isSetRole()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'role' is unset! Struct:" + toString());
+    if (role == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'role' was not present! Struct: " + toString());
     }
-
-    if (!isSetAddGroups()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'addGroups' is unset! Struct:" + toString());
+    if (addGroups == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'addGroups' was not present! Struct: " + toString());
     }
-
-    if (!isSetDelGroups()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'delGroups' is unset! Struct:" + toString());
+    if (delGroups == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'delGroups' was not present! Struct: " + toString());
     }
-
     // check for sub-struct validity
   }
 
@@ -548,13 +530,13 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
           case 2: // ADD_GROUPS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list78 = iprot.readListBegin();
-                struct.addGroups = new ArrayList<String>(_list78.size);
-                for (int _i79 = 0; _i79 < _list78.size; ++_i79)
+                org.apache.thrift.protocol.TList _list86 = iprot.readListBegin();
+                struct.addGroups = new ArrayList<String>(_list86.size);
+                for (int _i87 = 0; _i87 < _list86.size; ++_i87)
                 {
-                  String _elem80; // required
-                  _elem80 = iprot.readString();
-                  struct.addGroups.add(_elem80);
+                  String _elem88; // required
+                  _elem88 = iprot.readString();
+                  struct.addGroups.add(_elem88);
                 }
                 iprot.readListEnd();
               }
@@ -566,13 +548,13 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
           case 3: // DEL_GROUPS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list81 = iprot.readListBegin();
-                struct.delGroups = new ArrayList<String>(_list81.size);
-                for (int _i82 = 0; _i82 < _list81.size; ++_i82)
+                org.apache.thrift.protocol.TList _list89 = iprot.readListBegin();
+                struct.delGroups = new ArrayList<String>(_list89.size);
+                for (int _i90 = 0; _i90 < _list89.size; ++_i90)
                 {
-                  String _elem83; // required
-                  _elem83 = iprot.readString();
-                  struct.delGroups.add(_elem83);
+                  String _elem91; // required
+                  _elem91 = iprot.readString();
+                  struct.delGroups.add(_elem91);
                 }
                 iprot.readListEnd();
               }
@@ -587,6 +569,8 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
         iprot.readFieldEnd();
       }
       iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
       struct.validate();
     }
 
@@ -603,9 +587,9 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
         oprot.writeFieldBegin(ADD_GROUPS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.addGroups.size()));
-          for (String _iter84 : struct.addGroups)
+          for (String _iter92 : struct.addGroups)
           {
-            oprot.writeString(_iter84);
+            oprot.writeString(_iter92);
           }
           oprot.writeListEnd();
         }
@@ -615,9 +599,9 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
         oprot.writeFieldBegin(DEL_GROUPS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.delGroups.size()));
-          for (String _iter85 : struct.delGroups)
+          for (String _iter93 : struct.delGroups)
           {
-            oprot.writeString(_iter85);
+            oprot.writeString(_iter93);
           }
           oprot.writeListEnd();
         }
@@ -643,16 +627,16 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
       oprot.writeString(struct.role);
       {
         oprot.writeI32(struct.addGroups.size());
-        for (String _iter86 : struct.addGroups)
+        for (String _iter94 : struct.addGroups)
         {
-          oprot.writeString(_iter86);
+          oprot.writeString(_iter94);
         }
       }
       {
         oprot.writeI32(struct.delGroups.size());
-        for (String _iter87 : struct.delGroups)
+        for (String _iter95 : struct.delGroups)
         {
-          oprot.writeString(_iter87);
+          oprot.writeString(_iter95);
         }
       }
     }
@@ -663,24 +647,24 @@ public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRole
       struct.role = iprot.readString();
       struct.setRoleIsSet(true);
       {
-        org.apache.thrift.protocol.TList _list88 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-        struct.addGroups = new ArrayList<String>(_list88.size);
-        for (int _i89 = 0; _i89 < _list88.size; ++_i89)
+        org.apache.thrift.protocol.TList _list96 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+        struct.addGroups = new ArrayList<String>(_list96.size);
+        for (int _i97 = 0; _i97 < _list96.size; ++_i97)
         {
-          String _elem90; // required
-          _elem90 = iprot.readString();
-          struct.addGroups.add(_elem90);
+          String _elem98; // required
+          _elem98 = iprot.readString();
+          struct.addGroups.add(_elem98);
         }
       }
       struct.setAddGroupsIsSet(true);
       {
-        org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-        struct.delGroups = new ArrayList<String>(_list91.size);
-        for (int _i92 = 0; _i92 < _list91.size; ++_i92)
+        org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+        struct.delGroups = new ArrayList<String>(_list99.size);
+        for (int _i100 = 0; _i100 < _list99.size; ++_i100)
         {
-          String _elem93; // required
-          _elem93 = iprot.readString();
-          struct.delGroups.add(_elem93);
+          String _elem101; // required
+          _elem101 = iprot.readString();
+          struct.delGroups.add(_elem101);
         }
       }
       struct.setDelGroupsIsSet(true);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/AuthzPaths.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/AuthzPaths.java b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/AuthzPaths.java
index ba16f4a..7dda9fb 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/AuthzPaths.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/AuthzPaths.java
@@ -17,6 +17,8 @@
  */
 package org.apache.sentry.hdfs;
 
+import java.util.Set;
+
 /**
  * A public interface of the fundamental APIs exposed by the implementing
  * data structure. The primary client of this interface is the Namenode
@@ -25,34 +27,39 @@ package org.apache.sentry.hdfs;
 public interface AuthzPaths {
 
   /**
-   * Check if a Path belongs to the configured prefix set
-   * @param pathElements : A path split into segments
-   * @return Is Path under configured prefix
+   * Check if a Path belongs to the configured prefix set.
+   *
+   * @param pathElements A path split into segments
+   * @return Returns if Path under configured prefix or not.
    */
-  public boolean isUnderPrefix(String[] pathElements);
+   boolean isUnderPrefix(String[] pathElements);
 
   /**
-   * Returns the authorizable Object (database/table) associated with this path.
-   * Unlike {@link #findAuthzObjectExactMatch(String[])}, if not match is
-   * found, it will return the first ancestor that has an associated
-   * authorizable object.
-   * @param pathElements : A path split into segments
-   * @return A authzObject associated with this path
+   * Returns all authorizable Objects (database/table/partition) associated
+   * with this path. Unlike {@link #findAuthzObjectExactMatches(String[])},
+   * if not match is found, it will return the first ancestor that has the
+   * associated authorizable objects.
+   *
+   * @param pathElements A path split into segments
+   * @return Returns a set of authzObjects authzObject associated with this path
    */
-  public String findAuthzObject(String[] pathElements);
+   Set<String> findAuthzObject(String[] pathElements);
 
   /**
-   * Returns the authorizable Object (database/table) associated with this path.
-   * @param pathElements : A path split into segments
-   * @return A authzObject associated with this path
+   * Returns all authorizable Objects (database/table/partition) associated
+   * with this path.
+   *
+   * @param pathElements A path split into segments
+   * @return Returns a set of authzObjects associated with this path
    */
-  public String findAuthzObjectExactMatch(String[] pathElements);
+   Set<String> findAuthzObjectExactMatches(String[] pathElements);
 
   /**
    * Return a Dumper that may return a more optimized over the
    * wire representation of the internal data-structures.
-   * @return
+   *
+   * @return Returns the AuthzPathsDumper.
    */
-  public AuthzPathsDumper<? extends AuthzPaths> getPathsDump();
+   AuthzPathsDumper<? extends AuthzPaths> getPathsDump();
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java
index d52e361..4b38def 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java
@@ -17,19 +17,16 @@
  */
 package org.apache.sentry.hdfs;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
+import com.google.common.base.Joiner;
 import org.apache.hadoop.fs.Path;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A non thread-safe implementation of {@link AuthzPaths}. It abstracts over the
@@ -39,6 +36,8 @@ import com.google.common.collect.Lists;
  */
 public class HMSPaths implements AuthzPaths {
 
+  private static Logger LOG = LoggerFactory.getLogger(HMSPaths.class);
+
   @VisibleForTesting
   static List<String> getPathElements(String path) {
     path = path.trim();
@@ -63,7 +62,7 @@ public class HMSPaths implements AuthzPaths {
   }
 
   @VisibleForTesting
-  static List<List<String>> gePathsElements(List<String> paths) {
+  static List<List<String>> getPathsElements(List<String> paths) {
     List<List<String>> pathsElements = new ArrayList<List<String>>(paths.size());
     for (String path : paths) {
       pathsElements.add(getPathElements(path));
@@ -110,7 +109,13 @@ public class HMSPaths implements AuthzPaths {
     private Entry parent;
     private EntryType type;
     private String pathElement;
-    private String authzObj;
+
+    // A set of authorizable objects associated with this entry. Authorizable
+    // object should be case insensitive.
+    private Set<String> authzObjs;
+
+    // Path of child element to the path entry mapping.
+    // e.g. 'b' -> '/a/b'
     private final Map<String, Entry> children;
 
     Entry(Entry parent, String pathElement, EntryType type,
@@ -118,12 +123,47 @@ public class HMSPaths implements AuthzPaths {
       this.parent = parent;
       this.type = type;
       this.pathElement = pathElement;
-      this.authzObj = authzObj;
+      this.authzObjs = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+      addAuthzObj(authzObj);
+      children = new HashMap<String, Entry>();
+    }
+
+    Entry(Entry parent, String pathElement, EntryType type,
+          Set<String> authzObjs) {
+      this.parent = parent;
+      this.type = type;
+      this.pathElement = pathElement;
+      this.authzObjs = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+      addAuthzObjs(authzObjs);
       children = new HashMap<String, Entry>();
     }
 
-    void setAuthzObj(String authzObj) {
-      this.authzObj = authzObj;
+    // Get all the mapping of the children element to
+    // the path entries.
+    public Map<String, Entry> getChildren() {
+      return children;
+    }
+
+    void clearAuthzObjs() {
+      authzObjs = new HashSet<String>();
+    }
+
+    void removeAuthzObj(String authzObj) {
+      authzObjs.remove(authzObj);
+    }
+
+    void addAuthzObj(String authzObj) {
+      if (authzObj != null) {
+        authzObjs.add(authzObj);
+      }
+    }
+
+    void addAuthzObjs(Set<String> authzObjs) {
+      if (authzObjs != null) {
+        for (String authObj : authzObjs) {
+          this.authzObjs.add(authObj);
+        }
+      }
     }
 
     private void setType(EntryType type) {
@@ -136,42 +176,64 @@ public class HMSPaths implements AuthzPaths {
 
     public String toString() {
       return String.format("Entry[fullPath: %s, type: %s, authObject: %s]",
-          getFullPath(), type, authzObj);
-    }
-
+          getFullPath(), type, Joiner.on(",").join(authzObjs));
+    }
+
+    /**
+     * Create a child entry based on the path, type and authzObj that
+     * associates with it.
+     *
+     * @param  pathElements  a path split into segments.
+     * @param  type the type of the child entry.
+     * @param  authzObj the authorizable Object associates with the entry.
+     * @return  Returns the child entry.
+     */
     private Entry createChild(List<String> pathElements, EntryType type,
         String authzObj) {
+
+      // Parent entry is the current referring one.
       Entry entryParent = this;
+
+      // Creates the entry based on the path elements (if not found) until reaches its
+      // direct parent.
       for (int i = 0; i < pathElements.size() - 1; i++) {
+
         String pathElement = pathElements.get(i);
         Entry child = entryParent.getChildren().get(pathElement);
+
         if (child == null) {
-          child = new Entry(entryParent, pathElement, EntryType.DIR, null);
+          child = new Entry(entryParent, pathElement, EntryType.DIR, (String) null);
           entryParent.getChildren().put(pathElement, child);
         }
+
         entryParent = child;
       }
+
       String lastPathElement = pathElements.get(pathElements.size() - 1);
       Entry child = entryParent.getChildren().get(lastPathElement);
+
+      // Create the child entry if not found. If found and the entry is
+      // already a prefix or authzObj type, then only add the authzObj.
+      // If the entry already existed as dir, we change it to be a authzObj,
+      // and add the authzObj.
       if (child == null) {
         child = new Entry(entryParent, lastPathElement, type, authzObj);
         entryParent.getChildren().put(lastPathElement, child);
       } else if (type == EntryType.AUTHZ_OBJECT &&
-          child.getType() == EntryType.PREFIX) {
-        // Support for default db in hive (which is usually a prefix dir)
-        child.setAuthzObj(authzObj);
+          (child.getType() == EntryType.PREFIX || child.getType() == EntryType.AUTHZ_OBJECT)) {
+        child.addAuthzObj(authzObj);
       } else if (type == EntryType.AUTHZ_OBJECT &&
           child.getType() == EntryType.DIR) {
-        // if the entry already existed as dir, we change it  to be a authz obj
-        child.setAuthzObj(authzObj);
+        child.addAuthzObj(authzObj);
         child.setType(EntryType.AUTHZ_OBJECT);
       }
+
       return child;
     }
 
     public static Entry createRoot(boolean asPrefix) {
-      return new Entry(null, "/", (asPrefix) 
-                                   ? EntryType.PREFIX : EntryType.DIR, null);
+      return new Entry(null, "/", (asPrefix)
+                                   ? EntryType.PREFIX : EntryType.DIR, (String) null);
     }
 
     private String toPath(List<String> arr) {
@@ -202,6 +264,32 @@ public class HMSPaths implements AuthzPaths {
       return entry;
     }
 
+    public void deleteAuthzObject(String authzObj) {
+      if (getParent() != null) {
+        if (getChildren().isEmpty()) {
+
+          // Remove the authzObj on the path entry. If the path
+          // entry no longer maps to any authzObj, removes the
+          // entry recursively.
+          authzObjs.remove(authzObj);
+          if (authzObjs.size() == 0) {
+            getParent().getChildren().remove(getPathElement());
+            getParent().deleteIfDangling();
+            parent = null;
+          }
+        } else {
+
+          // if the entry was for an authz object and has children, we
+          // change it to be a dir entry. And remove the authzObj on
+          // the path entry.
+          if (getType() == EntryType.AUTHZ_OBJECT) {
+            setType(EntryType.DIR);
+            authzObjs.remove(authzObj);
+          }
+        }
+      }
+    }
+
     public void delete() {
       if (getParent() != null) {
         if (getChildren().isEmpty()) {
@@ -213,7 +301,7 @@ public class HMSPaths implements AuthzPaths {
           // change it to be a dir entry.
           if (getType() == EntryType.AUTHZ_OBJECT) {
             setType(EntryType.DIR);
-            setAuthzObj(null);
+            clearAuthzObjs();
           }
         }
       }
@@ -237,14 +325,11 @@ public class HMSPaths implements AuthzPaths {
       return pathElement;
     }
 
-    public String getAuthzObj() {
-      return authzObj;
+    public Set<String> getAuthzObjs() {
+      return authzObjs;
     }
 
-    @SuppressWarnings("unchecked")
-    public Map<String, Entry> getChildren() {
-      return children;
-    }
+
 
     public Entry findPrefixEntry(List<String> pathElements) {
       Preconditions.checkArgument(pathElements != null,
@@ -281,17 +366,17 @@ public class HMSPaths implements AuthzPaths {
         boolean isPartialMatchOk, Entry lastAuthObj) {
       Entry found = null;
       if (index == pathElements.length) {
-        if (isPartialMatchOk && (getAuthzObj() != null)) {
+        if (isPartialMatchOk && (getAuthzObjs().size() != 0)) {
           found = this;
         }
       } else {
         Entry child = getChildren().get(pathElements[index]);
         if (child != null) {
           if (index == pathElements.length - 1) {
-            found = (child.getAuthzObj() != null) ? child : lastAuthObj;
+            found = (child.getAuthzObjs().size() != 0) ? child : lastAuthObj;
           } else {
             found = child.find(pathElements, index + 1, isPartialMatchOk,
-                (child.getAuthzObj() != null) ? child : lastAuthObj);
+                (child.getAuthzObjs().size() != 0) ? child : lastAuthObj);
           }
         } else {
           if (isPartialMatchOk) {
@@ -322,6 +407,9 @@ public class HMSPaths implements AuthzPaths {
 
   private volatile Entry root;
   private String[] prefixes;
+
+  // The hive authorized objects to path entries mapping.
+  // One authorized object can map to a set of path entries.
   private Map<String, Set<Entry>> authzObjToPath;
 
   public HMSPaths(String[] pathPrefixes) {
@@ -340,11 +428,12 @@ public class HMSPaths implements AuthzPaths {
         root.createPrefix(getPathElements(pathPrefix));
       }
     }
-    authzObjToPath = new HashMap<String, Set<Entry>>();
+
+    authzObjToPath = new TreeMap<String, Set<Entry>>(String.CASE_INSENSITIVE_ORDER);
   }
 
   void _addAuthzObject(String authzObj, List<String> authzObjPaths) {
-    addAuthzObject(authzObj, gePathsElements(authzObjPaths));
+    addAuthzObject(authzObj, getPathsElements(authzObjPaths));
   }
 
   void addAuthzObject(String authzObj, List<List<String>> authzObjPathElements) {
@@ -363,7 +452,7 @@ public class HMSPaths implements AuthzPaths {
       previousEntries.removeAll(newEntries);
       if (!previousEntries.isEmpty()) {
         for (Entry entry : previousEntries) {
-          entry.delete();
+          entry.deleteAuthzObject(authzObj);
         }
       }
     }
@@ -392,7 +481,7 @@ public class HMSPaths implements AuthzPaths {
   }
 
   void _addPathsToAuthzObject(String authzObj, List<String> authzObjPaths) {
-    addPathsToAuthzObject(authzObj, gePathsElements(authzObjPaths), false);
+    addPathsToAuthzObject(authzObj, getPathsElements(authzObjPaths), false);
   }
 
   void addPathsToAuthzObject(String authzObj, List<List<String>> authzObjPaths) {
@@ -408,7 +497,7 @@ public class HMSPaths implements AuthzPaths {
         Entry entry = root.find(
             pathElements.toArray(new String[pathElements.size()]), false);
         if (entry != null) {
-          entry.delete();
+          entry.deleteAuthzObject(authzObj);
           toDelEntries.add(entry);
         } else {
           // LOG WARN IGNORING PATH, it was not in registered
@@ -424,30 +513,36 @@ public class HMSPaths implements AuthzPaths {
     Set<Entry> entries = authzObjToPath.remove(authzObj);
     if (entries != null) {
       for (Entry entry : entries) {
-        entry.delete();
+        entry.deleteAuthzObject(authzObj);
       }
     }
   }
 
   @Override
-  public String findAuthzObject(String[] pathElements) {
+  public Set<String> findAuthzObject(String[] pathElements) {
     return findAuthzObject(pathElements, true);
   }
 
   @Override
-  public String findAuthzObjectExactMatch(String[] pathElements) {
+  public Set<String> findAuthzObjectExactMatches(String[] pathElements) {
     return findAuthzObject(pathElements, false);
   }
 
-  public String findAuthzObject(String[] pathElements, boolean isPartialOk) {
+  /**
+   * Based on the isPartialOk flag, returns all authorizable Objects
+   * (database/table/partition) associated with the path, or if no match
+   * is found returns the first ancestor that has the associated
+   * authorizable objects.
+   *
+   * @param pathElements A path split into segments.
+   * @param isPartialOk Flag that indicates if patial path match is Ok or not.
+   * @return Returns a set of authzObjects authzObject associated with this path.
+   */
+  public Set<String> findAuthzObject(String[] pathElements, boolean isPartialOk) {
     // Handle '/'
     if ((pathElements == null)||(pathElements.length == 0)) return null;
-    String authzObj = null;
     Entry entry = root.find(pathElements, isPartialOk);
-    if (entry != null) {
-      authzObj = entry.getAuthzObj();
-    }
-    return authzObj;
+    return (entry != null) ? entry.getAuthzObjs() : null;
   }
 
   boolean renameAuthzObject(String oldName, List<String> oldPathElems,
@@ -456,7 +551,7 @@ public class HMSPaths implements AuthzPaths {
     if ((oldPathElems == null)||(oldPathElems.size() == 0)) return false;
     Entry entry =
         root.find(oldPathElems.toArray(new String[oldPathElems.size()]), false);
-    if ((entry != null)&&(entry.getAuthzObj().equals(oldName))) {
+    if ((entry != null) && (entry.getAuthzObjs().contains(oldName))) {
       // Update pathElements
       String[] newPath = newPathElems.toArray(new String[newPathElems.size()]);
       // Can't use Lists.newArrayList() because of whacky generics
@@ -474,8 +569,9 @@ public class HMSPaths implements AuthzPaths {
         Set<Entry> eSet = authzObjToPath.get(oldName);
         authzObjToPath.put(newName, eSet);
         for (Entry e : eSet) {
-          if (e.getAuthzObj().equals(oldName)) {
-            e.setAuthzObj(newName);
+          if (e.getAuthzObjs().contains(oldName)) {
+            e.removeAuthzObj(oldName);
+            e.addAuthzObj(newName);
           }
         }
         authzObjToPath.remove(oldName);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPathsDumper.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPathsDumper.java b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPathsDumper.java
index 8f7bb0f..d62222b 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPathsDumper.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPathsDumper.java
@@ -70,8 +70,8 @@ public class HMSPathsDumper implements AuthzPathsDumper<HMSPaths> {
     int myId = idCounter.incrementAndGet();
     TPathEntry tEntry = new TPathEntry(entry.getType().getByte(),
         entry.getPathElement(), new HashSet<Integer>());
-    if (entry.getAuthzObj() != null) {
-      tEntry.setAuthzObj(entry.getAuthzObj());
+    if (entry.getAuthzObjs().size() != 0) {
+      tEntry.setAuthzObjs(entry.getAuthzObjs());
     }
     idMap.put(myId, tEntry);
     return new Tuple(tEntry, myId);
@@ -82,13 +82,12 @@ public class HMSPathsDumper implements AuthzPathsDumper<HMSPaths> {
     HMSPaths hmsPaths = new HMSPaths(this.hmsPaths.getPrefixes());
     TPathEntry tRootEntry = pathDump.getNodeMap().get(pathDump.getRootId());
     Entry rootEntry = hmsPaths.getRootEntry();
-//    Entry rootEntry = new Entry(null, tRootEntry.getPathElement(),
-//        EntryType.fromByte(tRootEntry.getType()), tRootEntry.getAuthzObj());
     Map<String, Set<Entry>> authzObjToPath = new HashMap<String, Set<Entry>>();
     cloneToEntry(tRootEntry, rootEntry, pathDump.getNodeMap(), authzObjToPath,
         rootEntry.getType() == EntryType.PREFIX);
     hmsPaths.setRootEntry(rootEntry);
     hmsPaths.setAuthzObjToPathMapping(authzObjToPath);
+
     return hmsPaths;
   }
 
@@ -108,20 +107,21 @@ public class HMSPathsDumper implements AuthzPathsDumper<HMSPaths> {
         // Handle case when prefix entry has an authzObject
         // For Eg (default table mapped to /user/hive/warehouse)
         if (isChildPrefix) {
-          child.setAuthzObj(tChild.getAuthzObj());
+          child.addAuthzObjs(tChild.getAuthzObjs());
         }
       }
       if (child == null) {
         child = new Entry(parent, tChild.getPathElement(),
-            EntryType.fromByte(tChild.getType()), tChild.getAuthzObj());
+            EntryType.fromByte(tChild.getType()), tChild.getAuthzObjs());
       }
-      if (child.getAuthzObj() != null) {
-        Set<Entry> paths = authzObjToPath.get(child.getAuthzObj());
-        if (paths == null) {
-          paths = new HashSet<Entry>();
-          authzObjToPath.put(child.getAuthzObj(), paths);
+      if (child.getAuthzObjs().size() != 0) {
+        for (String authzObj: child.getAuthzObjs()) {
+          Set<Entry> paths = authzObjToPath.get(authzObj);
+          if (paths == null) {
+            paths = new HashSet<Entry>();
+          }
+          paths.add(child);
         }
-        paths.add(child);
       }
       parent.getChildren().put(child.getPathElement(), child);
       cloneToEntry(tChild, child, idMap, authzObjToPath, isChildPrefix);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java
index 8c5edd7..1dcb75a 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/PathsUpdate.java
@@ -62,12 +62,15 @@ public class PathsUpdate implements Updateable.Update {
   public boolean hasFullImage() {
     return tPathsUpdate.isHasFullImage();
   }
+
   public TPathChanges newPathChange(String authzObject) {
+
     TPathChanges pathChanges = new TPathChanges(authzObject,
         new LinkedList<List<String>>(), new LinkedList<List<String>>());
     tPathsUpdate.addToPathChanges(pathChanges);
     return pathChanges;
   }
+
   public List<TPathChanges> getPathChanges() {
     return tPathsUpdate.getPathChanges();
   }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/Updateable.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/Updateable.java b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/Updateable.java
index ac8459b..117fde2 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/Updateable.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/Updateable.java
@@ -23,7 +23,7 @@ import java.util.concurrent.locks.ReadWriteLock;
 public interface Updateable<K extends Updateable.Update> {
 
   /**
-   * Thrift currently does not support class inheritance.We need all update
+   * Thrift currently does not support class inheritance. We need all update
    * objects to expose a unified API. A wrapper class need to be created
    * implementing this interface and containing the generated thrift class as
    * a work around

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPaths.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPaths.java b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPaths.java
index b74f954..364a1f6 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPaths.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPaths.java
@@ -18,6 +18,7 @@
 package org.apache.sentry.hdfs;
 
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReadWriteLock;
 
@@ -48,13 +49,13 @@ public class UpdateableAuthzPaths implements AuthzPaths, Updateable<PathsUpdate>
   }
 
   @Override
-  public String findAuthzObject(String[] pathElements) {
+  public Set<String> findAuthzObject(String[] pathElements) {
     return  paths.findAuthzObject(pathElements);
   }
 
   @Override
-  public String findAuthzObjectExactMatch(String[] pathElements) {
-    return  paths.findAuthzObjectExactMatch(pathElements);
+  public Set<String> findAuthzObjectExactMatches(String[] pathElements) {
+    return  paths.findAuthzObjectExactMatches(pathElements);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/main/resources/sentry_hdfs_service.thrift
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/main/resources/sentry_hdfs_service.thrift b/sentry-hdfs/sentry-hdfs-common/src/main/resources/sentry_hdfs_service.thrift
index fb60855..5f9cf31 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/main/resources/sentry_hdfs_service.thrift
+++ b/sentry-hdfs/sentry-hdfs-common/src/main/resources/sentry_hdfs_service.thrift
@@ -22,23 +22,39 @@
 # Thrift Service that the MetaStore is built on
 #
 
-include "share/fb303/if/fb303.thrift"
+#include "share/fb303/if/fb303.thrift"
 
 namespace java org.apache.sentry.hdfs.service.thrift
 namespace php sentry.hdfs.thrift
 namespace cpp Apache.Sentry.HDFS.Thrift
 
 struct TPathChanges {
+
+# The authorizable object that needs to be updated.
 1: required string authzObj;
+
+# The path (splits into string segments) that needs to be
+# added to the authorizable object.
 2: required list<list<string>> addPaths;
+
+# The path (splits into string segments) that needs to be
+# deleted to the authorizable object.
 3: required list<list<string>> delPaths;
 }
 
 struct TPathEntry {
+
+# The type of the Path Entry.
 1: required byte type;
+
+# The path element in string.
 2: required string pathElement;
-3: optional string authzObj;
+
+# The child tuple id of the Path Entry.
 4: required set<i32> children;
+
+# A set of authzObjs associated with the Path Entry.
+5: optional set<string> authzObjs;
 }
 
 struct TPathsDump {
@@ -54,14 +70,28 @@ struct TPathsUpdate {
 }
 
 struct TPrivilegeChanges {
+
+# The authorizable object that needs to be updated.
 1: required string authzObj;
+
+# The privileges that needs to be added to
+# the authorizable object.
 2: required map<string, string> addPrivileges;
+
+# The privileges that needs to be deleted to
+# the authorizable object.
 3: required map<string, string> delPrivileges;
 }
 
 struct TRoleChanges {
+
+# The role that needs to be updated.
 1: required string role;
+
+# The groups that needs to be added.
 2: required list<string> addGroups;
+
+# The groups that needs to be deleted.
 3: required list<string> delGroups;
 }
 
@@ -69,7 +99,7 @@ struct TPermissionsUpdate {
 1: required bool hasfullImage;
 2: required i64 seqNum;
 3: required map<string, TPrivilegeChanges> privilegeChanges;
-4: required map<string, TRoleChanges> roleChanges; 
+4: required map<string, TRoleChanges> roleChanges;
 }
 
 struct TAuthzUpdateResponse {

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPaths.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPaths.java b/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPaths.java
index 29868ae..bb74779 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPaths.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPaths.java
@@ -63,7 +63,7 @@ public class TestHMSPaths {
     root.toString();
     Assert.assertNull(root.getParent());
     Assert.assertEquals(HMSPaths.EntryType.DIR, root.getType());
-    Assert.assertNull(root.getAuthzObj());
+    Assert.assertTrue(root.getAuthzObjs().size() == 0);
     Assert.assertEquals(Path.SEPARATOR, root.getFullPath());
     Assert.assertTrue(root.getChildren().isEmpty());
     root.delete();
@@ -127,7 +127,7 @@ public class TestHMSPaths {
     Assert.assertEquals(root, entry.getParent());
     Assert.assertEquals(HMSPaths.EntryType.PREFIX, entry.getType());
     Assert.assertEquals("a", entry.getPathElement());
-    Assert.assertNull(entry.getAuthzObj());
+    Assert.assertEquals(0, entry.getAuthzObjs().size());
     Assert.assertEquals(Path.SEPARATOR + "a", entry.getFullPath());
     Assert.assertTrue(entry.getChildren().isEmpty());
 
@@ -167,13 +167,13 @@ public class TestHMSPaths {
 
     Assert.assertEquals(root, entry.getParent().getParent());
     Assert.assertEquals(HMSPaths.EntryType.PREFIX, entry.getType());
-    Assert.assertEquals(HMSPaths.EntryType.DIR, 
+    Assert.assertEquals(HMSPaths.EntryType.DIR,
         entry.getParent().getType());
     Assert.assertEquals("b", entry.getPathElement());
     Assert.assertEquals("a", entry.getParent().getPathElement());
-    Assert.assertNull(entry.getAuthzObj());
-    Assert.assertNull(entry.getParent().getAuthzObj());
-    Assert.assertEquals(Path.SEPARATOR + "a" + Path.SEPARATOR + "b", 
+    Assert.assertTrue(entry.getAuthzObjs().size() == 0);
+    Assert.assertTrue(entry.getParent().getAuthzObjs().size() == 0);
+    Assert.assertEquals(Path.SEPARATOR + "a" + Path.SEPARATOR + "b",
         entry.getFullPath());
     Assert.assertEquals(Path.SEPARATOR + "a", entry.getParent().getFullPath());
     Assert.assertTrue(entry.getChildren().isEmpty());
@@ -212,7 +212,7 @@ public class TestHMSPaths {
     Assert.assertEquals(prefix, entry.getParent());
     Assert.assertEquals(HMSPaths.EntryType.AUTHZ_OBJECT, entry.getType());
     Assert.assertEquals("p1", entry.getPathElement());
-    Assert.assertEquals("A", entry.getAuthzObj());
+    Assert.assertTrue(entry.getAuthzObjs().contains("A"));
     Assert.assertEquals(Path.SEPARATOR + "a" + Path.SEPARATOR + "b" +
         Path.SEPARATOR + "p1", entry.getFullPath());
 
@@ -249,7 +249,7 @@ public class TestHMSPaths {
     Assert.assertEquals(prefix, entry.getParent().getParent());
     Assert.assertEquals(HMSPaths.EntryType.AUTHZ_OBJECT, entry.getType());
     Assert.assertEquals("p1", entry.getPathElement());
-    Assert.assertEquals("A", entry.getAuthzObj());
+    Assert.assertTrue(entry.getAuthzObjs().contains("A"));
     Assert.assertEquals(Path.SEPARATOR + "a" + Path.SEPARATOR + "b" +
         Path.SEPARATOR + "t" + Path.SEPARATOR + "p1", entry.getFullPath());
 
@@ -265,11 +265,11 @@ public class TestHMSPaths {
 
     Assert.assertEquals(HMSPaths.EntryType.AUTHZ_OBJECT, entry.getType());
     Assert.assertEquals("p1", entry.getPathElement());
-    Assert.assertEquals("A", entry.getAuthzObj());
+    Assert.assertTrue(entry.getAuthzObjs().contains("A"));
 
     Assert.assertEquals(HMSPaths.EntryType.AUTHZ_OBJECT, ep2.getType());
     Assert.assertEquals("p2", ep2.getPathElement());
-    Assert.assertEquals("A", entry.getAuthzObj());
+    Assert.assertTrue(entry.getAuthzObjs().contains("A"));
 
     Assert.assertEquals(entry, root.find(new String[]{"a", "b", "t", "p1"},
         true));
@@ -296,7 +296,7 @@ public class TestHMSPaths {
     Assert.assertNull(root.find(new String[]{"a", "b", "t", "p1"},
         true));
     Assert.assertEquals(HMSPaths.EntryType.DIR, entry.getType());
-    Assert.assertNull(entry.getAuthzObj());
+    Assert.assertEquals(entry.getAuthzObjs().size(), 0);
 
     Assert.assertNull(root.find(new String[]{"a", "b", "t", "p1"}, false));
     Assert.assertNull(root.find(new String[]{"a", "b", "t"}, false));
@@ -353,5 +353,19 @@ public class TestHMSPaths {
     Assert.assertEquals(prefix, root.findPrefixEntry(
         Lists.newArrayList("a", "b", "t", "p3")));
   }
+
+  @Test
+  public void testAuthzObjCaseInsensitive() {
+    HMSPaths.Entry root = HMSPaths.Entry.createRoot(false);
+    HMSPaths.Entry prefix = root.createPrefix(Lists.newArrayList("a", "b"));
+
+    HMSPaths.Entry entry = root.createAuthzObjPath(
+        Lists.newArrayList("a", "b", "t", "p1"), "A");
+    Assert.assertEquals(prefix, entry.getParent().getParent());
+    Assert.assertEquals(HMSPaths.EntryType.AUTHZ_OBJECT, entry.getType());
+
+    // Authz Object is case insensitive.
+    Assert.assertTrue(entry.getAuthzObjs().contains("a"));
+  }
   
 }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPathsFullDump.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPathsFullDump.java b/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPathsFullDump.java
index d01f7dd..b43ad0e 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPathsFullDump.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestHMSPathsFullDump.java
@@ -29,7 +29,8 @@ import org.apache.thrift.protocol.TProtocolFactory;
 import org.junit.Test;
 
 import com.google.common.collect.Lists;
-
+import java.util.Arrays;
+import java.util.HashSet;
 import java.io.IOException;
 
 import static org.junit.Assert.assertEquals;
@@ -37,7 +38,6 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 
 public class TestHMSPathsFullDump {
-  
   private static boolean useCompact = true;
 
   @Test
@@ -56,27 +56,27 @@ public class TestHMSPathsFullDump {
     hmsPaths._addAuthzObject("db2.tbl21", Lists.newArrayList("/user/hive/w2/db2/tbl21"));
     hmsPaths._addPathsToAuthzObject("db2.tbl21", Lists.newArrayList("/user/hive/w2/db2/tbl21/p1=1/p2=x"));
 
-    Assert.assertEquals("default", hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse"}, false));
-    Assert.assertEquals("db1", hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1"}, false));
-    Assert.assertEquals("db1.tbl11", hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11"}, false));
-    Assert.assertEquals("db1.tbl11", hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "part111"}, false));
-    Assert.assertEquals("db1.tbl11", hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "part112"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("default")), hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1")), hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1.tbl11")), hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1.tbl11")), hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "part111"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1.tbl11")), hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "part112"}, false));
 
-    Assert.assertEquals("db1.tbl11", hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "p1=1", "p2=x"}, false));
-    Assert.assertEquals("db1.tbl11", hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "p1=1"}, true));
-    Assert.assertEquals("db2.tbl21", hmsPaths.findAuthzObject(new String[]{"user", "hive", "w2", "db2", "tbl21", "p1=1"}, true));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1.tbl11")), hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "p1=1", "p2=x"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1.tbl11")), hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "p1=1"}, true));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db2.tbl21")), hmsPaths.findAuthzObject(new String[]{"user", "hive", "w2", "db2", "tbl21", "p1=1"}, true));
 
     HMSPathsDumper serDe = hmsPaths.getPathsDump();
     TPathsDump pathsDump = serDe.createPathsDump();
     HMSPaths hmsPaths2 = new HMSPaths(new String[] {"/user/hive/warehouse"}).getPathsDump().initializeFromDump(pathsDump);
 
-    Assert.assertEquals("default", hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse"}, false));
-    Assert.assertEquals("db1", hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1"}, false));
-    Assert.assertEquals("db1.tbl11", hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11"}, false));
-    Assert.assertEquals("db1.tbl11", hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "part111"}, false));
-    Assert.assertEquals("db1.tbl11", hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "part112"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("default")), hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1")), hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1.tbl11")), hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1.tbl11")), hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "part111"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db1.tbl11")), hmsPaths2.findAuthzObject(new String[]{"user", "hive", "warehouse", "db1", "tbl11", "part112"}, false));
 
-    // This path is not under prefix, so should not be deserialized.. 
+    // This path is not under prefix, so should not be deserialized..
     Assert.assertNull(hmsPaths2.findAuthzObject(new String[]{"user", "hive", "w2", "db2", "tbl21", "p1=1"}, true));
   }
 
@@ -101,8 +101,8 @@ public class TestHMSPathsFullDump {
     new TDeserializer(protoFactory).deserialize(tPathsDump, ser);
     HMSPaths fromDump = serDe.initializeFromDump(tPathsDump);
     System.out.println("Deserialization Time: " + (System.currentTimeMillis() - t1));
-    Assert.assertEquals("db9.tbl999", fromDump.findAuthzObject(new String[]{"user", "hive", "warehouse", "db9", "tbl999"}, false));
-    Assert.assertEquals("db9.tbl999", fromDump.findAuthzObject(new String[]{"user", "hive", "warehouse", "db9", "tbl999", "part99"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db9.tbl999")), fromDump.findAuthzObject(new String[]{"user", "hive", "warehouse", "db9", "tbl999"}, false));
+    Assert.assertEquals(new HashSet<String>(Arrays.asList("db9.tbl999")), fromDump.findAuthzObject(new String[]{"user", "hive", "warehouse", "db9", "tbl999", "part99"}, false));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4b33ad92/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestUpdateableAuthzPaths.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestUpdateableAuthzPaths.java b/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestUpdateableAuthzPaths.java
index 4b8a058..98ab7ba 100644
--- a/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestUpdateableAuthzPaths.java
+++ b/sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/TestUpdateableAuthzPaths.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertNull;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.sentry.hdfs.service.thrift.TPathChanges;
+import static org.junit.Assert.assertTrue;
 import org.junit.Test;
 
 import com.google.common.collect.Lists;
@@ -33,10 +34,10 @@ public class TestUpdateableAuthzPaths {
   @Test
   public void testFullUpdate() {
     HMSPaths hmsPaths = createBaseHMSPaths(1, 1);
-    assertEquals("db1", hmsPaths.findAuthzObjectExactMatch(new String[]{"db1"}));
-    assertEquals("db1.tbl11", hmsPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11"}));
-    assertEquals("db1.tbl11", hmsPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part111"}));
-    assertEquals("db1.tbl11", hmsPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part112"}));
+    assertTrue(hmsPaths.findAuthzObjectExactMatches(new String[]{"db1"}).contains("db1"));
+    assertTrue(hmsPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11"}).contains("db1.tbl11"));
+    assertTrue(hmsPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part111"}).contains("db1.tbl11"));
+    assertTrue(hmsPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part112"}).contains("db1.tbl11"));
 
     UpdateableAuthzPaths authzPaths = new UpdateableAuthzPaths(hmsPaths);
     PathsUpdate update = new PathsUpdate(1, true);
@@ -47,10 +48,10 @@ public class TestUpdateableAuthzPaths {
     assertFalse(pre == authzPaths2);
     authzPaths2 = pre;
 
-    assertEquals("db1", authzPaths2.findAuthzObjectExactMatch(new String[]{"db1"}));
-    assertEquals("db1.tbl11", authzPaths2.findAuthzObjectExactMatch(new String[]{"db1", "tbl11"}));
-    assertEquals("db1.tbl11", authzPaths2.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part111"}));
-    assertEquals("db1.tbl11", authzPaths2.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part112"}));
+    assertTrue(authzPaths2.findAuthzObjectExactMatches(new String[]{"db1"}).contains("db1"));
+    assertTrue(authzPaths2.findAuthzObjectExactMatches(new String[]{"db1", "tbl11"}).contains("db1.tbl11"));
+    assertTrue(authzPaths2.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part111"}).contains("db1.tbl11"));
+    assertTrue(authzPaths2.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part112"}).contains("db1.tbl11"));
 
     // Ensure Full Update wipes old stuff
     UpdateableAuthzPaths authzPaths3 = new UpdateableAuthzPaths(createBaseHMSPaths(2, 1));
@@ -60,13 +61,13 @@ public class TestUpdateableAuthzPaths {
     assertFalse(pre == authzPaths2);
     authzPaths2 = pre;
 
-    assertNull(authzPaths2.findAuthzObjectExactMatch(new String[]{"db1"}));
-    assertNull(authzPaths2.findAuthzObjectExactMatch(new String[]{"db1", "tbl11"}));
+    assertNull(authzPaths2.findAuthzObjectExactMatches(new String[]{"db1"}));
+    assertNull(authzPaths2.findAuthzObjectExactMatches(new String[]{"db1", "tbl11"}));
 
-    assertEquals("db2", authzPaths2.findAuthzObjectExactMatch(new String[]{"db2"}));
-    assertEquals("db2.tbl21", authzPaths2.findAuthzObjectExactMatch(new String[]{"db2", "tbl21"}));
-    assertEquals("db2.tbl21", authzPaths2.findAuthzObjectExactMatch(new String[]{"db2", "tbl21", "part211"}));
-    assertEquals("db2.tbl21", authzPaths2.findAuthzObjectExactMatch(new String[]{"db2", "tbl21", "part212"}));
+    assertTrue(authzPaths2.findAuthzObjectExactMatches(new String[]{"db2"}).contains("db2"));
+    assertTrue(authzPaths2.findAuthzObjectExactMatches(new String[]{"db2", "tbl21"}).contains("db2.tbl21"));
+    assertTrue(authzPaths2.findAuthzObjectExactMatches(new String[]{"db2", "tbl21", "part211"}).contains("db2.tbl21"));
+    assertTrue(authzPaths2.findAuthzObjectExactMatches(new String[]{"db2", "tbl21", "part212"}).contains("db2.tbl21"));
   }
 
   @Test
@@ -87,14 +88,14 @@ public class TestUpdateableAuthzPaths {
     authzPaths.updatePartial(Lists.newArrayList(update), lock);
 
     // Ensure no change in existing Paths
-    assertEquals("db1", authzPaths.findAuthzObjectExactMatch(new String[]{"db1"}));
-    assertEquals("db1.tbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11"}));
-    assertEquals("db1.tbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part111"}));
-    assertEquals("db1.tbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part112"}));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1"}).contains("db1"));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11"}).contains("db1.tbl11"));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part111"}).contains("db1.tbl11"));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part112"}).contains("db1.tbl11"));
 
     // Verify new Paths
-    assertEquals("db1.tbl12", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl12"}));
-    assertEquals("db1.tbl12", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl12", "part121"}));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl12"}).contains("db1.tbl12"));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl12", "part121"}).contains("db1.tbl12"));
 
     // Rename table
     update = new PathsUpdate(4, false);
@@ -103,17 +104,17 @@ public class TestUpdateableAuthzPaths {
     authzPaths.updatePartial(Lists.newArrayList(update), lock);
 
     // Verify name change
-    assertEquals("db1", authzPaths.findAuthzObjectExactMatch(new String[]{"db1"}));
-    assertEquals("db1.xtbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "xtbl11"}));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1"}).contains("db1"));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "xtbl11"}).contains("db1.xtbl11"));
     // Explicit set location has to be done on the partition else it will be associated to
     // the old location
-    assertEquals("db1.xtbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part111"}));
-    assertEquals("db1.xtbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part112"}));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part111"}).contains("db1.xtbl11"));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part112"}).contains("db1.xtbl11"));
     // Verify other tables are not touched
-    assertNull(authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "xtbl12"}));
-    assertNull(authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "xtbl12", "part121"}));
-    assertEquals("db1.tbl12", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl12"}));
-    assertEquals("db1.tbl12", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl12", "part121"}));
+    assertNull(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "xtbl12"}));
+    assertNull(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "xtbl12", "part121"}));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl12"}).contains("db1.tbl12"));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl12", "part121"}).contains("db1.tbl12"));
 
   }
 
@@ -122,9 +123,9 @@ public class TestUpdateableAuthzPaths {
     HMSPaths hmsPaths = createBaseHMSPaths(1, 1);
     UpdateableAuthzPaths authzPaths = new UpdateableAuthzPaths(hmsPaths);
     ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-    assertEquals("db1.tbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11"}));
-    assertEquals("db1.tbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part111"}));
-    
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11"}).contains("db1.tbl11"));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part111"}).contains("db1.tbl11"));
+
     // Drop partition
     PathsUpdate update = new PathsUpdate(2, false);
     TPathChanges pathChange = update.newPathChange("db1.tbl11");
@@ -132,17 +133,17 @@ public class TestUpdateableAuthzPaths {
     authzPaths.updatePartial(Lists.newArrayList(update), lock);
 
     // Verify Paths deleted
-    assertNull(authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part111"}));
+    assertNull(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part111"}));
 
     // Verify rest ok
-    assertEquals("db1.tbl11", authzPaths.findAuthzObjectExactMatch(new String[]{"db1", "tbl11", "part112"}));
+    assertTrue(authzPaths.findAuthzObjectExactMatches(new String[]{"db1", "tbl11", "part112"}).contains("db1.tbl11"));
   }
 
   @Test
   public void testDefaultDbPath() {
     HMSPaths hmsPaths = new HMSPaths(new String[] {"/user/hive/warehouse"});
     hmsPaths._addAuthzObject("default", Lists.newArrayList("/user/hive/warehouse"));
-    assertEquals("default", hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse"}));
+    assertTrue(hmsPaths.findAuthzObject(new String[]{"user", "hive", "warehouse"}).contains("default"));
   }
 
   private HMSPaths createBaseHMSPaths(int dbNum, int tblNum) {