mirror of https://github.com/apache/druid.git
1) Rename QueryToolChestModule because there was a case sensitivity issue, grrr
This commit is contained in:
parent
c3ca9f5a3b
commit
69f7831d82
|
@ -0,0 +1,51 @@
|
||||||
|
package com.metamx.druid.guice;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.inject.Binder;
|
||||||
|
import com.google.inject.Module;
|
||||||
|
import com.google.inject.TypeLiteral;
|
||||||
|
import com.google.inject.multibindings.MapBinder;
|
||||||
|
import com.metamx.druid.Query;
|
||||||
|
import com.metamx.druid.query.QueryToolChest;
|
||||||
|
import com.metamx.druid.query.group.GroupByQuery;
|
||||||
|
import com.metamx.druid.query.group.GroupByQueryConfig;
|
||||||
|
import com.metamx.druid.query.group.GroupByQueryQueryToolChest;
|
||||||
|
import com.metamx.druid.query.metadata.SegmentMetadataQuery;
|
||||||
|
import com.metamx.druid.query.metadata.SegmentMetadataQueryQueryToolChest;
|
||||||
|
import com.metamx.druid.query.search.SearchQuery;
|
||||||
|
import com.metamx.druid.query.search.SearchQueryQueryToolChest;
|
||||||
|
import com.metamx.druid.query.timeboundary.TimeBoundaryQuery;
|
||||||
|
import com.metamx.druid.query.timeboundary.TimeBoundaryQueryQueryToolChest;
|
||||||
|
import com.metamx.druid.query.timeseries.TimeseriesQuery;
|
||||||
|
import com.metamx.druid.query.timeseries.TimeseriesQueryQueryToolChest;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public class QueryToolChestModuleStupidCase implements Module
|
||||||
|
{
|
||||||
|
final Map<Class<? extends Query>, Class<? extends QueryToolChest>> mappings =
|
||||||
|
ImmutableMap.<Class<? extends Query>, Class<? extends QueryToolChest>>builder()
|
||||||
|
.put(TimeseriesQuery.class, TimeseriesQueryQueryToolChest.class)
|
||||||
|
.put(SearchQuery.class, SearchQueryQueryToolChest.class)
|
||||||
|
.put(TimeBoundaryQuery.class, TimeBoundaryQueryQueryToolChest.class)
|
||||||
|
.put(SegmentMetadataQuery.class, SegmentMetadataQueryQueryToolChest.class)
|
||||||
|
.put(GroupByQuery.class, GroupByQueryQueryToolChest.class)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(Binder binder)
|
||||||
|
{
|
||||||
|
MapBinder<Class<? extends Query>, QueryToolChest> toolChests = MapBinder.newMapBinder(
|
||||||
|
binder, new TypeLiteral<Class<? extends Query>>(){}, new TypeLiteral<QueryToolChest>(){}
|
||||||
|
);
|
||||||
|
|
||||||
|
for (Map.Entry<Class<? extends Query>, Class<? extends QueryToolChest>> entry : mappings.entrySet()) {
|
||||||
|
toolChests.addBinding(entry.getKey()).to(entry.getValue());
|
||||||
|
binder.bind(entry.getValue()).in(LazySingleton.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonConfigProvider.bind(binder, "druid.query.groupBy", GroupByQueryConfig.class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,7 +22,7 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class QueryRunnerFactoryModule extends QueryToolChestModule
|
public class QueryRunnerFactoryModuleStupidCase extends QueryToolChestModuleStupidCase
|
||||||
{
|
{
|
||||||
final Map<Class<? extends Query>, Class<? extends QueryRunnerFactory>> mappings =
|
final Map<Class<? extends Query>, Class<? extends QueryRunnerFactory>> mappings =
|
||||||
ImmutableMap.<Class<? extends Query>, Class<? extends QueryRunnerFactory>>builder()
|
ImmutableMap.<Class<? extends Query>, Class<? extends QueryRunnerFactory>>builder()
|
|
@ -6,7 +6,7 @@ import com.metamx.druid.curator.CuratorModule;
|
||||||
import com.metamx.druid.guice.BrokerModule;
|
import com.metamx.druid.guice.BrokerModule;
|
||||||
import com.metamx.druid.guice.HttpClientModule;
|
import com.metamx.druid.guice.HttpClientModule;
|
||||||
import com.metamx.druid.guice.LifecycleModule;
|
import com.metamx.druid.guice.LifecycleModule;
|
||||||
import com.metamx.druid.guice.QueryToolChestModule;
|
import com.metamx.druid.guice.QueryToolChestModuleStupidCase;
|
||||||
import com.metamx.druid.guice.QueryableModule;
|
import com.metamx.druid.guice.QueryableModule;
|
||||||
import com.metamx.druid.guice.ServerModule;
|
import com.metamx.druid.guice.ServerModule;
|
||||||
import com.metamx.druid.guice.ServerViewModule;
|
import com.metamx.druid.guice.ServerViewModule;
|
||||||
|
@ -47,7 +47,7 @@ public class CliBroker extends ServerRunnable
|
||||||
new JettyServerModule(new QueryJettyServerInitializer())
|
new JettyServerModule(new QueryJettyServerInitializer())
|
||||||
.addResource(StatusResource.class),
|
.addResource(StatusResource.class),
|
||||||
new QueryableModule(ClientQuerySegmentWalker.class),
|
new QueryableModule(ClientQuerySegmentWalker.class),
|
||||||
new QueryToolChestModule(),
|
new QueryToolChestModuleStupidCase(),
|
||||||
new ServerViewModule(),
|
new ServerViewModule(),
|
||||||
new HttpClientModule("druid.broker.http", Client.class),
|
new HttpClientModule("druid.broker.http", Client.class),
|
||||||
new BrokerModule()
|
new BrokerModule()
|
||||||
|
|
|
@ -8,7 +8,7 @@ import com.metamx.druid.curator.CuratorModule;
|
||||||
import com.metamx.druid.guice.HistoricalModule;
|
import com.metamx.druid.guice.HistoricalModule;
|
||||||
import com.metamx.druid.guice.HttpClientModule;
|
import com.metamx.druid.guice.HttpClientModule;
|
||||||
import com.metamx.druid.guice.LifecycleModule;
|
import com.metamx.druid.guice.LifecycleModule;
|
||||||
import com.metamx.druid.guice.QueryRunnerFactoryModule;
|
import com.metamx.druid.guice.QueryRunnerFactoryModuleStupidCase;
|
||||||
import com.metamx.druid.guice.QueryableModule;
|
import com.metamx.druid.guice.QueryableModule;
|
||||||
import com.metamx.druid.guice.ServerModule;
|
import com.metamx.druid.guice.ServerModule;
|
||||||
import com.metamx.druid.http.StatusResource;
|
import com.metamx.druid.http.StatusResource;
|
||||||
|
@ -47,7 +47,7 @@ public class CliHistorical extends ServerRunnable
|
||||||
new JettyServerModule(new QueryJettyServerInitializer())
|
new JettyServerModule(new QueryJettyServerInitializer())
|
||||||
.addResource(StatusResource.class),
|
.addResource(StatusResource.class),
|
||||||
new QueryableModule(ServerManager.class),
|
new QueryableModule(ServerManager.class),
|
||||||
new QueryRunnerFactoryModule(),
|
new QueryRunnerFactoryModuleStupidCase(),
|
||||||
HistoricalModule.class
|
HistoricalModule.class
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue