[
https://issues.apache.org/jira/browse/MAPREDUCE-7469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811717#comment-17811717
]
ASF GitHub Bot commented on MAPREDUCE-7469:
-------------------------------------------
LiuGuH commented on code in PR #6463:
URL: https://github.com/apache/hadoop/pull/6463#discussion_r1469037519
##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java:
##########
@@ -134,27 +143,59 @@ private void cleanupBeforeTestrun() throws IOException {
*
* @throws IOException on error
*/
- private void createControlFiles() throws IOException {
+ private void createControlFiles() {
LOG.info("Creating " + numberOfMaps + " control files");
+ List<Future<Void>> list = new ArrayList<>();
for (int i = 0; i < numberOfMaps; i++) {
String strFileName = "NNBench_Controlfile_" + i;
Path filePath = new Path(new Path(baseDir, CONTROL_DIR_NAME),
strFileName);
+ Future<Void> future = executorService.submit(new
CreateControlFile(strFileName, filePath, i));
+ list.add(future);
+ }
+
+ for (int i = 0; i < list.size(); i++) {
+ try {
+ list.get(i).get();
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Creating control files Error.", e);
+ }
+ }
+
+ executorService.shutdown();
Review Comment:
Done. Thanks.
> NNBench createControlFiles should use thread pool to improve performance.
> -------------------------------------------------------------------------
>
> Key: MAPREDUCE-7469
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-7469
> Project: Hadoop Map/Reduce
> Issue Type: Improvement
> Reporter: liuguanghua
> Priority: Minor
> Labels: pull-request-available
>
> NNBench is a good tool for NN performance test. And with multiples maps it
> will wait long time in createControlFiles. This can use thread pool to
> increase concurrency.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]