From 5a5f9ca1f081e72550f27413a3e91b64fc91a5b0 Mon Sep 17 00:00:00 2001 From: Yongjun Zhang Date: Fri, 19 Feb 2016 10:17:37 -0800 Subject: [PATCH] HDFS-9764. DistCp doesn't print value for several arguments including -numListstatusThreads. (Wei-Chiu Chuang via Yongjun Zhang) (cherry picked from commit ba1c9d484a8d6a18b4b7365c49d09635d24e579a) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/tools/DistCpOptions.java | 10 +++++++++- .../apache/hadoop/tools/TestOptionsParser.java | 15 ++++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 8d99b0d02c8..27e74650ed1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -921,6 +921,9 @@ Release 2.8.0 - UNRELEASED HDFS-8923. Add -source flag to balancer usage message. (Chris Trezzo via szetszwo) + HDFS-9764. DistCp doesn't print value for several arguments including + -numListstatusThreads. (Wei-Chiu Chuang via Yongjun Zhang) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java index 71c4ae90eae..1e8a20cc532 100644 --- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java +++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java @@ -664,14 +664,22 @@ public class DistCpOptions { ", syncFolder=" + syncFolder + ", deleteMissing=" + deleteMissing + ", ignoreFailures=" + ignoreFailures + + ", overwrite=" + overwrite + + ", skipCRC=" + skipCRC + + ", blocking=" + blocking + + ", numListstatusThreads=" + numListstatusThreads + ", maxMaps=" + maxMaps + + ", mapBandwidth=" + mapBandwidth + ", sslConfigurationFile='" + sslConfigurationFile + '\'' + ", copyStrategy='" + copyStrategy + '\'' + + ", preserveStatus=" + preserveStatus + + ", preserveRawXattrs=" + preserveRawXattrs + + ", atomicWorkPath=" + atomicWorkPath + + ", logPath=" + logPath + ", sourceFileListing=" + sourceFileListing + ", sourcePaths=" + sourcePaths + ", targetPath=" + targetPath + ", targetPathExists=" + targetPathExists + - ", preserveRawXattrs=" + preserveRawXattrs + ", filtersFile='" + filtersFile + '\'' + '}'; } diff --git a/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java b/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java index 8d033192db6..389a8ea6e8d 100644 --- a/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java +++ b/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java @@ -397,11 +397,16 @@ public class TestOptionsParser { @Test public void testToString() { DistCpOptions option = new DistCpOptions(new Path("abc"), new Path("xyz")); - String val = "DistCpOptions{atomicCommit=false, syncFolder=false, deleteMissing=false, " + - "ignoreFailures=false, maxMaps=20, sslConfigurationFile='null', copyStrategy='uniformsize', " + - "sourceFileListing=abc, sourcePaths=null, targetPath=xyz, targetPathExists=true, " + - "preserveRawXattrs=false, filtersFile='null'}"; - Assert.assertEquals(val, option.toString()); + String val = "DistCpOptions{atomicCommit=false, syncFolder=false, " + + "deleteMissing=false, ignoreFailures=false, overwrite=false, " + + "skipCRC=false, blocking=true, numListstatusThreads=0, maxMaps=20, " + + "mapBandwidth=100.0, sslConfigurationFile='null', " + + "copyStrategy='uniformsize', preserveStatus=[], " + + "preserveRawXattrs=false, atomicWorkPath=null, logPath=null, " + + "sourceFileListing=abc, sourcePaths=null, targetPath=xyz, " + + "targetPathExists=true, filtersFile='null'}"; + String optionString = option.toString(); + Assert.assertEquals(val, optionString); Assert.assertNotSame(DistCpOptionSwitch.ATOMIC_COMMIT.toString(), DistCpOptionSwitch.ATOMIC_COMMIT.name()); }