diff --git a/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java b/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java index 9a649d71c4b..0b17f5778fd 100644 --- a/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java +++ b/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java @@ -57,7 +57,6 @@ import org.apache.commons.collections4.multimap.ArrayListValuedHashMap; import org.apache.jackrabbit.guava.common.base.Stopwatch; import org.apache.jackrabbit.guava.common.collect.Iterators; -import org.apache.jackrabbit.guava.common.collect.Maps; import org.apache.jackrabbit.guava.common.io.Closeables; import org.apache.jackrabbit.guava.common.io.Files; import org.apache.jackrabbit.guava.common.util.concurrent.ListenableFutureTask; @@ -273,8 +272,9 @@ public List getStats() throws Exception { // Get all the markers available List markerFiles = ((SharedDataStore) blobStore).getAllMetadataRecords(SharedStoreRecordType.MARKED_START_MARKER.getType()); - Map markers = Maps.uniqueIndex(markerFiles, - input -> input.getIdentifier().toString().substring(SharedStoreRecordType.MARKED_START_MARKER.getType().length() + 1)); + Map markers = markerFiles.stream().collect(Collectors.toUnmodifiableMap( + input -> input.getIdentifier().toString().substring(SharedStoreRecordType.MARKED_START_MARKER.getType().length() + 1), + input -> input)); // Get all the repositories registered List repoFiles = diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java index a4e3eb1a576..e366af793c9 100644 --- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java +++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java @@ -37,6 +37,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.Lock; +import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.StreamSupport; @@ -93,7 +94,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.apache.jackrabbit.guava.common.collect.Maps; import com.mongodb.BasicDBObject; import com.mongodb.MongoException; import com.mongodb.WriteConcern; @@ -1523,7 +1523,7 @@ private Map bulkUpdate(Collection collectio } private static Map createMap(List updateOps) { - return Maps.uniqueIndex(updateOps, input -> input.getId()); + return updateOps.stream().collect(Collectors.toMap(UpdateOp::getId, Function.identity())); } private Map findDocuments(Collection collection, Set keys) {