use of io.druid.client.DirectDruidClient in project druid by druid-io.
the class TierSelectorStrategyTest method testLowestPriorityTierSelectorStrategy.
@Test
public void testLowestPriorityTierSelectorStrategy() {
DirectDruidClient client = EasyMock.createMock(DirectDruidClient.class);
QueryableDruidServer lowPriority = new QueryableDruidServer(new DruidServer("test1", "localhost", 0, "historical", DruidServer.DEFAULT_TIER, 0), client);
QueryableDruidServer highPriority = new QueryableDruidServer(new DruidServer("test1", "localhost", 0, "historical", DruidServer.DEFAULT_TIER, 1), client);
testTierSelectorStrategy(new LowestPriorityTierSelectorStrategy(new ConnectionCountServerSelectorStrategy()), lowPriority, highPriority);
}
use of io.druid.client.DirectDruidClient in project druid by druid-io.
the class TierSelectorStrategyTest method testCustomPriorityTierSelectorStrategy.
@Test
public void testCustomPriorityTierSelectorStrategy() {
DirectDruidClient client = EasyMock.createMock(DirectDruidClient.class);
QueryableDruidServer lowPriority = new QueryableDruidServer(new DruidServer("test1", "localhost", 0, "historical", DruidServer.DEFAULT_TIER, -1), client);
QueryableDruidServer mediumPriority = new QueryableDruidServer(new DruidServer("test1", "localhost", 0, "historical", DruidServer.DEFAULT_TIER, 0), client);
QueryableDruidServer highPriority = new QueryableDruidServer(new DruidServer("test1", "localhost", 0, "historical", DruidServer.DEFAULT_TIER, 1), client);
testTierSelectorStrategy(new CustomTierSelectorStrategy(new ConnectionCountServerSelectorStrategy(), new CustomTierSelectorStrategyConfig() {
@Override
public List<Integer> getPriorities() {
return Arrays.asList(2, 0, -1, 1);
}
}), mediumPriority, lowPriority, highPriority);
}
use of io.druid.client.DirectDruidClient in project druid by druid-io.
the class TierSelectorStrategyTest method testHighestPriorityTierSelectorStrategy.
@Test
public void testHighestPriorityTierSelectorStrategy() {
DirectDruidClient client = EasyMock.createMock(DirectDruidClient.class);
QueryableDruidServer lowPriority = new QueryableDruidServer(new DruidServer("test1", "localhost", 0, "historical", DruidServer.DEFAULT_TIER, 0), client);
QueryableDruidServer highPriority = new QueryableDruidServer(new DruidServer("test1", "localhost", 0, "historical", DruidServer.DEFAULT_TIER, 1), client);
testTierSelectorStrategy(new HighestPriorityTierSelectorStrategy(new ConnectionCountServerSelectorStrategy()), highPriority, lowPriority);
}
Aggregations