You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by va...@apache.org on 2017/06/14 00:57:09 UTC
[31/52] [abbrv] sentry git commit: SENTRY-1772: Permissions created
before table creation are not reflected in HDFS ACLs (Alex Kolbasov,
reviewed by: Vamsee Yarlagadda)
SENTRY-1772: Permissions created before table creation are not reflected in HDFS ACLs (Alex Kolbasov, reviewed by: Vamsee Yarlagadda)
Change-Id: I8b124e5811b781967ea71a43a0844555486cd7fe
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/22846
Tested-by: Jenkins User
Reviewed-by: Alexander Kolbasov <ak...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/f2419188
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/f2419188
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/f2419188
Branch: refs/for/cdh5-1.5.1_ha
Commit: f2419188453bfbfa2b38be2785eca1be96230a1c
Parents: 106e736
Author: Alexander Kolbasov <ak...@cloudera.com>
Authored: Thu May 18 23:05:02 2017 -0700
Committer: Alexander Kolbasov <ak...@cloudera.com>
Committed: Fri May 19 00:21:01 2017 -0700
----------------------------------------------------------------------
.../org/apache/sentry/service/thrift/HMSFollower.java | 2 +-
.../sentry/service/thrift/NotificationProcessor.java | 2 +-
.../apache/sentry/service/thrift/TestHMSFollower.java | 14 +++++++-------
3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/sentry/blob/f2419188/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
index 211b22d..e11bead 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
@@ -412,7 +412,7 @@ public class HMSFollower implements Runnable, AutoCloseable {
private boolean syncWithPolicyStore(HiveAuthzConf.AuthzConfVars syncConfVar) {
return "true"
- .equalsIgnoreCase((authzConf.get(syncConfVar.getVar(), "true")));
+ .equalsIgnoreCase((authzConf.get(syncConfVar.getVar(), syncConfVar.getDefault())));
}
/**
http://git-wip-us.apache.org/repos/asf/sentry/blob/f2419188/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
index 083e0ac..9f4cfe8 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
@@ -372,7 +372,7 @@ class NotificationProcessor {
try {
return PathsUpdate.parsePath(path);
} catch (SentryMalformedPathException e) {
- LOGGER.error("Unexpected path while parsing, " + path, e.getMessage());
+ LOGGER.error("Unexpected path while parsing {}", path, e);
}
return null;
}
http://git-wip-us.apache.org/repos/asf/sentry/blob/f2419188/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
index fd97936..74a5afb 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
+++ b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
@@ -42,7 +42,7 @@ public class TestHMSFollower {
// Create notification events
NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.CREATE_DATABASE.toString(),
- messageFactory.buildCreateDatabaseMessage(new Database(dbName, null, "hdfs://db1", null)).toString());
+ messageFactory.buildCreateDatabaseMessage(new Database(dbName, null, "hdfs:///db1", null)).toString());
List<NotificationEvent> events = new ArrayList<>();
events.add(notificationEvent);
@@ -54,7 +54,7 @@ public class TestHMSFollower {
authorizable.setServer(hiveInstance);
authorizable.setDb("db1");
- verify(sentryStore, times(1)).dropPrivilege(authorizable, HMSFollower.onDropSentryPrivilege(authorizable));
+ verify(sentryStore, times(0)).dropPrivilege(authorizable, HMSFollower.onDropSentryPrivilege(authorizable));
}
@Test
@@ -63,7 +63,7 @@ public class TestHMSFollower {
// Create notification events
NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.DROP_DATABASE.toString(),
- messageFactory.buildDropDatabaseMessage(new Database(dbName, null, "hdfs://db1", null)).toString());
+ messageFactory.buildDropDatabaseMessage(new Database(dbName, null, "hdfs:///db1", null)).toString());
List<NotificationEvent> events = new ArrayList<>();
events.add(notificationEvent);
@@ -84,7 +84,7 @@ public class TestHMSFollower {
// Create notification events
StorageDescriptor sd = new StorageDescriptor();
- sd.setLocation("hdfs://db1.db/table1");
+ sd.setLocation("hdfs:///db1.db/table1");
NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.CREATE_TABLE.toString(),
messageFactory.buildCreateTableMessage(new Table(tableName, dbName, null, 0, 0, 0, sd, null, null, null, null, null)).toString());
List<NotificationEvent> events = new ArrayList<>();
@@ -99,7 +99,7 @@ public class TestHMSFollower {
authorizable.setDb("db1");
authorizable.setTable(tableName);
- verify(sentryStore, times(1)).dropPrivilege(authorizable, HMSFollower.onDropSentryPrivilege(authorizable));
+ verify(sentryStore, times(0)).dropPrivilege(authorizable, HMSFollower.onDropSentryPrivilege(authorizable));
}
@Test
public void testDropTable() throws Exception {
@@ -108,7 +108,7 @@ public class TestHMSFollower {
// Create notification events
StorageDescriptor sd = new StorageDescriptor();
- sd.setLocation("hdfs://db1.db/table1");
+ sd.setLocation("hdfs:///db1.db/table1");
NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.DROP_TABLE.toString(),
messageFactory.buildDropTableMessage(new Table(tableName, dbName, null, 0, 0, 0, sd, null, null, null, null, null)).toString());
List<NotificationEvent> events = new ArrayList<>();
@@ -135,7 +135,7 @@ public class TestHMSFollower {
// Create notification events
StorageDescriptor sd = new StorageDescriptor();
- sd.setLocation("hdfs://db1.db/table1");
+ sd.setLocation("hdfs:///db1.db/table1");
NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.ALTER_TABLE.toString(),
messageFactory.buildAlterTableMessage(
new Table(tableName, dbName, null, 0, 0, 0, sd, null, null, null, null, null),