Search in sources :

Example 1 with ConnectionCountServerSelectorStrategy

use of org.apache.druid.client.selector.ConnectionCountServerSelectorStrategy in project druid by druid-io.

the class DirectDruidClientTest method setup.

@Before
public void setup() {
    httpClient = EasyMock.createMock(HttpClient.class);
    serverSelector = new ServerSelector(dataSegment, new HighestPriorityTierSelectorStrategy(new ConnectionCountServerSelectorStrategy()));
    client = new DirectDruidClient(new ReflectionQueryToolChestWarehouse(), QueryRunnerTestHelper.NOOP_QUERYWATCHER, new DefaultObjectMapper(), httpClient, "http", hostName, new NoopServiceEmitter());
    queryableDruidServer = new QueryableDruidServer(new DruidServer("test1", "localhost", null, 0, ServerType.HISTORICAL, DruidServer.DEFAULT_TIER, 0), client);
    serverSelector.addServerAndUpdateSegment(queryableDruidServer, serverSelector.getSegment());
}
Also used : ServerSelector(org.apache.druid.client.selector.ServerSelector) HttpClient(org.apache.druid.java.util.http.client.HttpClient) HighestPriorityTierSelectorStrategy(org.apache.druid.client.selector.HighestPriorityTierSelectorStrategy) ConnectionCountServerSelectorStrategy(org.apache.druid.client.selector.ConnectionCountServerSelectorStrategy) QueryableDruidServer(org.apache.druid.client.selector.QueryableDruidServer) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) DefaultObjectMapper(org.apache.druid.jackson.DefaultObjectMapper) ReflectionQueryToolChestWarehouse(org.apache.druid.query.ReflectionQueryToolChestWarehouse) QueryableDruidServer(org.apache.druid.client.selector.QueryableDruidServer) Before(org.junit.Before)

Aggregations

ConnectionCountServerSelectorStrategy (org.apache.druid.client.selector.ConnectionCountServerSelectorStrategy)1 HighestPriorityTierSelectorStrategy (org.apache.druid.client.selector.HighestPriorityTierSelectorStrategy)1 QueryableDruidServer (org.apache.druid.client.selector.QueryableDruidServer)1 ServerSelector (org.apache.druid.client.selector.ServerSelector)1 DefaultObjectMapper (org.apache.druid.jackson.DefaultObjectMapper)1 HttpClient (org.apache.druid.java.util.http.client.HttpClient)1 ReflectionQueryToolChestWarehouse (org.apache.druid.query.ReflectionQueryToolChestWarehouse)1 NoopServiceEmitter (org.apache.druid.server.metrics.NoopServiceEmitter)1 Before (org.junit.Before)1