Author: mreutegg Date: Thu Apr 5 07:19:50 2018 New Revision: 1828398 URL: http://svn.apache.org/viewvc?rev=1828398&view=rev Log: OAK-7359: Update to MongoDB Java driver 3.6
Change socket keep-alive default to enabled in accordance with new MongoDB Java driver 3.6.x Added: jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderTest.java (with props) Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderBase.java Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1828398&r1=1828397&r2=1828398&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java (original) +++ jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java Thu Apr 5 07:19:50 2018 @@ -135,7 +135,7 @@ public class DocumentNodeStoreService { static final int DEFAULT_CACHE = (int) (DEFAULT_MEMORY_CACHE_SIZE / MB); static final int DEFAULT_BLOB_CACHE_SIZE = 16; static final String DEFAULT_DB = "oak"; - static final boolean DEFAULT_SO_KEEP_ALIVE = false; + static final boolean DEFAULT_SO_KEEP_ALIVE = true; static final String DEFAULT_PERSISTENT_CACHE = "cache"; static final String DEFAULT_JOURNAL_CACHE = "diff-cache"; static final boolean DEFAULT_CUSTOM_BLOB_STORE = false; Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderBase.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderBase.java?rev=1828398&r1=1828397&r2=1828398&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderBase.java (original) +++ jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderBase.java Thu Apr 5 07:19:50 2018 @@ -53,7 +53,7 @@ public abstract class MongoDocumentNodeS private static final Logger LOG = LoggerFactory.getLogger(MongoDocumentNodeStoreBuilder.class); private String mongoUri; - private boolean socketKeepAlive; + private boolean socketKeepAlive = true; private MongoStatus mongoStatus; private long maxReplicationLagMillis = TimeUnit.HOURS.toMillis(6); @@ -149,10 +149,10 @@ public abstract class MongoDocumentNodeS } /** - * Enables the socket keep-alive option for MongoDB. The default is - * disabled. + * Enables or disables the socket keep-alive option for MongoDB. The default + * is enabled. * - * @param enable whether to enable it. + * @param enable whether to enable or disable it. * @return this */ public T setSocketKeepAlive(boolean enable) { @@ -160,6 +160,13 @@ public abstract class MongoDocumentNodeS return thisBuilder(); } + /** + * @return whether socket keep-alive is enabled. + */ + public boolean isSocketKeepAlive() { + return socketKeepAlive; + } + public T setMaxReplicationLag(long duration, TimeUnit unit){ maxReplicationLagMillis = unit.toMillis(duration); return thisBuilder(); Added: jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderTest.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderTest.java?rev=1828398&view=auto ============================================================================== --- jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderTest.java (added) +++ jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderTest.java Thu Apr 5 07:19:50 2018 @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.oak.plugins.document.mongo; + +import org.junit.Test; + +import static org.junit.Assert.assertTrue; + +public class MongoDocumentNodeStoreBuilderTest { + + @Test + public void socketKeepAlive() { + MongoDocumentNodeStoreBuilder builder = new MongoDocumentNodeStoreBuilder(); + assertTrue(builder.isSocketKeepAlive()); + } +} Propchange: jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderTest.java ------------------------------------------------------------------------------ svn:eol-style = native