guihecheng commented on code in PR #3420:
URL: https://github.com/apache/ozone/pull/3420#discussion_r876566334


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerData.java:
##########
@@ -365,7 +365,7 @@ public String deletingBlockKeyPrefix() {
   public KeyPrefixFilter getUnprefixedKeyFilter() {
     String schemaPrefix = containerPrefix();
     return new KeyPrefixFilter().addFilter(
-        schemaPrefix == null ? "#" : schemaPrefix + "#", true);

Review Comment:
   Ah, this is actually a fix for the original code(my bad), the 
`containerPrefix()` never return null.
   Nit: If we are checking `schemaPrefix.isEmpty()`, then may be we could just 
skip the check and do `schemaPrefix + "#"` all over the place?



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeSchemaThreeDBDefinition.java:
##########
@@ -137,11 +143,16 @@ public DBColumnFamilyDefinition<String, Long> 
getMetadataColumnFamily() {
 
   public static String getContainerKeyPrefix(long containerID) {
     // NOTE: Rocksdb normally needs a fixed length prefix.
-    return FixedLengthStringUtils.bytes2String(Longs.toByteArray(containerID));
+    return FixedLengthStringUtils.bytes2String(Longs.toByteArray(containerID))

Review Comment:
   I saw that the original version of this code tries to add this separator to 
the `KeyValueContainerData.containerPrefix()`, is there a special reason that 
we moved the separator here?
   
   In my mind, the original version should work, and the low-level rocksdb only 
have to compare the first 8bytes rather than 9bytes for the current code.



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