mirror of https://github.com/apache/druid.git
Refix the things that were lost in the merge.
This commit is contained in:
parent
b13ae3f405
commit
fefc71e34f
|
@ -20,6 +20,8 @@
|
|||
package io.druid.cli;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.Module;
|
||||
import com.metamx.common.logger.Logger;
|
||||
import io.airlift.command.Command;
|
||||
import io.druid.client.BrokerServerView;
|
||||
|
@ -29,19 +31,18 @@ import io.druid.client.cache.Cache;
|
|||
import io.druid.client.cache.CacheMonitor;
|
||||
import io.druid.client.cache.CacheProvider;
|
||||
import io.druid.curator.discovery.DiscoveryModule;
|
||||
import io.druid.guice.Jerseys;
|
||||
import io.druid.guice.JsonConfigProvider;
|
||||
import io.druid.guice.LazySingleton;
|
||||
import io.druid.guice.ManageLifecycle;
|
||||
import io.druid.guice.annotations.Self;
|
||||
import io.druid.query.MapQueryToolChestWarehouse;
|
||||
import io.druid.query.QuerySegmentWalker;
|
||||
import io.druid.query.QueryToolChestWarehouse;
|
||||
import io.druid.server.ClientInfoResource;
|
||||
import io.druid.server.ClientQuerySegmentWalker;
|
||||
import io.druid.server.initialization.JettyServerInitializer;
|
||||
import io.druid.server.metrics.MetricsModule;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.HandlerList;
|
||||
import org.eclipse.jetty.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -79,27 +80,12 @@ public class CliBroker extends ServerRunnable
|
|||
|
||||
binder.bind(QuerySegmentWalker.class).to(ClientQuerySegmentWalker.class).in(LazySingleton.class);
|
||||
binder.bind(JettyServerInitializer.class).to(QueryJettyServerInitializer.class).in(LazySingleton.class);
|
||||
Jerseys.addResource(binder, ClientInfoResource.class);
|
||||
|
||||
DiscoveryModule.register(binder, Self.class);
|
||||
MetricsModule.register(binder, CacheMonitor.class);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private static class BrokerJettyServerInitializer extends QueryJettyServerInitializer
|
||||
{
|
||||
@Override
|
||||
public void initialize(Server server, Injector injector)
|
||||
{
|
||||
super.initialize(server, injector);
|
||||
|
||||
final ServletContextHandler resources = new ServletContextHandler(ServletContextHandler.SESSIONS);
|
||||
resources.addServlet(new ServletHolder(new DefaultServlet()), "/*");
|
||||
resources.addFilter(GuiceFilter.class, "/druid/v2/datasources/*", null);
|
||||
|
||||
final HandlerList handlerList = new HandlerList();
|
||||
handlerList.setHandlers(new Handler[]{resources});
|
||||
server.setHandler(handlerList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ import io.druid.guice.LazySingleton;
|
|||
import io.druid.guice.LifecycleModule;
|
||||
import io.druid.guice.ManageLifecycle;
|
||||
import io.druid.guice.annotations.Self;
|
||||
import io.druid.server.StatusResource;
|
||||
import io.druid.server.http.BackwardsCompatiableInfoResource;
|
||||
import io.druid.server.http.InfoResource;
|
||||
import io.druid.server.http.MasterRedirectInfo;
|
||||
import io.druid.server.http.MasterResource;
|
||||
|
@ -107,6 +107,7 @@ public class CliCoordinator extends ServerRunnable
|
|||
DiscoveryModule.register(binder, Self.class);
|
||||
|
||||
binder.bind(JettyServerInitializer.class).toInstance(new CoordinatorJettyServerInitializer());
|
||||
Jerseys.addResource(binder, BackwardsCompatiableInfoResource.class);
|
||||
Jerseys.addResource(binder, InfoResource.class);
|
||||
Jerseys.addResource(binder, MasterResource.class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue