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 2021/12/13 07:45:12 UTC

[GitHub] [ozone] sky76093016 opened a new pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

sky76093016 opened a new pull request #2917:
URL: https://github.com/apache/ozone/pull/2917


   ## What changes were proposed in this pull request?
   
   Use `--with-keys=true` to print the proper JSON.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/projects/HDDS/issues/HDDS-6064
   
   ## How was this patch tested?
   
   `docker-compose` test 
   


-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] adoroszlai commented on a change in pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#discussion_r793977007



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,

Review comment:
       My 2 cents: I don't think boolean flags should ever be required, as they only have two possible values.  Usually they should default to `false` (assuming the variable that gets set matches their wording), so that you only have to specify it if you want to set it to `true`.  If we want the default behavior to be including keys in output, the flag would better be worded as `--omit-keys`.  Default value would be `true` if the variable is still `withKeys`, or `false` if the variable is renamed and its usage flipped (`if (withKeys)` -> `if (!omitKeys)`).




-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] sky76093016 commented on a change in pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on a change in pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#discussion_r772069297



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,

Review comment:
       Thanks to @cku328  for the documentation.
   This is a discussion, if `required` is set to `false`, I will delete this line.




-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] adoroszlai commented on a change in pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#discussion_r823075452



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,

Review comment:
       Thanks again @sky76093016 for the patch.  Can we resolve this minor issue about `required = true` parameter?




-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] cku328 commented on a change in pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
cku328 commented on a change in pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#discussion_r767527501



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,
       description = "List Key -> Value instead of just Value.",
-      defaultValue = "false",
+      defaultValue = "true",

Review comment:
       Thanks @sky76093016 for working on this.
   Do we need to change the default value of this option `--with-keys` to true?




-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] cku328 commented on a change in pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
cku328 commented on a change in pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#discussion_r771114910



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,

Review comment:
       > Thanks to @errose28 ’s review, I think it’s better to change `required` to `false` here. The purpose of using `false` is to allow users to make choices according to their needs. What do you think?
   
   According to [Picocli's package documentation](https://picocli.info/apidocs/picocli/CommandLine.Option.html#required--), the default value of this `required` element is `false`, so I think you just need to delete this line.
   
   ![image](https://user-images.githubusercontent.com/14295594/146494383-7717515a-4bec-4e07-8058-d7a69179d894.png)
   




-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] sky76093016 commented on a change in pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on a change in pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#discussion_r770191799



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,

Review comment:
       Thanks to @errose28 ’s review, I think it’s better to change `required` to `false` here. The purpose of using `false` is to allow users to make choices according to their needs. What do you think?




-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] cku328 commented on a change in pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
cku328 commented on a change in pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#discussion_r771111484



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,
       description = "List Key -> Value instead of just Value.",
-      defaultValue = "false",
+      defaultValue = "true",

Review comment:
       Thanks @errose28 for answering my question. I agree with you.




-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] sky76093016 commented on pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#issuecomment-992193407


   @errose28 Please take a look.


-- 
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: issues-unsubscribe@ozone.apache.org

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



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


[GitHub] [ozone] errose28 commented on a change in pull request #2917: HDDS-6064. `ozone debug ldb` should print proper JSON with `--with-keys=true`

Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #2917:
URL: https://github.com/apache/ozone/pull/2917#discussion_r770090849



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,

Review comment:
       Do we want to require this? I think we can pick a sensible default, either true or false, and leave the flag optional.

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -61,8 +61,9 @@
   private String tableName;
 
   @CommandLine.Option(names = {"--with-keys"},
+      required = true,
       description = "List Key -> Value instead of just Value.",
-      defaultValue = "false",
+      defaultValue = "true",

Review comment:
       I think with keys makes more sense defaulted to true, as I would expect to see key->value pairs if reading a key-value store. Unless there's a common case where the output is too verbose.




-- 
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: issues-unsubscribe@ozone.apache.org

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



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