You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/07/27 11:35:41 UTC

[GitHub] [hadoop-ozone] aryangupta1998 opened a new pull request #1264: HDDS-4035. Add logs to HadoopNestedDirGenerator.

aryangupta1998 opened a new pull request #1264:
URL: https://github.com/apache/hadoop-ozone/pull/1264


   ## What changes were proposed in this pull request?
   
   Added logs to HadoopNestedDirGenerator.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4035
   
   ## How was this patch tested?
   
   Tested Manually.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] xiaoyuyao commented on a change in pull request #1264: HDDS-4035. Update logs of HadoopDirGenerator.

Posted by GitBox <gi...@apache.org>.
xiaoyuyao commented on a change in pull request #1264:
URL: https://github.com/apache/hadoop-ozone/pull/1264#discussion_r463393431



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -301,6 +301,18 @@ public void printReport() {
     messages.forEach(print);
   }
 
+  /**
+   * Print out reports with the given message.
+   */
+  public void print(String msg){
+    List<String> messages = new LinkedList<>();
+    messages.add(msg);

Review comment:
       Given we only have one String msg here, we can eliminate thew List allocation here by just simply call
   print.accept(msg) in line 313. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] aryangupta1998 commented on a change in pull request #1264: HDDS-4035. Update logs of HadoopDirGenerator.

Posted by GitBox <gi...@apache.org>.
aryangupta1998 commented on a change in pull request #1264:
URL: https://github.com/apache/hadoop-ozone/pull/1264#discussion_r463480659



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -301,6 +301,18 @@ public void printReport() {
     messages.forEach(print);
   }
 
+  /**
+   * Print out reports with the given message.
+   */
+  public void print(String msg){
+    List<String> messages = new LinkedList<>();
+    messages.add(msg);

Review comment:
       Thanks @xiaoyuyao. Fixed the print function.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] rakeshadr merged pull request #1264: HDDS-4035. Update logs of HadoopDirGenerator.

Posted by GitBox <gi...@apache.org>.
rakeshadr merged pull request #1264:
URL: https://github.com/apache/hadoop-ozone/pull/1264


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] aryangupta1998 commented on a change in pull request #1264: HDDS-4035. Update logs of HadoopDirGenerator.

Posted by GitBox <gi...@apache.org>.
aryangupta1998 commented on a change in pull request #1264:
URL: https://github.com/apache/hadoop-ozone/pull/1264#discussion_r462503625



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/HadoopNestedDirGenerator.java
##########
@@ -109,5 +117,7 @@ private void createDir(long counter) throws Exception {
       Path dir = new Path(rootPath.concat("/").concat(childDir));
       fileSystem.mkdirs(dir.getParent());
     }
+    System.out.println("\nSuccessfully created directories. Total " +

Review comment:
       Thanks for the review Rakesh. I have updated the PR and also the logs of HadoopTreeDirGenerator as per your suggestions.

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -301,6 +301,15 @@ public void printReport() {
     messages.forEach(print);
   }
 
+  public void print(String s){

Review comment:
       Added javadoc, changed 's' to 'msg'.

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/HadoopDirTreeGenerator.java
##########
@@ -97,17 +97,25 @@
 
   @Override
   public Void call() throws Exception {
-
-    init();
-    OzoneConfiguration configuration = createOzoneConfiguration();
-    fileSystem = FileSystem.get(URI.create(rootPath), configuration);
-
-    contentGenerator = new ContentGenerator(fileSizeInBytes, bufferSize);
-    timer = getMetrics().timer("file-create");
-
-    runTests(this::createDir);
+    String s;
+    if (depth <= 0) {
+      s = "Invalid depth value, depth value should be greater than zero!";
+      print(s);
+    } else if (span <= 0) {
+      s = "Invalid span value, span value should be greater than zero!";
+      print(s);
+    } else {
+      init();
+      OzoneConfiguration configuration = createOzoneConfiguration();
+      fileSystem = FileSystem.get(URI.create(rootPath), configuration);
+
+      contentGenerator = new ContentGenerator(fileSizeInBytes, bufferSize);
+      timer = getMetrics().timer("file-create");
+
+      runTests(this::createDir);
+      return null;

Review comment:
       Removed 'return null' statement inside else block.

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -301,6 +301,19 @@ public void printReport() {
     messages.forEach(print);
   }
 
+  /**
+   * Print out the messages for HadoopNestedDirGenerator

Review comment:
       Changed the javadoc.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] rakeshadr commented on pull request #1264: HDDS-4035. Update logs of HadoopDirGenerator.

Posted by GitBox <gi...@apache.org>.
rakeshadr commented on pull request #1264:
URL: https://github.com/apache/hadoop-ozone/pull/1264#issuecomment-669306717


   Merged the changes to master branch. Thanks @aryangupta1998 for the contribution!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] rakeshadr commented on a change in pull request #1264: HDDS-4035. Update logs of HadoopDirGenerator.

Posted by GitBox <gi...@apache.org>.
rakeshadr commented on a change in pull request #1264:
URL: https://github.com/apache/hadoop-ozone/pull/1264#discussion_r462716072



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -301,6 +301,15 @@ public void printReport() {
     messages.forEach(print);
   }
 
+  public void print(String s){

Review comment:
       Latest patch looks good. Adding few minor comments:
   
   Please add javadoc and change the parameter name 's' to 'msg', just to improve more readable.

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/HadoopDirTreeGenerator.java
##########
@@ -97,17 +97,25 @@
 
   @Override
   public Void call() throws Exception {
-
-    init();
-    OzoneConfiguration configuration = createOzoneConfiguration();
-    fileSystem = FileSystem.get(URI.create(rootPath), configuration);
-
-    contentGenerator = new ContentGenerator(fileSizeInBytes, bufferSize);
-    timer = getMetrics().timer("file-create");
-
-    runTests(this::createDir);
+    String s;
+    if (depth <= 0) {
+      s = "Invalid depth value, depth value should be greater than zero!";
+      print(s);
+    } else if (span <= 0) {
+      s = "Invalid span value, span value should be greater than zero!";
+      print(s);
+    } else {
+      init();
+      OzoneConfiguration configuration = createOzoneConfiguration();
+      fileSystem = FileSystem.get(URI.create(rootPath), configuration);
+
+      contentGenerator = new ContentGenerator(fileSizeInBytes, bufferSize);
+      timer = getMetrics().timer("file-create");
+
+      runTests(this::createDir);
+      return null;

Review comment:
       minor comment: please remove 'return null' inside the else block as below return is sufficient.

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -301,6 +301,15 @@ public void printReport() {
     messages.forEach(print);
   }
 
+  public void print(String s){

Review comment:
       Latest patch looks good. Adding few minor comments:
   
   Please add javadoc and change the parameter name 's' to 'msg', just to make it more readable.

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -301,6 +301,19 @@ public void printReport() {
     messages.forEach(print);
   }
 
+  /**
+   * Print out the messages for HadoopNestedDirGenerator

Review comment:
       As this is base class, please remove the inherited class details here.
   
   you can write something like,
   "Print out reports with the given message."
   
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] rakeshadr commented on pull request #1264: HDDS-4035. Update logs of HadoopDirGenerator.

Posted by GitBox <gi...@apache.org>.
rakeshadr commented on pull request #1264:
URL: https://github.com/apache/hadoop-ozone/pull/1264#issuecomment-669106569


   @aryangupta1998, Thanks for updating the PR!
   
   The changes look good to me. Pending GREEN CI


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org