use of org.apache.druid.server.router.QueryHostFinder in project druid by druid-io.
the class AsyncQueryForwardingServletTest method testSqlQueryProxy.
@Test
public void testSqlQueryProxy() throws Exception {
final SqlQuery query = new SqlQuery("SELECT * FROM foo", ResultFormat.ARRAY, false, false, false, null, null);
final QueryHostFinder hostFinder = EasyMock.createMock(QueryHostFinder.class);
EasyMock.expect(hostFinder.findServerSql(query)).andReturn(new TestServer("http", "1.2.3.4", 9999)).once();
EasyMock.replay(hostFinder);
Properties properties = new Properties();
properties.setProperty("druid.router.sql.enable", "true");
verifyServletCallsForQuery(query, true, hostFinder, properties);
}
use of org.apache.druid.server.router.QueryHostFinder in project druid by druid-io.
the class AsyncQueryForwardingServletTest method testQueryProxy.
@Test
public void testQueryProxy() throws Exception {
final TimeseriesQuery query = Druids.newTimeseriesQueryBuilder().dataSource("foo").intervals("2000/P1D").granularity(Granularities.ALL).context(ImmutableMap.of("queryId", "dummy")).build();
final QueryHostFinder hostFinder = EasyMock.createMock(QueryHostFinder.class);
EasyMock.expect(hostFinder.pickServer(query)).andReturn(new TestServer("http", "1.2.3.4", 9999)).once();
EasyMock.replay(hostFinder);
verifyServletCallsForQuery(query, false, hostFinder, new Properties());
}
Aggregations