Author: mreutegg Date: Wed Aug 27 14:35:26 2014 New Revision: 1620905 URL: http://svn.apache.org/r1620905 Log: OAK-2058: Hard-coded write concern
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.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/MongoDocumentStore.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java?rev=1620905&r1=1620904&r2=1620905&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java Wed Aug 27 14:35:26 2014 @@ -502,7 +502,7 @@ public class MongoDocumentStore implemen DBCollection dbCollection = getDBCollection(collection); long start = start(); try { - WriteResult writeResult = dbCollection.remove(getByKeyQuery(key).get(), WriteConcern.SAFE); + WriteResult writeResult = dbCollection.remove(getByKeyQuery(key).get()); invalidateCache(collection, key); if (writeResult.getError() != null) { throw new DocumentStoreException("Remove failed: " + writeResult.getError()); @@ -517,7 +517,7 @@ public class MongoDocumentStore implemen DBCollection dbCollection = getDBCollection(collection); for(List<String> keyBatch : Lists.partition(keys, IN_CLAUSE_BATCH_SIZE)){ DBObject query = QueryBuilder.start(Document.ID).in(keyBatch).get(); - WriteResult writeResult = dbCollection.remove(query, WriteConcern.SAFE); + WriteResult writeResult = dbCollection.remove(query); invalidateCache(collection, keyBatch); if (writeResult.getError() != null) { throw new DocumentStoreException("Remove failed: " + writeResult.getError()); @@ -663,7 +663,7 @@ public class MongoDocumentStore implemen long start = start(); try { try { - WriteResult writeResult = dbCollection.insert(inserts, WriteConcern.SAFE); + WriteResult writeResult = dbCollection.insert(inserts); if (writeResult.getError() != null) { return false; } @@ -705,7 +705,7 @@ public class MongoDocumentStore implemen } } try { - WriteResult writeResult = dbCollection.update(query.get(), update, false, true, WriteConcern.SAFE); + WriteResult writeResult = dbCollection.update(query.get(), update, false, true); if (writeResult.getError() != null) { throw new DocumentStoreException("Update failed: " + writeResult.getError()); } 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=1620905&r1=1620904&r2=1620905&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 Wed Aug 27 14:35:26 2014 @@ -35,7 +35,6 @@ import com.mongodb.DBCursor; import com.mongodb.DBObject; import com.mongodb.QueryBuilder; import com.mongodb.ReadPreference; -import com.mongodb.WriteConcern; import com.mongodb.WriteResult; import org.apache.jackrabbit.oak.plugins.document.Collection; import org.apache.jackrabbit.oak.plugins.document.Document; @@ -103,7 +102,7 @@ public class MongoVersionGCSupport exten logSplitDocIdsTobeDeleted(query); } - WriteResult writeResult = getNodeCollection().remove(query, WriteConcern.SAFE); + WriteResult writeResult = getNodeCollection().remove(query); if (writeResult.getError() != null) { //TODO This might be temporary error or we fail fast and let next cycle try again log.warn("Error occurred while deleting old split documents from Mongo {}", writeResult.getError());