diff --git a/server/src/main/java/io/druid/server/http/BackwardsCompatiableInfoResource.java b/server/src/main/java/io/druid/server/http/BackwardsCompatiableInfoResource.java new file mode 100644 index 00000000000..2d49b0c6884 --- /dev/null +++ b/server/src/main/java/io/druid/server/http/BackwardsCompatiableInfoResource.java @@ -0,0 +1,48 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package io.druid.server.http; + +import com.google.inject.Inject; +import io.druid.client.InventoryView; +import io.druid.client.indexing.IndexingServiceClient; +import io.druid.db.DatabaseRuleManager; +import io.druid.db.DatabaseSegmentManager; +import io.druid.server.master.DruidMaster; + +import javax.annotation.Nullable; +import javax.ws.rs.Path; + +/** + */ +@Path("/static/info") +public class BackwardsCompatiableInfoResource extends InfoResource +{ + @Inject + public BackwardsCompatiableInfoResource( + DruidMaster master, + InventoryView serverInventoryView, + DatabaseSegmentManager databaseSegmentManager, + DatabaseRuleManager databaseRuleManager, + @Nullable IndexingServiceClient indexingServiceClient + ) + { + super(master, serverInventoryView, databaseSegmentManager, databaseRuleManager, indexingServiceClient); + } +} diff --git a/services/src/main/java/io/druid/cli/CliBroker.java b/services/src/main/java/io/druid/cli/CliBroker.java index 905fc8f9708..edaa125675c 100644 --- a/services/src/main/java/io/druid/cli/CliBroker.java +++ b/services/src/main/java/io/druid/cli/CliBroker.java @@ -20,8 +20,6 @@ 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; @@ -35,12 +33,15 @@ 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.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; @@ -84,4 +85,21 @@ public class CliBroker extends ServerRunnable } ); } + + 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); + } + } } diff --git a/services/src/main/java/io/druid/cli/CliCoordinator.java b/services/src/main/java/io/druid/cli/CliCoordinator.java index e7bfd79fea2..0e099edd393 100644 --- a/services/src/main/java/io/druid/cli/CliCoordinator.java +++ b/services/src/main/java/io/druid/cli/CliCoordinator.java @@ -42,6 +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.InfoResource; import io.druid.server.http.MasterRedirectInfo; import io.druid.server.http.MasterResource;