List of usage examples for com.mongodb ConnectionString getConnectionString
public String getConnectionString()
From source file:org.flinkmon.mongo.conn.ShardSetFinder.java
License:Open Source License
private List<MongoClientWrapper> getMongoClient(List<ConnectionString> shardSet) { mongoClients = new ArrayList<>(); try {// w w w. j ava2 s. c o m for (ConnectionString address : shardSet) { com.mongodb.reactivestreams.client.MongoClient client = MongoClients.create(address); mongoClients.add(new MongoClientWrapper(address.getConnectionString(), client)); Thread.sleep(100); // allow the client to establish prior to being } } catch (InterruptedException e) { e.printStackTrace(); } return mongoClients; }