smengcl commented on code in PR #7463:
URL: https://github.com/apache/ozone/pull/7463#discussion_r1853228024


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/HsyncGenerator.java:
##########
@@ -87,55 +97,75 @@ public HsyncGenerator() {
 
   @Override
   public Void call() throws Exception {
-    super.init();
+    init();
 
     if (configuration == null) {
       configuration = freon.createOzoneConfiguration();
     }
+    URI uri = URI.create(rootPath);
 
-    outputStreams = new FSDataOutputStream[numberOfFiles];
-    files = new Path[numberOfFiles];
-    callsPerFile = new AtomicInteger[numberOfFiles];
-    FileSystem fileSystem = getFileSystem();
-    for (int i = 0; i < numberOfFiles; i++) {
-      Path file = new Path(getRootPath() + "/" + generateObjectName(i));
-      fileSystem.mkdirs(file.getParent());
-      outputStreams[i] = fileSystem.create(file);
-      files[i] = file;
-      callsPerFile[i] = new AtomicInteger();
-
-      LOG.info("Created file for testing: {}", file);
-    }
+    FileSystem fileSystem = FileSystem.get(uri, configuration);
+    Path file = new Path(rootPath + "/" + generateObjectName(0));
+    fileSystem.mkdirs(file.getParent());
+    outputStream = fileSystem.create(file);
+
+    LOG.info("Created file for testing: {}", file);
 
     timer = getMetrics().timer("hsync-generator");
     data = PayloadUtils.generatePayload(writeSize);
 
+    startTransactionWriter();
+
     try {
       runTests(this::sendHsync);
     } finally {
-      for (FSDataOutputStream outputStream : outputStreams) {
         outputStream.close();

Review Comment:
   nit
   
   ```suggestion
         outputStream.close();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to