You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aa...@apache.org on 2016/04/25 15:05:22 UTC

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

Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 0bb23e22c -> 076215024


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


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

Branch: refs/heads/branch-2.7
Commit: 076215024bd3811a2b05e26c501f8b1ec27904ce
Parents: 0bb23e2
Author: Akira Ajisaka <aa...@apache.org>
Authored: Mon Apr 25 22:03:48 2016 +0900
Committer: Akira Ajisaka <aa...@apache.org>
Committed: Mon Apr 25 22:03:48 2016 +0900

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt              |  3 +++
 .../hadoop-hdfs/dev-support/findbugsExcludeFile.xml      | 11 +++++++++++
 .../java/org/apache/hadoop/hdfs/DFSOutputStream.java     |  4 ++--
 3 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/07621502/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 085a33e..92362b6 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -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

http://git-wip-us.apache.org/repos/asf/hadoop/blob/07621502/hadoop-hdfs-project/hadoop-hdfs/dev-support/findbugsExcludeFile.xml
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/dev-support/findbugsExcludeFile.xml b/hadoop-hdfs-project/hadoop-hdfs/dev-support/findbugsExcludeFile.xml
index dedeece..6f1719a 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/dev-support/findbugsExcludeFile.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/dev-support/findbugsExcludeFile.xml
@@ -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.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/07621502/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java
index ebeaacb..f8c8592 100755
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java
@@ -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;
   }
 }