Search in sources :

Example 1 with DirectDruidClient

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);
}
Also used : DirectDruidClient(io.druid.client.DirectDruidClient) DruidServer(io.druid.client.DruidServer) Test(org.junit.Test)

Example 2 with DirectDruidClient

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);
}
Also used : DirectDruidClient(io.druid.client.DirectDruidClient) DruidServer(io.druid.client.DruidServer) Test(org.junit.Test)

Example 3 with DirectDruidClient

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);
}
Also used : DirectDruidClient(io.druid.client.DirectDruidClient) DruidServer(io.druid.client.DruidServer) Test(org.junit.Test)

Aggregations

DirectDruidClient (io.druid.client.DirectDruidClient)3 DruidServer (io.druid.client.DruidServer)3 Test (org.junit.Test)3