int blobCacheSize = PropertiesUtil.toInteger(prop(PROP_BLOB_CACHE_SIZE), DEFAULT_BLOB_CACHE_SIZE);
boolean useMK = PropertiesUtil.toBoolean(context.getProperties().get(PROP_USE_MK), false);
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);