Search in sources :

Example 1 with HostSupplier

use of com.netflix.dyno.connectionpool.HostSupplier in project dynomite-cluster-checker by diegopacheco.

the class SimpleConnectionTest method toHostSupplier.

private static HostSupplier toHostSupplier(List<DynomiteNodeInfo> nodes) {
    final List<Host> hosts = new ArrayList<Host>();
    for (DynomiteNodeInfo node : nodes) {
        hosts.add(buildHost(node));
    }
    final HostSupplier customHostSupplier = new HostSupplier() {

        @Override
        public Collection<Host> getHosts() {
            return hosts;
        }
    };
    return customHostSupplier;
}
Also used : HostSupplier(com.netflix.dyno.connectionpool.HostSupplier) ArrayList(java.util.ArrayList) Host(com.netflix.dyno.connectionpool.Host) DynomiteNodeInfo(com.github.diegopacheco.dynomite.cluster.checker.parser.DynomiteNodeInfo)

Example 2 with HostSupplier

use of com.netflix.dyno.connectionpool.HostSupplier in project dynomite-cluster-checker by diegopacheco.

the class HostSupplierFactory method build.

public static HostSupplier build(List<DynomiteNodeInfo> nodes) {
    final List<Host> hosts = new ArrayList<Host>();
    for (DynomiteNodeInfo node : nodes) {
        hosts.add(node.toHOST());
    }
    final HostSupplier customHostSupplier = new HostSupplier() {

        @Override
        public Collection<Host> getHosts() {
            return hosts;
        }
    };
    return customHostSupplier;
}
Also used : HostSupplier(com.netflix.dyno.connectionpool.HostSupplier) ArrayList(java.util.ArrayList) Host(com.netflix.dyno.connectionpool.Host) DynomiteNodeInfo(com.github.diegopacheco.dynomite.cluster.checker.parser.DynomiteNodeInfo)

Aggregations

DynomiteNodeInfo (com.github.diegopacheco.dynomite.cluster.checker.parser.DynomiteNodeInfo)2 Host (com.netflix.dyno.connectionpool.Host)2 HostSupplier (com.netflix.dyno.connectionpool.HostSupplier)2 ArrayList (java.util.ArrayList)2