You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "jojochuang (via GitHub)" <gi...@apache.org> on 2026/01/01 22:28:07 UTC
Re: [PR] HDDS-14330. MinHeapMergeIterator should use key comparator while popping out entries from the heap [ozone]
jojochuang commented on code in PR #9576:
URL: https://github.com/apache/ozone/pull/9576#discussion_r2656645676
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java:
##########
@@ -198,7 +198,7 @@ default <KEY> ClosableIterator<KeyValue<KEY, Collection<Object>>> getMergeIterat
KeyValue<KEY, Object> defaultNullValue = newKeyValue(null, null);
Comparator<KeyValue<KEY, Object>> comparator = Comparator.comparing(KeyValue::getKey, keyComparator);
return new MinHeapMergeIterator<KeyValue<KEY, Object>, Table.KeyValueIterator<KEY, Object>,
- KeyValue<KEY, Collection<Object>>>(table.length + 1, comparator) {
Review Comment:
I don't recall why it was table.length + 1 before.
##########
hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/hadoop/hdds/utils/db/TestMinHeapMergeIterator.java:
##########
@@ -38,14 +40,15 @@
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
+import org.apache.hadoop.hdds.StringUtils;
import org.junit.jupiter.api.Test;
/**
* Unit tests for {@link MinHeapMergeIterator}.
*/
class TestMinHeapMergeIterator {
- private static final Comparator<String> STRING_COMPARATOR = String::compareTo;
+ private static final Comparator<byte[]> BYTE_COMPARATOR = UnsignedBytes.lexicographicalComparator();
Review Comment:
is updating String to byte array a necessary change to reproduce the problem?
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org