fix inconsistent druid http paths + fix master console bugs

This commit is contained in:
Fangjin Yang 2013-03-27 10:40:44 -07:00
parent e785b87be0
commit 5bdcc3613c
4 changed files with 30 additions and 17 deletions

View File

@ -207,12 +207,11 @@ public class BrokerNode extends QueryableNode<BrokerNode>
theModules.addAll(extraModules);
final Injector injector = Guice.createInjector(theModules);
final Context root = new Context(getServer(), "/druid/v2", Context.SESSIONS);
final Context root = new Context(getServer(), "/", Context.SESSIONS);
root.addServlet(new ServletHolder(new StatusServlet()), "/status");
root.addServlet(
new ServletHolder(new QueryServlet(getJsonMapper(), getSmileMapper(), texasRanger, getEmitter(), getRequestLogger())),
"/*"
"/druid/v2/*"
);
root.addEventListener(new GuiceServletConfig(injector));

View File

@ -190,13 +190,13 @@ public class RealtimeNode extends BaseServerNode<RealtimeNode>
startMonitoring(monitors);
final Context v2Druid = new Context(getServer(), "/druid/v2", Context.SESSIONS);
v2Druid.addServlet(new ServletHolder(new StatusServlet()), "/status");
v2Druid.addServlet(
final Context root = new Context(getServer(), "/", Context.SESSIONS);
root.addServlet(new ServletHolder(new StatusServlet()), "/status");
root.addServlet(
new ServletHolder(
new QueryServlet(getJsonMapper(), getSmileMapper(), realtimeManager, emitter, getRequestLogger())
),
"/*"
"/druid/v2/*"
);
initialized = true;

View File

@ -54,6 +54,7 @@ import org.jets3t.service.S3ServiceException;
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
import org.jets3t.service.security.AWSCredentials;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.DefaultServlet;
import org.mortbay.jetty.servlet.ServletHolder;
import org.skife.config.ConfigurationObjectFactory;
@ -149,13 +150,12 @@ public class ComputeNode extends BaseServerNode<ComputeNode>
startMonitoring(monitors);
final Context root = new Context(getServer(), "/", Context.SESSIONS);
root.addServlet(new ServletHolder(new StatusServlet()), "/status");
root.addServlet(
new ServletHolder(
new QueryServlet(getJsonMapper(), getSmileMapper(), serverManager, emitter, getRequestLogger())
),
"/*"
"/druid/v2/*"
);
}
@ -221,9 +221,12 @@ public class ComputeNode extends BaseServerNode<ComputeNode>
jsonMapper = new DefaultObjectMapper();
smileMapper = new DefaultObjectMapper(new SmileFactory());
smileMapper.getJsonFactory().setCodec(smileMapper);
}
else if (jsonMapper == null || smileMapper == null) {
throw new ISE("Only jsonMapper[%s] or smileMapper[%s] was set, must set neither or both.", jsonMapper, smileMapper);
} else if (jsonMapper == null || smileMapper == null) {
throw new ISE(
"Only jsonMapper[%s] or smileMapper[%s] was set, must set neither or both.",
jsonMapper,
smileMapper
);
}
if (lifecycle == null) {

View File

@ -6,10 +6,10 @@ $(document).ready(function() {
var type = $('#select_type').attr('value') + '';
var view = $('#select_view').attr('value') + '';
function handleTable()
function handleTable(dontDisplay)
{
$.get(basePath + type + '?full', function(data) {
buildTable(data, $('#result_table'));
buildTable(data, $('#result_table'), dontDisplay);
$('.loading').hide();
$('#table_wrapper').show();
@ -75,14 +75,25 @@ $(document).ready(function() {
}
$('#view_button').click(function() {
type = $('#select_type').attr('value') + "";
view = $('#select_view').attr('value') + "";
type = $('#select_type').attr('value') + '';
view = $('#select_view').attr('value') + '';
resetViews();
switch (view) {
case "table":
handleTable();
var dontDisplay;
switch (type) {
case "servers":
case "datasources":
dontDisplay = ["segments"];
break;
case "segments":
dontDisplay = ["shardSpec"];
break;
}
handleTable(dontDisplay);
break;
case "list":
handleList(type.indexOf("segments") == -1);