sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sp...@apache.org
Subject sentry git commit: SENTRY-1921: Make SentryServiceFactory.create static and all calling instances use the static call (Jan Hentschel, reviewed by Sergio Pena)
Date Mon, 11 Sep 2017 14:36:51 GMT
Repository: sentry
Updated Branches:
  refs/heads/master ea524f1bd -> 403100371


SENTRY-1921: Make SentryServiceFactory.create static and all calling instances use the static
call (Jan Hentschel, reviewed by Sergio Pena)


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

Branch: refs/heads/master
Commit: 4031003719edb820edcf1e5f18ee03fb6810cef1
Parents: ea524f1
Author: Jan Hentschel <jan.hentschel@ultratendency.com>
Authored: Mon Sep 11 09:36:17 2017 -0500
Committer: Sergio Pena <sergio.pena@cloudera.com>
Committed: Mon Sep 11 09:36:17 2017 -0500

----------------------------------------------------------------------
 .../org/apache/sentry/service/thrift/SentryServiceFactory.java  | 5 ++---
 .../generic/service/thrift/TestSentryGenericServiceClient.java  | 2 +-
 .../db/service/thrift/TestSentryPolicyServiceClient.java        | 2 +-
 .../provider/db/service/thrift/TestSentryServiceClientPool.java | 2 +-
 .../db/service/thrift/TestSentryServiceWithInvalidMsgSize.java  | 2 +-
 .../sentry/service/thrift/SentryServiceIntegrationBase.java     | 2 +-
 .../sentry/tests/e2e/dbprovider/AbstractTestWithDbProvider.java | 4 ++--
 .../apache/sentry/tests/e2e/minisentry/InternalSentrySrv.java   | 2 +-
 .../sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java     | 2 +-
 .../db/integration/AbstractSolrSentryTestWithDbProvider.java    | 2 +-
 .../sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java     | 2 +-
 11 files changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java
index 1685702..c1d81ed 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java
@@ -17,12 +17,11 @@
  */
 
 package org.apache.sentry.service.thrift;
+
 import org.apache.hadoop.conf.Configuration;
 
 public class SentryServiceFactory {
-
-  public SentryService create(Configuration conf) throws Exception {
+  public static SentryService create(Configuration conf) throws Exception {
     return new SentryService(conf);
   }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceClient.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceClient.java
b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceClient.java
index 8959ad8..5813626 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceClient.java
+++ b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceClient.java
@@ -51,7 +51,7 @@ public class TestSentryGenericServiceClient extends SentryGenericServiceIntegrat
         client.dropRoleIfExists(requestorUserName, roleName, "solr");
         client.createRole(requestorUserName, roleName, "solr");
         stopSentryService();
-        server = new SentryServiceFactory().create(conf);
+        server = SentryServiceFactory.create(conf);
         startSentryService();
         client.dropRole(requestorUserName, roleName, "solr");
       }

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyServiceClient.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyServiceClient.java
b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyServiceClient.java
index 3b3b30e..e464ef1 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyServiceClient.java
+++ b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryPolicyServiceClient.java
@@ -53,7 +53,7 @@ public class TestSentryPolicyServiceClient extends SentryServiceIntegrationBase
         client.createRole(requestorUserName, roleName);
         client.listRoles(requestorUserName);
         stopSentryService();
-        server = new SentryServiceFactory().create(conf);
+        server = SentryServiceFactory.create(conf);
         startSentryService();
         client.listRoles(requestorUserName);
         client.dropRole(requestorUserName, roleName);

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
index fe4164d..dff7e1a 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
+++ b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceClientPool.java
@@ -54,7 +54,7 @@ public class TestSentryServiceClientPool extends SentryServiceIntegrationBase
{
         client.createRole(requestorUserName, roleName);
         client.listRoles(requestorUserName);
         stopSentryService();
-        server = new SentryServiceFactory().create(conf);
+        server = SentryServiceFactory.create(conf);
         startSentryService();
         client.listRoles(requestorUserName);
         client.dropRole(requestorUserName, roleName);

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
index 32e67b9..072d294 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
+++ b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithInvalidMsgSize.java
@@ -90,7 +90,7 @@ public class TestSentryServiceWithInvalidMsgSize extends SentryServiceIntegratio
         stopSentryService();
 
         // create a server with a small max thrift message size
-        server = new SentryServiceFactory().create(confWithSmallMaxMsgSize);
+        server = SentryServiceFactory.create(confWithSmallMaxMsgSize);
         startSentryService();
 
         setLocalGroupMapping(ADMIN_USER, REQUESTER_USER_GROUP_NAMES);

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java
b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java
index 6895720..7ed303c 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java
+++ b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java
@@ -178,7 +178,7 @@ public abstract class SentryServiceIntegrationBase extends SentryMiniKdcTestcase
     conf.set(ServerConfig.SENTRY_STORE_JDBC_URL,
         "jdbc:derby:;databaseName=" + dbDir.getPath() + ";create=true");
     conf.set(ServerConfig.SENTRY_STORE_JDBC_PASS, "dummy");
-    server = new SentryServiceFactory().create(conf);
+    server = SentryServiceFactory.create(conf);
     conf.set(ClientConfig.SERVER_RPC_ADDRESS, server.getAddress().getHostName());
     conf.set(ClientConfig.SERVER_RPC_PORT, String.valueOf(server.getAddress().getPort()));
     conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING,

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/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 b416ef8..d606259 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
@@ -88,7 +88,7 @@ public abstract class AbstractTestWithDbProvider extends AbstractTestWithHiveSer
       conf.set(entry.getKey(), entry.getValue());
     }
     for (int i = 0; i < sentryServerCount; i++) {
-      SentryService server = new SentryServiceFactory().create(new Configuration(conf));
+      SentryService server = SentryServiceFactory.create(new Configuration(conf));
       servers.add(server);
       properties.put(ClientConfig.SERVER_RPC_ADDRESS, server.getAddress()
           .getHostName());
@@ -156,7 +156,7 @@ public abstract class AbstractTestWithDbProvider extends AbstractTestWithHiveSer
     Preconditions.checkArgument((serverCount > 0), "Server count should > 0.");
     servers = new ArrayList<SentryService>(serverCount);
     for (int i = 0; i < sentryServerCount; i++) {
-      SentryService server = new SentryServiceFactory().create(new Configuration(conf));
+      SentryService server = SentryServiceFactory.create(new Configuration(conf));
       servers.add(server);
     }
     startSentryService();

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/minisentry/InternalSentrySrv.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/minisentry/InternalSentrySrv.java
b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/minisentry/InternalSentrySrv.java
index 4cfb1f7..e64f5cd 100644
--- a/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/minisentry/InternalSentrySrv.java
+++ b/sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/minisentry/InternalSentrySrv.java
@@ -111,7 +111,7 @@ public class InternalSentrySrv implements SentrySrv {
 
     for (int count = 0; count < numServers; count++) {
       Configuration servConf = new Configuration(sentryConf);
-      SentryService sentryServer = new SentryServiceFactory().create(servConf);
+      SentryService sentryServer = SentryServiceFactory.create(servConf);
       servConf.set(ClientConfig.SERVER_RPC_ADDRESS, sentryServer.getAddress()
           .getHostName());
       servConf.setInt(ClientConfig.SERVER_RPC_PORT, sentryServer.getAddress()

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java
b/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java
index 7c45999..0aa6fd3 100644
--- a/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java
+++ b/sentry-tests/sentry-tests-kafka/src/test/java/org/apache/sentry/tests/e2e/kafka/AbstractKafkaSentryTestBase.java
@@ -140,7 +140,7 @@ public class AbstractKafkaSentryTestBase {
         ServerConfig.SENTRY_STORE_LOCAL_GROUP_MAPPING);
     conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING_RESOURCE,
         policyFilePath.getPath());
-    sentryServer = new SentryServiceFactory().create(conf);
+    sentryServer = SentryServiceFactory.create(conf);
   }
 
   public static File createTempDir() {

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java
b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java
index ccea82e..b2aa9f4 100644
--- a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java
+++ b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/db/integration/AbstractSolrSentryTestWithDbProvider.java
@@ -132,7 +132,7 @@ public class AbstractSolrSentryTestWithDbProvider extends AbstractSolrSentryTest
     conf.set(ServerConfig.SENTRY_STORE_JDBC_PASS, "dummy");
     conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING_RESOURCE,
         policyFilePath.getPath());
-    server = new SentryServiceFactory().create(conf);
+    server = SentryServiceFactory.create(conf);
 
     conf.set(ClientConfig.SERVER_RPC_ADDRESS, server.getAddress().getHostName());
     conf.set(ClientConfig.SERVER_RPC_PORT, String.valueOf(server.getAddress().getPort()));

http://git-wip-us.apache.org/repos/asf/sentry/blob/40310037/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
b/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
index 80f158a..b27dbc2 100644
--- a/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
+++ b/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
@@ -136,7 +136,7 @@ public class AbstractSqoopSentryTestBase {
         ServerConfig.SENTRY_STORE_LOCAL_GROUP_MAPPING);
     conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING_RESOURCE,
         policyFilePath.getPath());
-    server = new SentryServiceFactory().create(conf);
+    server = SentryServiceFactory.create(conf);
   }
 
   public static File createTempDir() {


Mime
View raw message