reschke commented on code in PR #1454: URL: https://github.com/apache/jackrabbit-oak/pull/1454#discussion_r1600226769
########## oak-jcr/pom.xml: ########## @@ -530,5 +530,11 @@ <artifactId>testcontainers</artifactId> <scope>test</scope> </dependency> + <dependency> Review Comment: This looks weird; why do we need the duplicate dependency? ########## oak-pojosr/pom.xml: ########## @@ -365,5 +365,11 @@ <artifactId>testcontainers</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.testcontainers</groupId> + <artifactId>testcontainers</artifactId> + <version>${testcontainers.version}</version> + <scope>test</scope> + </dependency> Review Comment: same here ########## oak-store-document/pom.xml: ########## @@ -349,5 +349,11 @@ <version>${testcontainers.version}</version> <scope>test</scope> </dependency> + <dependency> Review Comment: (indentation) ########## oak-segment-azure/src/test/resources/logback-test.xml: ########## @@ -21,11 +21,19 @@ <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> - <statusListener class="ch.qos.logback.core.status.NopStatusListener" /> + <statusListener class="ch.qos.logback.core.status.NopStatusListener"/> Review Comment: why do we need these changes for a change in DocumentStore? ########## oak-run/src/main/java/org/apache/jackrabbit/oak/run/Utils.java: ########## @@ -178,7 +183,7 @@ public static NodeStore bootstrapNodeStore(NodeStoreOptions options, Closer clos System.exit(1); } - if (src.startsWith(MongoURI.MONGODB_PREFIX) || src.startsWith("jdbc")) { + if (src.startsWith(MONGODB_PREFIX) || src.startsWith("jdbc")) { Review Comment: maybe avoid unneeded change here? ########## oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupport.java: ########## @@ -19,12 +19,28 @@ package org.apache.jackrabbit.oak.plugins.document; +import static java.util.Comparator.comparing; +import static java.util.Optional.empty; +import static java.util.Optional.of; +import static java.util.Optional.ofNullable; +import static java.util.stream.Stream.concat; +import static java.util.stream.StreamSupport.stream; import static org.apache.jackrabbit.guava.common.collect.Iterables.filter; +import static java.util.stream.Collectors.toList; +import static org.apache.jackrabbit.guava.common.collect.Sets.newHashSet; Review Comment: (avoid use of Guava in new code) ########## oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCSupportTest.java: ########## @@ -18,42 +18,54 @@ */ package org.apache.jackrabbit.oak.plugins.document; +import java.util.ArrayList; import java.util.List; -import org.apache.jackrabbit.guava.common.collect.Iterables; -import org.apache.jackrabbit.guava.common.collect.Lists; import com.mongodb.ReadPreference; import org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentStore; import org.apache.jackrabbit.oak.plugins.document.mongo.MongoTestUtils; import org.apache.jackrabbit.oak.plugins.document.mongo.MongoVersionGCSupport; import org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore; import org.apache.jackrabbit.oak.plugins.document.rdb.RDBVersionGCSupport; -import org.apache.jackrabbit.oak.plugins.document.util.Utils; -import org.apache.jackrabbit.oak.stats.Clock; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; +import static java.lang.Long.MAX_VALUE; +import static java.util.Comparator.comparing; +import static java.util.List.of; +import static java.util.Optional.ofNullable; import static java.util.concurrent.TimeUnit.SECONDS; +import static java.util.stream.StreamSupport.stream; +import static org.apache.jackrabbit.guava.common.collect.Comparators.isInOrder; +import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES; +import static org.apache.jackrabbit.oak.plugins.document.Document.ID; import static org.apache.jackrabbit.oak.plugins.document.DocumentStoreFixture.MEMORY; import static org.apache.jackrabbit.oak.plugins.document.DocumentStoreFixture.MONGO; import static org.apache.jackrabbit.oak.plugins.document.DocumentStoreFixture.RDB_H2; +import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.MIN_ID_VALUE; +import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.MODIFIED_IN_SECS; +import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.NULL; +import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.setModified; +import static org.apache.jackrabbit.oak.plugins.document.util.Utils.getIdFromPath; +import static org.apache.jackrabbit.oak.stats.Clock.SIMPLE; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; @RunWith(Parameterized.class) public class VersionGCSupportTest { - private DocumentStoreFixture fixture; - private DocumentStore store; - private VersionGCSupport gcSupport; - private List<String> ids = Lists.newArrayList(); + private final DocumentStoreFixture fixture; + private final DocumentStore store; + private final VersionGCSupport gcSupport; + private final List<String> ids = new ArrayList<>(); @Parameterized.Parameters(name="{0}") public static java.util.Collection<DocumentStoreFixture> fixtures() { - List<DocumentStoreFixture> fixtures = Lists.newArrayList(); + List<DocumentStoreFixture> fixtures = new ArrayList<>(3); Review Comment: ```suggestion List<DocumentStoreFixture> fixtures = new ArrayList<>(); ``` I don't think perf is of any concern here. ########## oak-parent/pom.xml: ########## @@ -718,6 +718,13 @@ <version>${testcontainers.version}</version> <scope>test</scope> </dependency> + <!-- Testcontainers dependency --> + <dependency> + <groupId>org.testcontainers</groupId> + <artifactId>testcontainers</artifactId> + <version>${testcontainers.version}</version> + <scope>test</scope> + </dependency> Review Comment: same here ########## oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/util/LoggingDocumentStoreWrapper.java: ########## @@ -283,6 +283,7 @@ public T call() throws Exception { } @Override + @NotNull Review Comment: is this change needed? ########## oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java: ########## @@ -290,6 +294,25 @@ public boolean isThrottlingEnabled() { return this.throttlingEnabled; } + public T setFullGCEnabled(boolean b) { + this.fullGCEnabled = b; + return thisBuilder(); + } + + public boolean isFullGCEnabled() { + return this.fullGCEnabled; + } + + public T setEmbeddedVerificationEnabled(boolean b) { + this.embeddedVerificationEnabled = b; + return thisBuilder(); + } + + public boolean isEmbeddedVerificationEnabled() { + return this.embeddedVerificationEnabled; + } + + Review Comment: (vertical whitespace) ########## oak-run/src/main/java/org/apache/jackrabbit/oak/run/Utils.java: ########## @@ -210,27 +215,26 @@ static DocumentNodeStoreBuilder<?> createDocumentMKBuilder(String[] args, Closer return createDocumentMKBuilder(new NodeStoreOptions(h).parse(args), closer); } + static Optional<MongoConnection> getMongoConnection(final NodeStoreOptions options, final Closer closer) { + String src = options.getStoreArg(); + if (isEmpty(src) || !src.startsWith(MONGODB_PREFIX)) { Review Comment: why do we need isEmpty here? Wouldn't a null check be sufficient? -- 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: dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org