HBASE-15148 Resolve IS2_INCONSISTENT_SYNC findbugs warning in AuthenticationTokenSecretManager (Yu Li)
This commit is contained in:
parent
17b5f04270
commit
37d15e05d8
|
@ -287,6 +287,10 @@ public class AuthenticationTokenSecretManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
synchronized long getLastKeyUpdate() {
|
||||||
|
return lastKeyUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
public static SecretKey createSecretKey(byte[] raw) {
|
public static SecretKey createSecretKey(byte[] raw) {
|
||||||
return SecretManager.createSecretKey(raw);
|
return SecretManager.createSecretKey(raw);
|
||||||
}
|
}
|
||||||
|
@ -340,10 +344,7 @@ public class AuthenticationTokenSecretManager
|
||||||
|
|
||||||
// clear any expired
|
// clear any expired
|
||||||
removeExpiredKeys();
|
removeExpiredKeys();
|
||||||
long localLastKeyUpdate;
|
long localLastKeyUpdate = getLastKeyUpdate();
|
||||||
synchronized (this) {
|
|
||||||
localLastKeyUpdate = lastKeyUpdate;
|
|
||||||
}
|
|
||||||
if (localLastKeyUpdate + keyUpdateInterval < now) {
|
if (localLastKeyUpdate + keyUpdateInterval < now) {
|
||||||
// roll a new master key
|
// roll a new master key
|
||||||
rollCurrentKey();
|
rollCurrentKey();
|
||||||
|
|
Loading…
Reference in New Issue