use of com.netflix.dyno.connectionpool.Host 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;
}
use of com.netflix.dyno.connectionpool.Host in project dynomite-cluster-checker by diegopacheco.
the class SimpleConnectionTest method buildHost.
private static Host buildHost(DynomiteNodeInfo node) {
Host host = new Host(node.getServer(), 8102, node.getDc());
host.setStatus(Status.Up);
return host;
}
use of com.netflix.dyno.connectionpool.Host 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;
}
use of com.netflix.dyno.connectionpool.Host in project conductor by Netflix.
the class DynoQueueDAOTest method init.
@Before
public void init() {
JedisCommands jedisMock = new JedisMock();
queueDAO = new DynoQueueDAO(jedisMock, jedisMock, new ShardSupplier() {
@Override
public Set<String> getQueueShards() {
return new HashSet<>(Collections.singletonList("a"));
}
@Override
public String getCurrentShard() {
return "a";
}
@Override
public String getShardForHost(Host host) {
return "a";
}
}, new TestConfiguration());
}
use of com.netflix.dyno.connectionpool.Host in project conductor by Netflix.
the class MockQueueDAOModule method configureQueueDAO.
@Override
public void configureQueueDAO() {
DetachedMockFactory detachedMockFactory = new DetachedMockFactory();
JedisCommands jedisMock = new JedisMock();
ShardSupplier shardSupplier = new ShardSupplier() {
@Override
public Set<String> getQueueShards() {
return new HashSet<>(Collections.singletonList("a"));
}
@Override
public String getCurrentShard() {
return "a";
}
@Override
public String getShardForHost(Host host) {
return "a";
}
};
RedisQueues redisQueues = new RedisQueues(jedisMock, jedisMock, "mockedQueues", shardSupplier, 60000, 120000);
DynoQueueDAO dynoQueueDAO = new DynoQueueDAO(redisQueues);
bind(QueueDAO.class).toInstance(detachedMockFactory.Spy(dynoQueueDAO));
install(new WorkflowExecutorModule());
}
Aggregations