This is an automated email from the ASF dual-hosted git repository.
daim pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 372e46df85 OAK-11532 : replaced Guava's Iterables.mergeSorted with
oak-commons util (#2127)
372e46df85 is described below
commit 372e46df8591d5923a7530a2e1cf2d279ef0bf9e
Author: Rishabh Kumar <[email protected]>
AuthorDate: Tue Mar 4 09:57:57 2025 +0530
OAK-11532 : replaced Guava's Iterables.mergeSorted with oak-commons util
(#2127)
Co-authored-by: Rishabh Kumar <[email protected]>
---
.../jackrabbit/oak/plugins/document/NodeDocument.java | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
index 87f8a1436e..31b410a734 100644
---
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
+++
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java
@@ -19,7 +19,6 @@ package org.apache.jackrabbit.oak.plugins.document;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toSet;
import static
org.apache.jackrabbit.oak.commons.conditions.Validate.checkArgument;
-import static org.apache.jackrabbit.guava.common.collect.Iterables.mergeSorted;
import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES;
import static
org.apache.jackrabbit.oak.plugins.document.StableRevisionComparator.REVERSE;
import static
org.apache.jackrabbit.oak.plugins.document.util.Utils.abortingIterable;
@@ -760,7 +759,7 @@ public final class NodeDocument extends Document {
}
// if we don't have clusterIds, we can use the local changes only
boolean fullScan = true;
- Iterable<Revision> changes = Iterables.mergeSorted(
+ Iterable<Revision> changes = IterableUtils.mergeSorted(
List.of(
getLocalRevisions().keySet(),
getLocalCommitRoot().keySet()),
@@ -771,7 +770,7 @@ public final class NodeDocument extends Document {
// contain changes after 'lower' revision vector
// include previous documents as well (only needed in rare cases)
fullScan = false;
- changes = Iterables.mergeSorted(
+ changes = IterableUtils.mergeSorted(
List.of(
changes,
getChanges(REVISIONS, lower),
@@ -1556,7 +1555,7 @@ public final class NodeDocument extends Document {
*/
Iterable<Revision> getAllChanges() {
RevisionVector empty = new RevisionVector();
- return Iterables.mergeSorted(List.of(
+ return IterableUtils.mergeSorted(List.of(
getChanges(REVISIONS, empty),
getChanges(COMMIT_ROOT, empty)
), StableRevisionComparator.REVERSE);
@@ -1589,7 +1588,7 @@ public final class NodeDocument extends Document {
if (changes.size() == 1) {
return changes.get(0);
} else {
- return Iterables.mergeSorted(changes,
StableRevisionComparator.REVERSE);
+ return IterableUtils.mergeSorted(changes,
StableRevisionComparator.REVERSE);
}
}
@@ -1655,7 +1654,7 @@ public final class NodeDocument extends Document {
if (changes.size() == 1) {
return changes.get(0);
} else {
- return mergeSorted(changes, ValueComparator.REVERSE);
+ return IterableUtils.mergeSorted(changes, ValueComparator.REVERSE);
}
}
@@ -1708,7 +1707,7 @@ public final class NodeDocument extends Document {
changes.add(revs.get(0));
} else if (!revs.isEmpty()) {
// merge sort them
- changes.add(mergeSorted(revs, ValueComparator.REVERSE));
+ changes.add(IterableUtils.mergeSorted(revs,
ValueComparator.REVERSE));
}
}