From baa6ef020797ab2b562d48ce08585c4844b4755c Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Tue, 29 Sep 2015 14:56:06 -0700 Subject: [PATCH] HDFS-9174. Fix findbugs warnings in FSOutputSummer.tracer and DirectoryScanner$ReportCompiler.currentThread. Contributed by Yi Liu. --- .../main/java/org/apache/hadoop/fs/FSOutputSummer.java | 3 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/datanode/DirectoryScanner.java | 8 -------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java index aec635df378..8ce06a9375a 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java @@ -22,7 +22,6 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.util.DataChecksum; import org.apache.htrace.core.TraceScope; -import org.apache.htrace.core.Tracer; import java.io.IOException; import java.io.OutputStream; @@ -43,8 +42,6 @@ abstract public class FSOutputSummer extends OutputStream { private byte checksum[]; // The number of valid bytes in the buffer. private int count; - // The HTrace tracer to use - private Tracer tracer; // We want this value to be a multiple of 3 because the native code checksums // 3 chunks simultaneously. The chosen value of 9 strikes a balance between diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 36a93e049d4..a650e768e6e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1115,6 +1115,9 @@ Release 2.8.0 - UNRELEASED HDFS-9141. Thread leak in Datanode#refreshVolumes. (Uma Maheswara Rao G via yliu) + HDFS-9174. Fix findbugs warnings in FSOutputSummer.tracer and + DirectoryScanner$ReportCompiler.currentThread. (Yi Liu via wheat9) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java index b8ea5bf09e3..392c1214756 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java @@ -784,12 +784,6 @@ public class DirectoryScanner implements Runnable { // purposes private final StopWatch perfTimer = new StopWatch(); - /** - * The associated thread. Used for testing purposes only. - */ - @VisibleForTesting - Thread currentThread; - /** * Create a report compiler for the given volume on the given datanode. * @@ -809,8 +803,6 @@ public class DirectoryScanner implements Runnable { */ @Override public ScanInfoPerBlockPool call() throws IOException { - currentThread = Thread.currentThread(); - String[] bpList = volume.getBlockPoolList(); ScanInfoPerBlockPool result = new ScanInfoPerBlockPool(bpList.length); for (String bpid : bpList) {