szetszwo commented on code in PR #4434:
URL: https://github.com/apache/ozone/pull/4434#discussion_r1144229064


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java:
##########
@@ -318,7 +319,8 @@ private void printAppropriateTable(
         }
         ManagedRocksIterator iterator;
         if (containerId > 0 && dnDBSchemaVersion != null &&
-            dnDBSchemaVersion.equals("V3")) {
+            dnDBSchemaVersion.equals("V3") &&
+                parent.getDbPath().contains(OzoneConsts.CONTAINER_DB_NAME)) {

Review Comment:
   Store `schemaV3` as below.  It can be passed to `displayTable(..)` later on.
   ```java
           final boolean schemaV3 = dnDBSchemaVersion != null &&
               dnDBSchemaVersion.equals("V3") &&
               parent.getDbPath().contains(OzoneConsts.CONTAINER_DB_NAME);
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java:
##########
@@ -112,7 +112,7 @@ public class DBScanner implements Callable<Void>, 
SubcommandWithParent {
 
 
   @CommandLine.ParentCommand
-  private RDBParser parent;
+  private static RDBParser parent;

Review Comment:
   After passing `schemaV3` as a parameter to `displayTable`, we no longer need 
this change. 



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java:
##########
@@ -154,7 +154,8 @@ private static List<Object> 
displayTable(ManagedRocksIterator iterator,
       }
 
       boolean schemaV3 = dnDBSchemaVersion != null &&
-          dnDBSchemaVersion.equals("V3");
+              dnDBSchemaVersion.equals("V3") &&
+              parent.getDbPath().contains(OzoneConsts.CONTAINER_DB_NAME);

Review Comment:
   Let's pass `schemaV3` as a parameter of `displayTable` and reuse it here.



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