Repository: sentry Updated Branches: refs/heads/commit-master [created] f3f238ab9
SENTRY-2332: Load hadoop default configuration when starting sentry service (Arjun Mishra reviewed by Lina Li) Change-Id: I61896ad01b49271202e3857b13f7e0faa6fd1ac0 Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/f3f238ab Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/f3f238ab Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/f3f238ab Branch: refs/heads/commit-master Commit: f3f238ab991cd82ae7f468f9658ddef1e273ac1e Parents: 049da44 Author: amishra <amis...@cloudera.com> Authored: Fri Aug 3 10:52:38 2018 -0500 Committer: amishra <amis...@cloudera.com> Committed: Fri Aug 3 10:53:12 2018 -0500 ---------------------------------------------------------------------- .../java/org/apache/sentry/service/thrift/SentryService.java | 2 +- .../api/service/thrift/TestNotificationHandlerInvoker.java | 2 +- .../api/service/thrift/TestSentryPolicyStoreProcessor.java | 2 +- .../generic/service/persistent/SentryStoreIntegrationBase.java | 2 +- .../persistent/TestHMSFollowerSentryStoreIntegration.java | 2 +- .../sentry/provider/db/service/persistent/TestSentryStore.java | 2 +- .../db/service/persistent/TestSentryStoreImportExport.java | 2 +- .../sentry/provider/db/service/persistent/TestSentryVersion.java | 2 +- .../sentry/service/thrift/SentryServiceIntegrationBase.java | 2 +- .../sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java | 2 +- .../apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationBase.java | 2 +- .../tests/e2e/hive/AbstractTestWithStaticConfiguration.java | 4 ++-- .../java/org/apache/sentry/tests/e2e/solr/TestSentryServer.java | 4 ++-- 13 files changed, 15 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java index 7c827ca..b3a4934 100644 --- a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java +++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java @@ -572,7 +572,7 @@ public class SentryService implements Callable, SigUtils.SigListener { throw new IllegalArgumentException("Cannot read configuration file " + configFile); } - Configuration conf = new Configuration(false); + Configuration conf = new Configuration(true); conf.addResource(configFile.toURI().toURL(), true); return conf; } http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestNotificationHandlerInvoker.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestNotificationHandlerInvoker.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestNotificationHandlerInvoker.java index 92f3f8b..20948ed 100644 --- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestNotificationHandlerInvoker.java +++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestNotificationHandlerInvoker.java @@ -33,7 +33,7 @@ public class TestNotificationHandlerInvoker { @Before public void setup() throws Exception { - conf = new Configuration(false); + conf = new Configuration(true); handler = Mockito.spy(new NotificationHandler(conf) {}); invoker = new NotificationHandlerInvoker(conf, Lists.newArrayList(new ThrowingNotificationHandler(conf), handler)); http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryPolicyStoreProcessor.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryPolicyStoreProcessor.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryPolicyStoreProcessor.java index 3475624..ee9442b 100644 --- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryPolicyStoreProcessor.java +++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/api/service/thrift/TestSentryPolicyStoreProcessor.java @@ -79,7 +79,7 @@ public class TestSentryPolicyStoreProcessor { @Before public void setup() throws Exception{ - conf = new Configuration(false); + conf = new Configuration(true); //Check behaviour when DB name is not set conf.setBoolean(ServiceConstants.ServerConfig.SENTRY_ENABLE_OWNER_PRIVILEGES, true); conf.set(ServerConfig.ADMIN_GROUPS, ADMIN_GROUP); http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java index 3fe5b6a..f32ac2d 100644 --- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java +++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreIntegrationBase.java @@ -39,7 +39,7 @@ public abstract class SentryStoreIntegrationBase { @BeforeClass public static void setup() throws Exception { - conf = new Configuration(false); + conf = new Configuration(true); setup(conf); sentryStore = new DelegateSentryStore(conf); } http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestHMSFollowerSentryStoreIntegration.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestHMSFollowerSentryStoreIntegration.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestHMSFollowerSentryStoreIntegration.java index 6a84b05..12efb2d 100644 --- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestHMSFollowerSentryStoreIntegration.java +++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestHMSFollowerSentryStoreIntegration.java @@ -73,7 +73,7 @@ public class TestHMSFollowerSentryStoreIntegration { // SentryStore related @BeforeClass public static void setup() throws Exception { - conf = new Configuration(false); + conf = new Configuration(true); final String ourUrl = UserProvider.SCHEME_NAME + ":///"; conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, ourUrl); http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java index d33ae26..07a5069 100644 --- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java +++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java @@ -111,7 +111,7 @@ public class TestSentryStore extends org.junit.Assert { @BeforeClass public static void setup() throws Exception { - conf = new Configuration(false); + conf = new Configuration(true); final String ourUrl = UserProvider.SCHEME_NAME + ":///"; conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, ourUrl); http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java index 40ac994..df9299c 100644 --- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java +++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStoreImportExport.java @@ -71,7 +71,7 @@ public class TestSentryStoreImportExport { @BeforeClass public static void setupEnv() throws Exception { dataDir = new File(Files.createTempDir(), "sentry_policy_db"); - Configuration conf = new Configuration(false); + Configuration conf = new Configuration(true); conf.set(ServerConfig.SENTRY_VERIFY_SCHEM_VERSION, "false"); conf.set(ServerConfig.SENTRY_STORE_JDBC_URL, "jdbc:derby:;databaseName=" + dataDir.getPath() + ";create=true"); http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java index 21aa7f9..f61b520 100644 --- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java +++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryVersion.java @@ -39,7 +39,7 @@ public class TestSentryVersion { @Before public void setup() throws Exception { dataDir = new File(Files.createTempDir(), "sentry_policy_db"); - conf = new Configuration(false); + conf = new Configuration(true); conf.set(ServerConfig.SENTRY_STORE_JDBC_URL, "jdbc:derby:;databaseName=" + dataDir.getPath() + ";create=true"); conf.set(ServerConfig.SENTRY_STORE_JDBC_PASS, "dummy"); http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java index c5caa13..ff0374e 100644 --- a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java +++ b/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java @@ -71,7 +71,7 @@ public abstract class SentryServiceIntegrationBase extends SentryMiniKdcTestcase protected static File clientKeytab; protected static UserGroupInformation clientUgi; protected static boolean kerberos; - protected final static Configuration conf = new Configuration(false); + protected final static Configuration conf = new Configuration(true); protected PolicyFile policyFile; protected File policyFilePath; protected static Properties kdcConfOverlay = new Properties(); http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java ---------------------------------------------------------------------- diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java index 1c44b26..76669a9 100644 --- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java +++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java @@ -64,7 +64,7 @@ public abstract class AbstractTestWithDbProvider extends AbstractTestWithHiveSer } public static void createContext() throws Exception { - conf = new Configuration(false); + conf = new Configuration(true); policyFile = PolicyFile.setAdminOnServer1(ADMINGROUP); properties.put(HiveServerFactory.AUTHZ_PROVIDER_BACKEND, SimpleDBProviderBackend.class.getName()); properties.put(ConfVars.HIVE_AUTHORIZATION_TASK_FACTORY.varname, http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationBase.java ---------------------------------------------------------------------- diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationBase.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationBase.java index 9b4f4da..4588963 100644 --- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationBase.java +++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationBase.java @@ -206,7 +206,7 @@ public abstract class TestHDFSIntegrationBase { protected static Boolean ownerPrivilegeGrantEnabled = false; protected static Configuration hadoopConf; protected static final Map<String, String> sentryProperties = Maps.newHashMap(); - protected static Configuration sentryConf = new Configuration(false); + protected static Configuration sentryConf = new Configuration(true); protected static File assertCreateDir(File dir) { if(!dir.isDirectory()) { http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java ---------------------------------------------------------------------- diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java index e0b584c..8bf486e 100644 --- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java +++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java @@ -475,7 +475,7 @@ public abstract class AbstractTestWithStaticConfiguration extends RulesForE2ETes private static void setupSentryService() throws Exception { - sentryConf = new Configuration(false); + sentryConf = new Configuration(true); properties.put(HiveServerFactory.AUTHZ_PROVIDER_BACKEND, SimpleDBProviderBackend.class.getName()); @@ -551,7 +551,7 @@ public abstract class AbstractTestWithStaticConfiguration extends RulesForE2ETes if (clientKerberos) { if (sentryConf == null ) { - sentryConf = new Configuration(false); + sentryConf = new Configuration(true); } final String SENTRY_HOST = System.getProperty("sentry.host", SERVER_HOST); final String SERVER_KERBEROS_PRINCIPAL = "sentry/" + SENTRY_HOST + "@" + REALM; http://git-wip-us.apache.org/repos/asf/sentry/blob/f3f238ab/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestSentryServer.java ---------------------------------------------------------------------- diff --git a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestSentryServer.java b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestSentryServer.java index 28c3102..aefb2e7 100644 --- a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestSentryServer.java +++ b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestSentryServer.java @@ -112,7 +112,7 @@ public class TestSentryServer implements Closeable { } private Configuration getServerConfig () { - Configuration conf = new Configuration(false); + Configuration conf = new Configuration(true); conf.set(ServerConfig.SECURITY_MODE, ServerConfig.SECURITY_MODE_NONE); conf.set(ServerConfig.SENTRY_VERIFY_SCHEM_VERSION, "false"); conf.set(ServerConfig.ADMIN_GROUPS, ADMIN_GROUP + ",solr"); @@ -129,7 +129,7 @@ public class TestSentryServer implements Closeable { } private Configuration getClientConfig() { - Configuration conf = new Configuration(false); + Configuration conf = new Configuration(true); conf.set(ServerConfig.SECURITY_MODE, ServerConfig.SECURITY_MODE_NONE); conf.set(ApiConstants.ClientConfig.SERVER_RPC_ADDRESS, sentryService.getAddress().getHostName()); conf.set(ApiConstants.ClientConfig.SERVER_RPC_PORT, String.valueOf(sentryService.getAddress().getPort()));