You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2016/02/10 08:55:16 UTC

hbase git commit: HBASE-15148 Resolve IS2_INCONSISTENT_SYNC findbugs warning in AuthenticationTokenSecretManager (Yu Li)

Repository: hbase
Updated Branches:
  refs/heads/0.98 e18b62cb9 -> 52355ab1d


HBASE-15148 Resolve IS2_INCONSISTENT_SYNC findbugs warning in AuthenticationTokenSecretManager (Yu Li)

Conflicts:
	hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java


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

Branch: refs/heads/0.98
Commit: 52355ab1dec748549ec66332d5a5b8d2d4d623e2
Parents: e18b62c
Author: tedyu <yu...@gmail.com>
Authored: Fri Jan 22 02:49:04 2016 -0800
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Feb 9 23:53:33 2016 -0800

----------------------------------------------------------------------
 .../security/token/AuthenticationTokenSecretManager.java     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/52355ab1/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java
index 408f11d..b85c29e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSecretManager.java
@@ -286,6 +286,10 @@ public class AuthenticationTokenSecretManager
     }
   }
 
+  synchronized long getLastKeyUpdate() {
+    return lastKeyUpdate;
+  }
+
   public static SecretKey createSecretKey(byte[] raw) {
     return SecretManager.createSecretKey(raw);
   }
@@ -339,8 +343,8 @@ public class AuthenticationTokenSecretManager
 
         // clear any expired
         removeExpiredKeys();
-
-        if (lastKeyUpdate + keyUpdateInterval < now) {
+        long localLastKeyUpdate = getLastKeyUpdate();
+        if (localLastKeyUpdate + keyUpdateInterval < now) {
           // roll a new master key
           rollCurrentKey();
         }