HDFS-10245. Fix the findbugs warnings in branch-2.7. Contributed by Brahma Reddy Battula.

This commit is contained in:
Akira Ajisaka 2016-04-25 22:03:48 +09:00
parent 0bb23e22ce
commit 076215024b
3 changed files with 16 additions and 2 deletions

View File

@ -161,6 +161,9 @@ Release 2.7.3 - UNRELEASED
HDFS-9555. LazyPersistFileScrubber should still sleep if there are errors
in the clear progress (Phil Yang via kihwal)
HDFS-10245. Fix the findbugs warnings in branch-2.7.
(Brahma Reddy Battula via aajisaka)
Release 2.7.2 - 2016-01-25
INCOMPATIBLE CHANGES

View File

@ -82,6 +82,17 @@
<Bug pattern="REC_CATCH_EXCEPTION" />
</Match>
<!--
we don't need to synchronize out in newStreamForAppend method because
out.streamer cannot be touched by other threads. It is false-positive.
-->
<Match>
<Class name="org.apache.hadoop.hdfs.DFSOutputStream" />
<Method name="newStreamForAppend" />
<Field name="streamer" />
<Bug pattern="IS2_INCONSISTENT_SYNC" />
</Match>
<!--
lastAppliedTxid is carefully unsynchronized in the BackupNode in a couple spots.
See the comments in BackupImage for justification.

View File

@ -2368,7 +2368,7 @@ public class DFSOutputStream extends FSOutputSummer
}
@VisibleForTesting
ExtendedBlock getBlock() {
synchronized ExtendedBlock getBlock() {
return streamer.getBlock();
}
@ -2386,7 +2386,7 @@ public class DFSOutputStream extends FSOutputSummer
* @return The times have retried to recover pipeline, for the same packet.
*/
@VisibleForTesting
int getPipelineRecoveryCount() {
synchronized int getPipelineRecoveryCount() {
return streamer.pipelineRecoveryCount;
}
}