HDFS-3615. Two BlockTokenSecretManager findbugs warnings. Contributed by Aaron T. Myers.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1360256 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aaron Myers 2012-07-11 16:10:50 +00:00
parent 91472c5539
commit 786aaca2ab
2 changed files with 6 additions and 4 deletions

View File

@ -299,6 +299,8 @@ Release 2.0.1-alpha - UNRELEASED
HDFS-3548. NamenodeFsck.copyBlock fails to create a Block Reader. HDFS-3548. NamenodeFsck.copyBlock fails to create a Block Reader.
(Colin Patrick McCabe via eli) (Colin Patrick McCabe via eli)
HDFS-3615. Two BlockTokenSecretManager findbugs warnings. (atm)
BREAKDOWN OF HDFS-3042 SUBTASKS BREAKDOWN OF HDFS-3042 SUBTASKS
HDFS-2185. HDFS portion of ZK-based FailoverController (todd) HDFS-2185. HDFS portion of ZK-based FailoverController (todd)

View File

@ -116,7 +116,7 @@ public class BlockTokenSecretManager extends
} }
@VisibleForTesting @VisibleForTesting
public void setSerialNo(int serialNo) { public synchronized void setSerialNo(int serialNo) {
this.serialNo = (serialNo & LOW_MASK) | (nnIndex << 31); this.serialNo = (serialNo & LOW_MASK) | (nnIndex << 31);
} }
@ -189,7 +189,7 @@ public class BlockTokenSecretManager extends
* Update block keys if update time > update interval. * Update block keys if update time > update interval.
* @return true if the keys are updated. * @return true if the keys are updated.
*/ */
public boolean updateKeys(final long updateTime) throws IOException { public synchronized boolean updateKeys(final long updateTime) throws IOException {
if (updateTime > keyUpdateInterval) { if (updateTime > keyUpdateInterval) {
return updateKeys(); return updateKeys();
} }
@ -371,7 +371,7 @@ public class BlockTokenSecretManager extends
} }
@VisibleForTesting @VisibleForTesting
public void setKeyUpdateIntervalForTesting(long millis) { public synchronized void setKeyUpdateIntervalForTesting(long millis) {
this.keyUpdateInterval = millis; this.keyUpdateInterval = millis;
} }
@ -381,7 +381,7 @@ public class BlockTokenSecretManager extends
} }
@VisibleForTesting @VisibleForTesting
public int getSerialNoForTesting() { public synchronized int getSerialNoForTesting() {
return serialNo; return serialNo;
} }