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 f54cabd63a OAK-11590 : removed usage of Iterators.getLast with
oak-commons implementation (#2227)
f54cabd63a is described below
commit f54cabd63a74dfcc3b740bfb99b4cb4def955264
Author: Rishabh Kumar <[email protected]>
AuthorDate: Mon Apr 14 16:07:32 2025 +0530
OAK-11590 : removed usage of Iterators.getLast with oak-commons
implementation (#2227)
Co-authored-by: Rishabh Kumar <[email protected]>
---
.../java/org/apache/jackrabbit/oak/plugins/blob/BlobGCTest.java | 7 ++++---
.../apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java | 4 ++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git
a/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/BlobGCTest.java
b/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/BlobGCTest.java
index b3662ecaa7..b55a7733f5 100644
---
a/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/BlobGCTest.java
+++
b/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/BlobGCTest.java
@@ -58,6 +58,7 @@ import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.api.blob.BlobAccessProvider;
import org.apache.jackrabbit.oak.api.blob.BlobUpload;
+import org.apache.jackrabbit.oak.commons.collections.IteratorUtils;
import org.apache.jackrabbit.oak.commons.collections.SetUtils;
import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser;
import org.apache.jackrabbit.oak.commons.junit.LogCustomizer;
@@ -431,7 +432,7 @@ public class BlobGCTest {
log.info("after setup time {}", afterSetupTime);
cluster.blobStore
-
.countDeleteChunks(List.of(Iterators.getLast(cluster.blobStoreState.blobsPresent.iterator())),
+
.countDeleteChunks(List.of(IteratorUtils.getLast(cluster.blobStoreState.blobsPresent.iterator())),
0);
MarkSweepGarbageCollector collector = cluster.getCollector(0);
long missing = collector.checkConsistency();
@@ -473,7 +474,7 @@ public class BlobGCTest {
closer.register(secondCluster);
cluster.blobStore
-
.countDeleteChunks(List.of(Iterators.getLast(cluster.blobStoreState.blobsPresent.iterator())),
+
.countDeleteChunks(List.of(IteratorUtils.getLast(cluster.blobStoreState.blobsPresent.iterator())),
0);
// Execute mark on the default cluster
@@ -498,7 +499,7 @@ public class BlobGCTest {
closer.register(secondCluster);
secondCluster.blobStore
-
.countDeleteChunks(List.of(Iterators.getLast(secondCluster.blobStoreState.blobsPresent.iterator())),
+
.countDeleteChunks(List.of(IteratorUtils.getLast(secondCluster.blobStoreState.blobsPresent.iterator())),
0);
// Execute mark on the default cluster
diff --git
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java
index f9aa6ca66c..c6b91f8b89 100644
---
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java
+++
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java
@@ -207,7 +207,7 @@ public class NodeDocumentTest {
DocumentNodeStore ns = createTestStore(numChanges);
NodeDocument root = getRootDocument(ns.getDocumentStore());
// remove oldest previous doc
- NodeDocument toRemove = Iterators.getLast(root.getAllPreviousDocs());
+ NodeDocument toRemove =
IteratorUtils.getLast(root.getAllPreviousDocs());
int numDeleted = new SplitDocumentCleanUp(ns.getDocumentStore(), new
VersionGCStats(),
Collections.singleton(toRemove)).disconnect().deleteSplitDocuments();
assertEquals(1, numDeleted);
@@ -314,7 +314,7 @@ public class NodeDocumentTest {
NodeDocument root = getRootDocument(ns.getDocumentStore());
int numLeaves = IteratorUtils.size(root.getPreviousDocLeaves());
// remove oldest previous doc
- NodeDocument toRemove = Iterators.getLast(root.getAllPreviousDocs());
+ NodeDocument toRemove =
IteratorUtils.getLast(root.getAllPreviousDocs());
int numDeleted = new SplitDocumentCleanUp(ns.getDocumentStore(), new
VersionGCStats(),
Collections.singleton(toRemove)).disconnect().deleteSplitDocuments();
assertEquals(1, numDeleted);