remove methods used only for testing

This commit is contained in:
Xavier Léauté 2014-06-09 13:48:01 -07:00
parent c08002aa4d
commit b84884ab76
16 changed files with 88 additions and 103 deletions

View File

@ -41,21 +41,6 @@ import java.util.concurrent.ExecutorService;
public class SelectQueryRunnerFactory public class SelectQueryRunnerFactory
implements QueryRunnerFactory<Result<SelectResultValue>, SelectQuery> implements QueryRunnerFactory<Result<SelectResultValue>, SelectQuery>
{ {
public static SelectQueryRunnerFactory create(ObjectMapper jsonMapper)
{
return new SelectQueryRunnerFactory(
new SelectQueryQueryToolChest(new QueryConfig(), jsonMapper),
new SelectQueryEngine(),
new QueryWatcher()
{
@Override
public void registerQuery(Query query, ListenableFuture future)
{
}
}
);
}
private final SelectQueryQueryToolChest toolChest; private final SelectQueryQueryToolChest toolChest;
private final SelectQueryEngine engine; private final SelectQueryEngine engine;
private final QueryWatcher queryWatcher; private final QueryWatcher queryWatcher;

View File

@ -41,25 +41,6 @@ import java.util.concurrent.ExecutorService;
public class TimeseriesQueryRunnerFactory public class TimeseriesQueryRunnerFactory
implements QueryRunnerFactory<Result<TimeseriesResultValue>, TimeseriesQuery> implements QueryRunnerFactory<Result<TimeseriesResultValue>, TimeseriesQuery>
{ {
/**
* Use only for testing
* @return
*/
public static TimeseriesQueryRunnerFactory create()
{
return new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
new QueryWatcher()
{
@Override
public void registerQuery(Query query, ListenableFuture future)
{
}
}
);
}
private final TimeseriesQueryQueryToolChest toolChest; private final TimeseriesQueryQueryToolChest toolChest;
private final TimeseriesQueryEngine engine; private final TimeseriesQueryEngine engine;
private final QueryWatcher queryWatcher; private final QueryWatcher queryWatcher;

View File

@ -55,7 +55,7 @@ import java.util.List;
public class QueryRunnerTestHelper public class QueryRunnerTestHelper
{ {
public static final QueryWatcher DUMMY_QUERYWATCHER = new QueryWatcher() public static final QueryWatcher NOOP_QUERYWATCHER = new QueryWatcher()
{ {
@Override @Override
public void registerQuery(Query query, ListenableFuture future) public void registerQuery(Query query, ListenableFuture future)

View File

@ -7,6 +7,8 @@ import io.druid.query.search.SearchQueryQueryToolChest;
import io.druid.query.search.SearchQueryRunnerFactory; import io.druid.query.search.SearchQueryRunnerFactory;
import io.druid.query.search.search.SearchQueryConfig; import io.druid.query.search.search.SearchQueryConfig;
import io.druid.query.timeboundary.TimeBoundaryQueryRunnerFactory; import io.druid.query.timeboundary.TimeBoundaryQueryRunnerFactory;
import io.druid.query.timeseries.TimeseriesQueryEngine;
import io.druid.query.timeseries.TimeseriesQueryQueryToolChest;
import io.druid.query.timeseries.TimeseriesQueryRunnerFactory; import io.druid.query.timeseries.TimeseriesQueryRunnerFactory;
import io.druid.query.topn.TopNQueryConfig; import io.druid.query.topn.TopNQueryConfig;
import io.druid.query.topn.TopNQueryQueryToolChest; import io.druid.query.topn.TopNQueryQueryToolChest;
@ -44,7 +46,7 @@ public class TestQueryRunners
QueryRunnerFactory factory = new TopNQueryRunnerFactory( QueryRunnerFactory factory = new TopNQueryRunnerFactory(
pool, pool,
new TopNQueryQueryToolChest(topNConfig), new TopNQueryQueryToolChest(topNConfig),
QueryRunnerTestHelper.DUMMY_QUERYWATCHER QueryRunnerTestHelper.NOOP_QUERYWATCHER
); );
return new FinalizeResultsQueryRunner<T>( return new FinalizeResultsQueryRunner<T>(
factory.createRunner(adapter), factory.createRunner(adapter),
@ -56,7 +58,12 @@ public class TestQueryRunners
Segment adapter Segment adapter
) )
{ {
QueryRunnerFactory factory = TimeseriesQueryRunnerFactory.create(); QueryRunnerFactory factory = new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
);
return new FinalizeResultsQueryRunner<T>( return new FinalizeResultsQueryRunner<T>(
factory.createRunner(adapter), factory.createRunner(adapter),
factory.getToolchest() factory.getToolchest()
@ -67,14 +74,7 @@ public class TestQueryRunners
Segment adapter Segment adapter
) )
{ {
QueryRunnerFactory factory = new SearchQueryRunnerFactory(new SearchQueryQueryToolChest(new SearchQueryConfig()), new QueryWatcher() QueryRunnerFactory factory = new SearchQueryRunnerFactory(new SearchQueryQueryToolChest(new SearchQueryConfig()), QueryRunnerTestHelper.NOOP_QUERYWATCHER);
{
@Override
public void registerQuery(Query query, ListenableFuture future)
{
}
});
return new FinalizeResultsQueryRunner<T>( return new FinalizeResultsQueryRunner<T>(
factory.createRunner(adapter), factory.createRunner(adapter),
factory.getToolchest() factory.getToolchest()
@ -85,18 +85,10 @@ public class TestQueryRunners
Segment adapter Segment adapter
) )
{ {
QueryRunnerFactory factory = new TimeBoundaryQueryRunnerFactory(new QueryWatcher() QueryRunnerFactory factory = new TimeBoundaryQueryRunnerFactory(QueryRunnerTestHelper.NOOP_QUERYWATCHER);
{
@Override
public void registerQuery(Query query, ListenableFuture future)
{
}
});
return new FinalizeResultsQueryRunner<T>( return new FinalizeResultsQueryRunner<T>(
factory.createRunner(adapter), factory.createRunner(adapter),
factory.getToolchest() factory.getToolchest()
); );
} }
} }

View File

@ -59,14 +59,10 @@ public class SearchQueryRunnerTest
public static Collection<?> constructorFeeder() throws IOException public static Collection<?> constructorFeeder() throws IOException
{ {
return QueryRunnerTestHelper.makeQueryRunners( return QueryRunnerTestHelper.makeQueryRunners(
new SearchQueryRunnerFactory(new SearchQueryQueryToolChest(new SearchQueryConfig()), new QueryWatcher() new SearchQueryRunnerFactory(
{ new SearchQueryQueryToolChest(new SearchQueryConfig()),
@Override QueryRunnerTestHelper.NOOP_QUERYWATCHER
public void registerQuery(Query query, ListenableFuture future) )
{
}
})
); );
} }

View File

@ -22,11 +22,15 @@ package io.druid.query.select;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.util.concurrent.ListenableFuture;
import com.metamx.common.ISE; import com.metamx.common.ISE;
import com.metamx.common.guava.Sequences; import com.metamx.common.guava.Sequences;
import io.druid.jackson.DefaultObjectMapper; import io.druid.jackson.DefaultObjectMapper;
import io.druid.query.Query;
import io.druid.query.QueryConfig;
import io.druid.query.QueryRunner; import io.druid.query.QueryRunner;
import io.druid.query.QueryRunnerTestHelper; import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.QueryWatcher;
import io.druid.query.Result; import io.druid.query.Result;
import io.druid.query.TableDataSource; import io.druid.query.TableDataSource;
import io.druid.query.filter.SelectorDimFilter; import io.druid.query.filter.SelectorDimFilter;
@ -54,7 +58,11 @@ public class SelectQueryRunnerTest
public static Collection<?> constructorFeeder() throws IOException public static Collection<?> constructorFeeder() throws IOException
{ {
return QueryRunnerTestHelper.makeQueryRunners( return QueryRunnerTestHelper.makeQueryRunners(
SelectQueryRunnerFactory.create(new DefaultObjectMapper()) new SelectQueryRunnerFactory(
new SelectQueryQueryToolChest(new QueryConfig(), new DefaultObjectMapper()),
new SelectQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
)
); );
} }

View File

@ -46,14 +46,7 @@ public class TimeBoundaryQueryRunnerTest
public static Collection<?> constructorFeeder() throws IOException public static Collection<?> constructorFeeder() throws IOException
{ {
return QueryRunnerTestHelper.makeQueryRunners( return QueryRunnerTestHelper.makeQueryRunners(
new TimeBoundaryQueryRunnerFactory(new QueryWatcher() new TimeBoundaryQueryRunnerFactory(QueryRunnerTestHelper.NOOP_QUERYWATCHER)
{
@Override
public void registerQuery(Query query, ListenableFuture future)
{
}
})
); );
} }

View File

@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.metamx.common.guava.Sequences; import com.metamx.common.guava.Sequences;
import io.druid.query.Druids; import io.druid.query.Druids;
import io.druid.query.QueryConfig;
import io.druid.query.QueryRunner; import io.druid.query.QueryRunner;
import io.druid.query.QueryRunnerTestHelper; import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.Result; import io.druid.query.Result;
@ -46,7 +47,11 @@ public class TimeSeriesUnionQueryRunnerTest
public static Collection<?> constructorFeeder() throws IOException public static Collection<?> constructorFeeder() throws IOException
{ {
return QueryRunnerTestHelper.makeUnionQueryRunners( return QueryRunnerTestHelper.makeUnionQueryRunners(
TimeseriesQueryRunnerFactory.create() new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
)
); );
} }

View File

@ -28,8 +28,10 @@ import io.druid.granularity.QueryGranularity;
import io.druid.query.Druids; import io.druid.query.Druids;
import io.druid.query.FinalizeResultsQueryRunner; import io.druid.query.FinalizeResultsQueryRunner;
import io.druid.query.Query; import io.druid.query.Query;
import io.druid.query.QueryConfig;
import io.druid.query.QueryRunner; import io.druid.query.QueryRunner;
import io.druid.query.QueryRunnerFactory; import io.druid.query.QueryRunnerFactory;
import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.Result; import io.druid.query.Result;
import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.AggregatorFactory;
import io.druid.query.aggregation.CountAggregatorFactory; import io.druid.query.aggregation.CountAggregatorFactory;
@ -87,7 +89,12 @@ public class TimeseriesQueryRunnerBonusTest
private static List<Result<TimeseriesResultValue>> runTimeseriesCount(IncrementalIndex index) private static List<Result<TimeseriesResultValue>> runTimeseriesCount(IncrementalIndex index)
{ {
final QueryRunnerFactory factory = TimeseriesQueryRunnerFactory.create(); final QueryRunnerFactory factory = new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
);
final QueryRunner<Result<TimeseriesResultValue>> runner = makeQueryRunner( final QueryRunner<Result<TimeseriesResultValue>> runner = makeQueryRunner(
factory, factory,
new IncrementalIndexSegment(index, null) new IncrementalIndexSegment(index, null)

View File

@ -26,6 +26,7 @@ import com.metamx.common.guava.Sequences;
import io.druid.granularity.PeriodGranularity; import io.druid.granularity.PeriodGranularity;
import io.druid.granularity.QueryGranularity; import io.druid.granularity.QueryGranularity;
import io.druid.query.Druids; import io.druid.query.Druids;
import io.druid.query.QueryConfig;
import io.druid.query.QueryRunner; import io.druid.query.QueryRunner;
import io.druid.query.QueryRunnerTestHelper; import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.Result; import io.druid.query.Result;
@ -62,7 +63,11 @@ public class TimeseriesQueryRunnerTest
public static Collection<?> constructorFeeder() throws IOException public static Collection<?> constructorFeeder() throws IOException
{ {
return QueryRunnerTestHelper.makeQueryRunners( return QueryRunnerTestHelper.makeQueryRunners(
TimeseriesQueryRunnerFactory.create() new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
)
); );
} }

View File

@ -23,15 +23,12 @@ import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.util.concurrent.ListenableFuture;
import com.metamx.common.guava.Sequences; import com.metamx.common.guava.Sequences;
import io.druid.collections.StupidPool; import io.druid.collections.StupidPool;
import io.druid.query.BySegmentResultValueClass; import io.druid.query.BySegmentResultValueClass;
import io.druid.query.Druids; import io.druid.query.Druids;
import io.druid.query.Query;
import io.druid.query.QueryRunner; import io.druid.query.QueryRunner;
import io.druid.query.QueryRunnerTestHelper; import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.QueryWatcher;
import io.druid.query.Result; import io.druid.query.Result;
import io.druid.query.TestQueryRunners; import io.druid.query.TestQueryRunners;
import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.AggregatorFactory;
@ -72,7 +69,7 @@ public class TopNQueryRunnerTest
new TopNQueryRunnerFactory( new TopNQueryRunnerFactory(
TestQueryRunners.getPool(), TestQueryRunners.getPool(),
new TopNQueryQueryToolChest(new TopNQueryConfig()), new TopNQueryQueryToolChest(new TopNQueryConfig()),
QueryRunnerTestHelper.DUMMY_QUERYWATCHER QueryRunnerTestHelper.NOOP_QUERYWATCHER
) )
) )
); );
@ -90,7 +87,7 @@ public class TopNQueryRunnerTest
} }
), ),
new TopNQueryQueryToolChest(new TopNQueryConfig()), new TopNQueryQueryToolChest(new TopNQueryConfig()),
QueryRunnerTestHelper.DUMMY_QUERYWATCHER QueryRunnerTestHelper.NOOP_QUERYWATCHER
) )
) )
); );

View File

@ -23,12 +23,9 @@ import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.util.concurrent.ListenableFuture;
import io.druid.collections.StupidPool; import io.druid.collections.StupidPool;
import io.druid.query.Query;
import io.druid.query.QueryRunner; import io.druid.query.QueryRunner;
import io.druid.query.QueryRunnerTestHelper; import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.QueryWatcher;
import io.druid.query.Result; import io.druid.query.Result;
import io.druid.query.TestQueryRunners; import io.druid.query.TestQueryRunners;
import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.AggregatorFactory;
@ -69,7 +66,7 @@ public class TopNUnionQueryTest
new TopNQueryRunnerFactory( new TopNQueryRunnerFactory(
TestQueryRunners.getPool(), TestQueryRunners.getPool(),
new TopNQueryQueryToolChest(new TopNQueryConfig()), new TopNQueryQueryToolChest(new TopNQueryConfig()),
QueryRunnerTestHelper.DUMMY_QUERYWATCHER QueryRunnerTestHelper.NOOP_QUERYWATCHER
) )
) )
); );
@ -87,7 +84,7 @@ public class TopNUnionQueryTest
} }
), ),
new TopNQueryQueryToolChest(new TopNQueryConfig()), new TopNQueryQueryToolChest(new TopNQueryConfig()),
QueryRunnerTestHelper.DUMMY_QUERYWATCHER QueryRunnerTestHelper.NOOP_QUERYWATCHER
) )
) )
); );

View File

@ -29,13 +29,17 @@ import io.druid.data.input.impl.SpatialDimensionSchema;
import io.druid.granularity.QueryGranularity; import io.druid.granularity.QueryGranularity;
import io.druid.query.Druids; import io.druid.query.Druids;
import io.druid.query.FinalizeResultsQueryRunner; import io.druid.query.FinalizeResultsQueryRunner;
import io.druid.query.QueryConfig;
import io.druid.query.QueryRunner; import io.druid.query.QueryRunner;
import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.Result; import io.druid.query.Result;
import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.AggregatorFactory;
import io.druid.query.aggregation.CountAggregatorFactory; import io.druid.query.aggregation.CountAggregatorFactory;
import io.druid.query.aggregation.LongSumAggregatorFactory; import io.druid.query.aggregation.LongSumAggregatorFactory;
import io.druid.query.filter.SpatialDimFilter; import io.druid.query.filter.SpatialDimFilter;
import io.druid.query.timeseries.TimeseriesQuery; import io.druid.query.timeseries.TimeseriesQuery;
import io.druid.query.timeseries.TimeseriesQueryEngine;
import io.druid.query.timeseries.TimeseriesQueryQueryToolChest;
import io.druid.query.timeseries.TimeseriesQueryRunnerFactory; import io.druid.query.timeseries.TimeseriesQueryRunnerFactory;
import io.druid.query.timeseries.TimeseriesResultValue; import io.druid.query.timeseries.TimeseriesResultValue;
import io.druid.segment.IncrementalIndexSegment; import io.druid.segment.IncrementalIndexSegment;
@ -434,7 +438,12 @@ public class SpatialFilterBonusTest
) )
); );
try { try {
TimeseriesQueryRunnerFactory factory = TimeseriesQueryRunnerFactory.create(); TimeseriesQueryRunnerFactory factory = new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
);
QueryRunner runner = new FinalizeResultsQueryRunner( QueryRunner runner = new FinalizeResultsQueryRunner(
factory.createRunner(segment), factory.createRunner(segment),
factory.getToolchest() factory.getToolchest()
@ -516,7 +525,12 @@ public class SpatialFilterBonusTest
) )
); );
try { try {
TimeseriesQueryRunnerFactory factory = TimeseriesQueryRunnerFactory.create(); TimeseriesQueryRunnerFactory factory = new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
);
QueryRunner runner = new FinalizeResultsQueryRunner( QueryRunner runner = new FinalizeResultsQueryRunner(
factory.createRunner(segment), factory.createRunner(segment),
factory.getToolchest() factory.getToolchest()

View File

@ -29,13 +29,17 @@ import io.druid.data.input.impl.SpatialDimensionSchema;
import io.druid.granularity.QueryGranularity; import io.druid.granularity.QueryGranularity;
import io.druid.query.Druids; import io.druid.query.Druids;
import io.druid.query.FinalizeResultsQueryRunner; import io.druid.query.FinalizeResultsQueryRunner;
import io.druid.query.QueryConfig;
import io.druid.query.QueryRunner; import io.druid.query.QueryRunner;
import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.Result; import io.druid.query.Result;
import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.AggregatorFactory;
import io.druid.query.aggregation.CountAggregatorFactory; import io.druid.query.aggregation.CountAggregatorFactory;
import io.druid.query.aggregation.LongSumAggregatorFactory; import io.druid.query.aggregation.LongSumAggregatorFactory;
import io.druid.query.filter.SpatialDimFilter; import io.druid.query.filter.SpatialDimFilter;
import io.druid.query.timeseries.TimeseriesQuery; import io.druid.query.timeseries.TimeseriesQuery;
import io.druid.query.timeseries.TimeseriesQueryEngine;
import io.druid.query.timeseries.TimeseriesQueryQueryToolChest;
import io.druid.query.timeseries.TimeseriesQueryRunnerFactory; import io.druid.query.timeseries.TimeseriesQueryRunnerFactory;
import io.druid.query.timeseries.TimeseriesResultValue; import io.druid.query.timeseries.TimeseriesResultValue;
import io.druid.segment.IncrementalIndexSegment; import io.druid.segment.IncrementalIndexSegment;
@ -464,7 +468,12 @@ public class SpatialFilterTest
) )
); );
try { try {
TimeseriesQueryRunnerFactory factory = TimeseriesQueryRunnerFactory.create(); TimeseriesQueryRunnerFactory factory = new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
);
QueryRunner runner = new FinalizeResultsQueryRunner( QueryRunner runner = new FinalizeResultsQueryRunner(
factory.createRunner(segment), factory.createRunner(segment),
factory.getToolchest() factory.getToolchest()
@ -546,7 +555,12 @@ public class SpatialFilterTest
) )
); );
try { try {
TimeseriesQueryRunnerFactory factory = TimeseriesQueryRunnerFactory.create(); TimeseriesQueryRunnerFactory factory = new TimeseriesQueryRunnerFactory(
new TimeseriesQueryQueryToolChest(new QueryConfig()),
new TimeseriesQueryEngine(),
QueryRunnerTestHelper.NOOP_QUERYWATCHER
);
QueryRunner runner = new FinalizeResultsQueryRunner( QueryRunner runner = new FinalizeResultsQueryRunner(
factory.createRunner(segment), factory.createRunner(segment),
factory.getToolchest() factory.getToolchest()

View File

@ -21,7 +21,6 @@ package io.druid.server.coordination;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Function; import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicates; import com.google.common.base.Predicates;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Ordering; import com.google.common.collect.Ordering;

View File

@ -38,6 +38,7 @@ import io.druid.jackson.DefaultObjectMapper;
import io.druid.query.Druids; import io.druid.query.Druids;
import io.druid.query.Query; import io.druid.query.Query;
import io.druid.query.QueryInterruptedException; import io.druid.query.QueryInterruptedException;
import io.druid.query.QueryRunnerTestHelper;
import io.druid.query.QueryWatcher; import io.druid.query.QueryWatcher;
import io.druid.query.ReflectionQueryToolChestWarehouse; import io.druid.query.ReflectionQueryToolChestWarehouse;
import io.druid.query.Result; import io.druid.query.Result;
@ -60,15 +61,6 @@ import java.util.List;
public class DirectDruidClientTest public class DirectDruidClientTest
{ {
public static final QueryWatcher DUMMY_WATCHER = new QueryWatcher()
{
@Override
public void registerQuery(Query query, ListenableFuture future)
{
}
};
@Test @Test
public void testRun() throws Exception public void testRun() throws Exception
{ {
@ -101,14 +93,14 @@ public class DirectDruidClientTest
DirectDruidClient client1 = new DirectDruidClient( DirectDruidClient client1 = new DirectDruidClient(
new ReflectionQueryToolChestWarehouse(), new ReflectionQueryToolChestWarehouse(),
DUMMY_WATCHER, QueryRunnerTestHelper.NOOP_QUERYWATCHER,
new DefaultObjectMapper(), new DefaultObjectMapper(),
httpClient, httpClient,
"foo" "foo"
); );
DirectDruidClient client2 = new DirectDruidClient( DirectDruidClient client2 = new DirectDruidClient(
new ReflectionQueryToolChestWarehouse(), new ReflectionQueryToolChestWarehouse(),
DUMMY_WATCHER, QueryRunnerTestHelper.NOOP_QUERYWATCHER,
new DefaultObjectMapper(), new DefaultObjectMapper(),
httpClient, httpClient,
"foo2" "foo2"
@ -196,7 +188,7 @@ public class DirectDruidClientTest
DirectDruidClient client1 = new DirectDruidClient( DirectDruidClient client1 = new DirectDruidClient(
new ReflectionQueryToolChestWarehouse(), new ReflectionQueryToolChestWarehouse(),
DUMMY_WATCHER, QueryRunnerTestHelper.NOOP_QUERYWATCHER,
new DefaultObjectMapper(), new DefaultObjectMapper(),
httpClient, httpClient,
"foo" "foo"