mkBuilder.setRDBConnection(dataSource);
log.info("Connected to datasource {}", dataSource);
}
} else {
MongoClientOptions.Builder builder = MongoConnection.getDefaultBuilder();
MongoClientURI mongoURI = new MongoClientURI(uri, builder);
if (log.isInfoEnabled()) {
// Take care around not logging the uri directly as it
// might contain passwords
String type = useMK ? "MK" : "NodeStore";
log.info("Starting Document{} with host={}, db={}, cache size (MB)={}, Off Heap Cache size (MB)={}, " +
"'changes' collection size (MB)={}, blobCacheSize (MB)={}, maxReplicationLagInSecs={}",
type, mongoURI.getHosts(), db, cacheSize, offHeapCache, changesSize, blobCacheSize, maxReplicationLagInSecs);
log.info("Mongo Connection details {}", MongoConnection.toString(mongoURI.getOptions()));
}
MongoClient client = new MongoClient(mongoURI);
DB mongoDB = client.getDB(db);