Merge branch 'master' into fix-extensionization

Conflicts:
	services/src/main/java/io/druid/cli/CliBroker.java
	services/src/main/java/io/druid/cli/CliCoordinator.java
This commit is contained in:
cheddar 2013-09-20 17:49:13 -05:00
commit b13ae3f405
3 changed files with 72 additions and 5 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}
}

View File

@ -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;