use of com.basho.riak.client.core.RiakCluster in project jnosql-diana-driver by eclipse.
the class RiakKeyValueConfiguration method get.
@Override
public RiakBucketManagerFactory get(Settings settings) {
requireNonNull(settings, "settings is required");
List<RiakNode> nodes = new ArrayList<>();
settings.keySet().stream().filter(k -> k.startsWith(SERVER_PREFIX)).sorted().map(settings::get).map(a -> new RiakNode.Builder().withRemoteAddress(a.toString()).build()).forEach(nodes::add);
if (nodes.isEmpty()) {
nodes.add(DEFAULT_NODE);
}
RiakCluster cluster = new RiakCluster.Builder(nodes).build();
return new RiakBucketManagerFactory(cluster);
}
Aggregations