sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amis...@apache.org
Subject sentry git commit: SENTRY-2480: Change processDropDatabase to call removeAllPaths (Arjun Mishra reviewed by Kalyan Kumar Kalvagadda)
Date Mon, 17 Dec 2018 21:51:12 GMT
Repository: sentry
Updated Branches:
  refs/heads/master afdf7bd5c -> 5bfa963b7


SENTRY-2480: Change processDropDatabase to call removeAllPaths (Arjun Mishra reviewed by Kalyan
Kumar Kalvagadda)

Change-Id: Iea90a22351e32fa44a3f986481e1dda745493997


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

Branch: refs/heads/master
Commit: 5bfa963b76db3f3ae08c63767627e739d0dbbf01
Parents: afdf7bd
Author: amishra <amishra@cloudera.com>
Authored: Mon Dec 17 15:46:37 2018 -0600
Committer: amishra <amishra@cloudera.com>
Committed: Mon Dec 17 15:46:40 2018 -0600

----------------------------------------------------------------------
 .../provider/db/service/persistent/NotificationProcessor.java | 4 +---
 .../db/service/persistent/TestNotificationProcessor.java      | 7 +++----
 2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/5bfa963b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/NotificationProcessor.java
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/NotificationProcessor.java
b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/NotificationProcessor.java
index ab262d0..3a61b52 100644
--- a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/NotificationProcessor.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/NotificationProcessor.java
@@ -279,7 +279,6 @@ final class NotificationProcessor {
     SentryJSONDropDatabaseMessage dropDatabaseMessage =
         deserializer.getDropDatabaseMessage(event.getMessage());
     String dbName = dropDatabaseMessage.getDB();
-    String location = dropDatabaseMessage.getLocation();
     if (dbName == null) {
       LOGGER.warn("Drop database event has incomplete information: dbName = null");
       return false;
@@ -289,8 +288,7 @@ final class NotificationProcessor {
     }
 
     if (hdfsSyncEnabled) {
-      List<String> locations = Collections.singletonList(location);
-      removePaths(dbName, locations, event);
+      removeAllPaths(dbName, event);
       return true;
     }
     return false;

http://git-wip-us.apache.org/repos/asf/sentry/blob/5bfa963b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestNotificationProcessor.java
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestNotificationProcessor.java
b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestNotificationProcessor.java
index f227bb4..18e5ddf 100644
--- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestNotificationProcessor.java
+++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestNotificationProcessor.java
@@ -153,8 +153,8 @@ public class TestNotificationProcessor {
     authorizable.setDb("db1");
 
     //noinspection unchecked
-    verify(sentryStore, times(1)).deleteAuthzPathsMapping(Mockito.anyString(),
-        Mockito.anyCollection(), Mockito.any(UniquePathsUpdate.class));
+    verify(sentryStore, times(1)).deleteAllAuthzPathsMapping(Mockito.anyString(),
+        Mockito.any(UniquePathsUpdate.class));
     verify(sentryStore, times(1)).dropPrivilege(authorizable,
         NotificationProcessor.getPermUpdatableOnDrop(authorizable));
     reset(sentryStore);
@@ -175,8 +175,7 @@ public class TestNotificationProcessor {
     authorizable.setDb(dbName);
 
     //noinspection unchecked
-    verify(sentryStore, times(1)).deleteAuthzPathsMapping(Mockito.anyString(),
-        Mockito.anyCollection(), Mockito.any(UniquePathsUpdate.class));
+    verify(sentryStore, times(1)).deleteAllAuthzPathsMapping(Mockito.anyString(), Mockito.any(UniquePathsUpdate.class));
     verify(sentryStore, times(0)).dropPrivilege(authorizable,
         NotificationProcessor.getPermUpdatableOnDrop(authorizable));
   }


Mime
View raw message