Skip to content

Commit 0dbfa74

Browse files
author
wanghongbing
committed
rename threads option.
1 parent f99527d commit 0dbfa74

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageViewerPB.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public class OfflineImageViewerPB {
107107
+ " Delimited outputs. If not set, the processor\n"
108108
+ " constructs the namespace in memory \n"
109109
+ " before outputting text.\n"
110-
+ "-threads <args> Use multiple threads to process sub-sections.\n"
110+
+ "-m,--multiThread <arg> Use multiThread to process sub-sections.\n"
111111
+ "-h,--help Display usage information and exit\n";
112112

113113
/**
@@ -133,7 +133,7 @@ private static Options buildOptions() {
133133
options.addOption("delimiter", true, "");
134134
options.addOption("sp", false, "");
135135
options.addOption("t", "temp", true, "");
136-
options.addOption("threads", true, "");
136+
options.addOption("m", "multiThread", true, "");
137137

138138
return options;
139139
}
@@ -187,7 +187,7 @@ public static int run(String[] args) throws Exception {
187187
String delimiter = cmd.getOptionValue("delimiter",
188188
PBImageTextWriter.DEFAULT_DELIMITER);
189189
String tempPath = cmd.getOptionValue("t", "");
190-
int threads = Integer.parseInt(cmd.getOptionValue("threads", "1"));
190+
int threads = Integer.parseInt(cmd.getOptionValue("m", "1"));
191191

192192
Configuration conf = new Configuration();
193193
PrintStream out = null;

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/PBImageTextWriter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,6 @@ private void outputInSerial(Configuration conf, FileSummary summary,
703703
* STEP1: Multi-threaded process sub-sections.
704704
* Given n (n>1) threads to process k (k>=n) sections,
705705
* output parsed results of each section to tmp file in order.
706-
*
707706
* STEP2: Merge tmp files.
708707
*/
709708
private void outputInParallel(Configuration conf, FileSummary summary,

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,16 +936,16 @@ private void testPBDelimitedWriter(String db)
936936
}
937937

938938
private void testParallelPBDelimitedWriter(String db) throws Exception{
939-
String delemiter = "\t";
939+
String delimiter = "\t";
940940
int numThreads = 4;
941941

942942
File parallelDelimitedOut = new File(tempDir, "parallelDelimitedOut");
943943
if (OfflineImageViewerPB.run(new String[] {"-p", "Delimited",
944944
"-i", originalFsimage.getAbsolutePath(),
945945
"-o", parallelDelimitedOut.getAbsolutePath(),
946-
"-delimiter", delemiter,
946+
"-delimiter", delimiter,
947947
"-t", db,
948-
"-threads", String.valueOf(numThreads)}) != 0) {
948+
"-m", String.valueOf(numThreads)}) != 0) {
949949
throw new IOException("oiv returned failure outputting in parallel.");
950950
}
951951
MD5Hash parallelMd5 = MD5FileUtils.computeMd5ForFile(parallelDelimitedOut);
@@ -958,7 +958,7 @@ private void testParallelPBDelimitedWriter(String db) throws Exception{
958958
"-i", originalFsimage.getAbsolutePath(),
959959
"-o", serialDelimitedOut.getAbsolutePath(),
960960
"-t", db,
961-
"-delimiter", delemiter}) != 0) {
961+
"-delimiter", delimiter}) != 0) {
962962
throw new IOException("oiv returned failure outputting in serial.");
963963
}
964964
MD5Hash serialMd5 = MD5FileUtils.computeMd5ForFile(serialDelimitedOut);

0 commit comments

Comments
 (0)