sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sra...@apache.org
Subject git commit: SENTRY-219: Sentry Cache Backend Provider initialization does not work as expected ( Lenni Kuff via Sravya Tirukkovalur)
Date Tue, 03 Jun 2014 02:35:35 GMT
Repository: incubator-sentry
Updated Branches:
  refs/heads/master 12d6c965f -> f24db42b5


SENTRY-219: Sentry Cache Backend Provider initialization does not work as expected ( Lenni
Kuff via Sravya Tirukkovalur)


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

Branch: refs/heads/master
Commit: f24db42b576c67c1b6caa8be6f8ead6b949d086a
Parents: 12d6c96
Author: Sravya Tirukkovalur <sravya@clouera.com>
Authored: Mon Jun 2 19:33:31 2014 -0700
Committer: Sravya Tirukkovalur <sravya@clouera.com>
Committed: Mon Jun 2 19:33:31 2014 -0700

----------------------------------------------------------------------
 .../sentry/provider/cache/SimpleCacheProviderBackend.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/f24db42b/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java
b/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java
index 396c21c..4b98447 100644
--- a/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java
+++ b/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java
@@ -32,19 +32,26 @@ public class SimpleCacheProviderBackend implements ProviderBackend {
 
   private PrivilegeCache cacheHandle;
   private Configuration conf;
+  private boolean isInitialized = false;
 
   public SimpleCacheProviderBackend(Configuration conf, String resourcePath) {
     this.conf = conf;
   }
 
+  /**
+   * Initializes the SimpleCacheProviderBackend. Can be called multiple times, subsequent
+   * calls will be a no-op.
+   */
   @Override
   public void initialize(ProviderBackendContext context) {
+    if (isInitialized) return;
+    isInitialized = true;
     cacheHandle = (PrivilegeCache) context.getBindingHandle();
     assert cacheHandle != null;
   }
 
   private boolean initialized() {
-    return cacheHandle != null;
+    return isInitialized;
   }
 
   @Override


Mime
View raw message