use of org.apache.jackrabbit.oak.plugins.document.util.MongoConnection in project jackrabbit-oak by apache.
the class DocumentToExternalMigrationTest method createNodeStore.
@Override
protected NodeStore createNodeStore(BlobStore blobStore, File repository) throws IOException {
MongoConnection connection = connectionFactory.getConnection();
Assume.assumeNotNull(connection);
DocumentMK.Builder builder = new DocumentMK.Builder();
if (blobStore != null) {
builder.setBlobStore(blobStore);
}
builder.setMongoDB(connection.getDB());
return nodeStore = builder.getNodeStore();
}
use of org.apache.jackrabbit.oak.plugins.document.util.MongoConnection in project jackrabbit-oak by apache.
the class BaseDocumentDiscoveryLiteServiceTest method clear.
@Before
@After
public void clear() {
logger.info("clear: seed=" + SEED);
for (SimplifiedInstance i : allInstances) {
i.dispose();
}
for (DocumentMK mk : mks) {
mk.dispose();
}
mks.clear();
if (MONGO_DB) {
MongoConnection connection = connectionFactory.getConnection();
if (connection != null) {
DB db = connection.getDB();
if (db != null) {
MongoUtils.dropCollections(db);
}
}
}
}
use of org.apache.jackrabbit.oak.plugins.document.util.MongoConnection in project jackrabbit-oak by apache.
the class MongoConnectionTest method socketKeepAlive.
@Test
public void socketKeepAlive() throws Exception {
assumeTrue(MongoUtils.isAvailable());
MongoClientOptions.Builder options = MongoConnection.getDefaultBuilder();
options.socketKeepAlive(true);
MongoConnection c = new MongoConnection(MongoUtils.URL, options);
try {
assertTrue(c.getDB().getMongo().getMongoOptions().isSocketKeepAlive());
} finally {
c.close();
}
// default is without keep-alive
c = new MongoConnection(MongoUtils.URL);
try {
assertFalse(c.getDB().getMongo().getMongoOptions().isSocketKeepAlive());
} finally {
c.close();
}
}
use of org.apache.jackrabbit.oak.plugins.document.util.MongoConnection in project jackrabbit-oak by apache.
the class JournalIT method clear.
@Override
public void clear() {
super.clear();
MongoConnection mongoConnection = connectionFactory.getConnection();
MongoUtils.dropCollections(mongoConnection.getDB());
}
use of org.apache.jackrabbit.oak.plugins.document.util.MongoConnection in project jackrabbit-oak by apache.
the class DocumentMKConcurrentAddTest method createMicroKernel.
private DocumentMK createMicroKernel(int clusterId) throws Exception {
MongoConnection connection = connectionFactory.getConnection();
DB mongoDB = connection.getDB();
return new DocumentMK.Builder().memoryCacheSize(CACHE_SIZE).setMongoDB(mongoDB).setClusterId(clusterId).open();
}
Aggregations