sadanand48 commented on code in PR #3893:
URL: https://github.com/apache/ozone/pull/3893#discussion_r1006987653


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestLDBCli.java:
##########
@@ -113,6 +113,7 @@ public void testOMDB() throws Exception {
     }
     rdbParser.setDbPath(dbStore.getDbLocation().getAbsolutePath());
     dbScanner.setParent(rdbParser);
+    dbScanner.setStartKey("/sampleVol/sampleBuck/key3");

Review Comment:
   If we're setting startKey as `/sampleVol/sampleBuck/key3` ,it has to output 
only 3 keys whereas next line we are asserting for 5.  The format here should 
be `dbScanner.setKey("key3") `here and lets add this case after all other cases 
in this test.



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java:
##########
@@ -97,10 +104,32 @@ public class DBScanner implements Callable<Void>, 
SubcommandWithParent {
 
   private List<Object> scannedObjects;
 
+  public static byte[] getValueObject(
+      DBColumnFamilyDefinition dbColumnFamilyDefinition) throws IOException {
+    String str = dbColumnFamilyDefinition.getKeyType().getName();

Review Comment:
   Its better to use Class instead of String to handle cases in which certain 
classes moved to different package.
   ```suggestion
        Class<?> keyType = dbColumnFamilyDefinition.getKeyType();
       if (keyType.equals(String.class)) {
         return startKey.getBytes();
       } else if (keyType.equals(ContainerID.class)) {
         return new ContainerID(Long.parseLong(startKey)).getBytes();
       } else if (keyType.equals(Long.class)) {
         return Longs.toByteArray(Long.parseLong(startKey));
       } else if (keyType.equals(PipelineID.class)) {
         return PipelineID.valueOf(UUID.fromString(startKey)).getProtobuf()
             .toByteArray();
   ```



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