jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1594162 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo: MongoBlobReferenceIterator.java MongoVersionGCSupport.java
Date Tue, 13 May 2014 09:17:31 GMT
Author: chetanm
Date: Tue May 13 09:17:31 2014
New Revision: 1594162

URL: http://svn.apache.org/r1594162
Log:
OAK-1645 - Route find queries to Mongo secondary in MongoDocumentStore

Instead of explicitly specifying the readPreference (as secondary) the preference value is
picked from DB level setting allowing the user to fine tune the preferences via mongouri

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoBlobReferenceIterator.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoVersionGCSupport.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoBlobReferenceIterator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoBlobReferenceIterator.java?rev=1594162&r1=1594161&r2=1594162&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoBlobReferenceIterator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoBlobReferenceIterator.java
Tue May 13 09:17:31 2014
@@ -78,7 +78,7 @@ public class MongoBlobReferenceIterator 
                     .is(NodeDocument.HAS_BINARY_VAL)
                     .get();
             //TODO It currently prefers secondary. Would that be Ok?
-            cursor = getNodeCollection().find(query).setReadPreference(ReadPreference.secondaryPreferred());
+            cursor = getNodeCollection().find(query).setReadPreference(documentStore.getDefaultReadPreference());
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoVersionGCSupport.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoVersionGCSupport.java?rev=1594162&r1=1594161&r2=1594162&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoVersionGCSupport.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoVersionGCSupport.java
Tue May 13 09:17:31 2014
@@ -117,7 +117,7 @@ public class MongoVersionGCSupport exten
         final BasicDBObject keys = new BasicDBObject(Document.ID, 1);
         List<String> ids;
         DBCursor cursor = getNodeCollection().find(query, keys)
-                .setReadPreference(ReadPreference.secondaryPreferred());
+                .setReadPreference(store.getDefaultReadPreference());
         try {
              ids = ImmutableList.copyOf(Iterables.transform(cursor, new Function<DBObject,
String>() {
                  @Override



Mime
View raw message