Skip to content

Commit 689fa7d

Browse files
author
lgh
committed
spawn executorService in createControlFiles()
1 parent 82d36c8 commit 689fa7d

File tree

1 file changed

+2
-2
lines changed
  • hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs

1 file changed

+2
-2
lines changed

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ public class NNBench extends Configured implements Tool {
112112
private static final String OP_RENAME = "rename";
113113
private static final String OP_DELETE = "delete";
114114
private static final int MAX_OPERATION_EXCEPTIONS = 1000;
115-
private ExecutorService executorService =
116-
HadoopExecutors.newFixedThreadPool(2 * Runtime.getRuntime().availableProcessors());
117115

118116
// To display in the format that matches the NN and DN log format
119117
// Example: 2007-10-26 00:01:19,853
@@ -146,6 +144,8 @@ private void cleanupBeforeTestrun() throws IOException {
146144
private void createControlFiles() {
147145
LOG.info("Creating " + numberOfMaps + " control files");
148146

147+
ExecutorService executorService =
148+
HadoopExecutors.newFixedThreadPool(2 * Runtime.getRuntime().availableProcessors());
149149
List<Future<Void>> list = new ArrayList<>();
150150
for (int i = 0; i < numberOfMaps; i++) {
151151
String strFileName = "NNBench_Controlfile_" + i;

0 commit comments

Comments
 (0)