int cacheSize = PropertiesUtil.toInteger(prop(config, PROP_CACHE), DEFAULT_CACHE);
boolean useMK = PropertiesUtil.toBoolean(config.get(PROP_USE_MK), false);
MongoClientOptions.Builder builder = MongoConnection.getDefaultBuilder();
MongoClientURI mongoURI = new MongoClientURI(uri, builder);
if (logger.isInfoEnabled()){
// Take care around not logging the uri directly as it
// might contain passwords
String type = useMK ? "MK" : "NodeStore";
logger.info("Starting Document{} with host={}, db={}, cache size (MB)={}, Off Heap Cache size (MB)={}",
new Object[] {type, mongoURI.getHosts(), db, cacheSize, offHeapCache});
logger.info("Mongo Connection details {}", MongoConnection.toString(mongoURI.getOptions()));
}
MongoClient client = new MongoClient(mongoURI);
DB mongoDB = client.getDB(db);