You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2019/11/13 20:16:49 UTC
[hadoop] branch trunk updated: HADOOP-16585.
[Tool:NNloadGeneratorMR] Multiple threads are using same id for creating
file LoadGenerator#write. Contributed by Ranith Sardar.
This is an automated email from the ASF dual-hosted git repository.
surendralilhore pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 73a386a HADOOP-16585. [Tool:NNloadGeneratorMR] Multiple threads are using same id for creating file LoadGenerator#write. Contributed by Ranith Sardar.
73a386a is described below
commit 73a386ab761948aa1ae229855e47634897ca984e
Author: Surendra Singh Lilhore <su...@apache.org>
AuthorDate: Thu Nov 14 01:45:46 2019 +0530
HADOOP-16585. [Tool:NNloadGeneratorMR] Multiple threads are using same id for creating file LoadGenerator#write. Contributed by Ranith Sardar.
---
.../test/java/org/apache/hadoop/fs/loadGenerator/LoadGenerator.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/loadGenerator/LoadGenerator.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/loadGenerator/LoadGenerator.java
index b74e75d..4b3bd2f 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/loadGenerator/LoadGenerator.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/loadGenerator/LoadGenerator.java
@@ -31,6 +31,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.Random;
+import java.util.UUID;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
@@ -295,7 +296,8 @@ public class LoadGenerator extends Configured implements Tool {
*/
private void write() throws IOException {
String dirName = dirs.get(r.nextInt(dirs.size()));
- Path file = new Path(dirName, hostname+id);
+ Path file =
+ new Path(dirName, hostname + id + UUID.randomUUID().toString());
double fileSize = 0;
while ((fileSize = r.nextGaussian()+2)<=0) {}
genFile(file, (long)(fileSize*BLOCK_SIZE));
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org