swamirishi commented on code in PR #8243:
URL: https://github.com/apache/ozone/pull/8243#discussion_r2040702962


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/metadata/BigIntegerCodec.java:
##########
@@ -27,6 +29,7 @@
 public final class BigIntegerCodec implements Codec<BigInteger> {
 
   private static final Codec<BigInteger> INSTANCE = new BigIntegerCodec();
+  private static final Comparator<BigInteger> COMPARATOR = (o1, o2) -> 
Objects.compare(o1, o2, BigInteger::compareTo);

Review Comment:
   If this is the case our prefix based iterator is broken. Since we rely on 
rocksdb's ordering to be same as the KeyCodec's ordering to be the same. Look 
at 
   
https://github.com/apache/ozone/blob/194077acbb9672ca05662fca84123938cae17851/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStoreAbstractIterator.java#L98
   We break the TypedTableIterator saying raw iterator doesn't have any more 
entries corresponding to the typed prefix.
   
https://github.com/apache/ozone/blob/e5ef35d815fe3426740105a05021cfc8b7dd4d2a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TypedTable.java#L681-L684



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/metadata/BigIntegerCodec.java:
##########
@@ -27,6 +29,7 @@
 public final class BigIntegerCodec implements Codec<BigInteger> {
 
   private static final Codec<BigInteger> INSTANCE = new BigIntegerCodec();
+  private static final Comparator<BigInteger> COMPARATOR = (o1, o2) -> 
Objects.compare(o1, o2, BigInteger::compareTo);

Review Comment:
   @szetszwo If this is the case our prefix based iterator is broken. Since we 
rely on rocksdb's ordering to be same as the KeyCodec's ordering to be the 
same. Look at 
   
https://github.com/apache/ozone/blob/194077acbb9672ca05662fca84123938cae17851/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStoreAbstractIterator.java#L98
   We break the TypedTableIterator saying raw iterator doesn't have any more 
entries corresponding to the typed prefix.
   
https://github.com/apache/ozone/blob/e5ef35d815fe3426740105a05021cfc8b7dd4d2a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TypedTable.java#L681-L684



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