sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sra...@apache.org
Subject sentry git commit: SENTRY-1376: Fix alter property case correctly - Deletes ACLS on the table (Sravya Tirukkovalur, Reviewed by: Hao Hao)
Date Thu, 30 Jun 2016 21:29:49 GMT
Repository: sentry
Updated Branches:
  refs/heads/master 6fbff11fa -> eee2ea1b4


SENTRY-1376: Fix alter property case correctly - Deletes ACLS on the table (Sravya Tirukkovalur,
Reviewed by: Hao Hao)

Change-Id: I6ea6aba2aad688519a8ca60b1ec93ee8a4abcf90


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

Branch: refs/heads/master
Commit: eee2ea1b4d4c59dbf696acf3992865ca71fe6888
Parents: 6fbff11
Author: Sravya Tirukkovalur <sravya@apache.org>
Authored: Thu Jun 30 14:29:05 2016 -0700
Committer: Sravya Tirukkovalur <sravya@apache.org>
Committed: Thu Jun 30 14:29:05 2016 -0700

----------------------------------------------------------------------
 .../binding/metastore/SentryMetastorePostEventListener.java | 4 +---
 .../java/org/apache/sentry/hdfs/UpdateableAuthzPaths.java   | 9 +++++----
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/eee2ea1b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java
----------------------------------------------------------------------
diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java
b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java
index 8d8f5ce..9844c33 100644
--- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java
+++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java
@@ -391,10 +391,8 @@ public class SentryMetastorePostEventListener extends MetaStoreEventListener
{
     }
     // The HDFS plugin needs to know if it's a path change (set location)
     for (SentryMetastoreListenerPlugin plugin : sentryPlugins) {
-      if(!oldPath.equals(newPath)) {
-        plugin.renameAuthzObject(oldDbName + "." + oldTabName, oldPath,
+      plugin.renameAuthzObject(oldDbName + "." + oldTabName, oldPath,
                 newDbName + "." + newTabName, newPath);
-      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/sentry/blob/eee2ea1b/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 4264a21..5ae46ac 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
@@ -110,17 +110,18 @@ public class UpdateableAuthzPaths implements AuthzPaths, Updateable<PathsUpdate>
       }
     }
     for (TPathChanges pathChanges : update.getPathChanges()) {
-      paths.addPathsToAuthzObject(pathChanges.getAuthzObj(), pathChanges
-          .getAddPaths(), true);
       List<List<String>> delPaths = pathChanges.getDelPaths();
       if (delPaths.size() == 1 && delPaths.get(0).size() == 1
-          && delPaths.get(0).get(0).equals(PathsUpdate.ALL_PATHS)) {
+              && delPaths.get(0).get(0).equals(PathsUpdate.ALL_PATHS)) {
         // Remove all paths.. eg. drop table
         paths.deleteAuthzObject(pathChanges.getAuthzObj());
       } else {
         paths.deletePathsFromAuthzObject(pathChanges.getAuthzObj(), pathChanges
-            .getDelPaths());
+                .getDelPaths());
       }
+      paths.addPathsToAuthzObject(pathChanges.getAuthzObj(), pathChanges
+          .getAddPaths(), true);
+
     }
   }
 


Mime
View raw message