sadanand48 commented on code in PR #3893:
URL: https://github.com/apache/ozone/pull/3893#discussion_r1007021770
##########
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]