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/30 12:11:45 UTC

[GitHub] [hadoop-ozone] elek commented on a change in pull request #1255: HDDS-4021. Organize Recon DBs into a 'DBDefinition'.

elek commented on a change in pull request #1255:
URL: https://github.com/apache/hadoop-ozone/pull/1255#discussion_r462949586



##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBDefinitionFactory.java
##########
@@ -40,10 +46,24 @@ private DBDefinitionFactory() {
     dbMap.put(new OMDBDefinition().getName(), new OMDBDefinition());
   }
 
-  public static DBDefinition getDefinition(String dbName){
+  public static DBDefinition getDefinition(String dbName, String type){

Review comment:
       I am not sure if we need type here. I think this can be simplified as:
   
   ```java
    public static DBDefinition getDefinition(String dbName, String type){
       if (dbMap.containsKey(dbName)){
         return dbMap.get(dbName);
     }
       if (dbName.equals(RECON_SCM_DB_NAME)) {
         return new ReconSCMDBDefinition();
       } else if (dbName.startsWith(RECON_CONTAINER_KEY_DB)) {
         return new ReconDBDefinition(dbName);
       } else if (dbName.startsWith(RECON_OM_SNAPSHOT_DB)) {
         return new OMDBDefinition();
       }
       return null;
     }
   ```
   
   Seems to be a good logic which just works.
   
   Or actually `RECON_SCM_DB_NAME` also can be added to the map, so you don't need the firts condition

##########
File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java
##########
@@ -44,28 +44,46 @@
             description = "Table name")
   private String tableName;
 
+  @CommandLine.Option(names = {"--withKey"},

Review comment:
       NIT: as I am an oldschool command line user, I would prefer to use `--with-keys` instead of camel case




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