Updated Branches:
  refs/heads/master 8ee31026f -> f82a4c9dc

Fixes controller status pages.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/f82a4c9d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/f82a4c9d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/f82a4c9d

Branch: refs/heads/master
Commit: f82a4c9dca19a779854ed8fa786684572c4fb92a
Parents: cc606b4
Author: Aaron McCurry <[email protected]>
Authored: Mon Dec 2 08:40:17 2013 -0500
Committer: Aaron McCurry <[email protected]>
Committed: Mon Dec 2 08:41:32 2013 -0500

----------------------------------------------------------------------
 .../apache/blur/thrift/ThriftBlurControllerServer.java | 13 +++++++++++++
 blur-gui/src/main/webapp/config.html                   |  1 -
 blur-gui/src/main/webapp/index.html                    | 13 +++++++++++--
 blur-gui/src/main/webapp/metrics.html                  |  1 -
 4 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f82a4c9d/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java
----------------------------------------------------------------------
diff --git 
a/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java
 
b/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java
index d6a487d..2d78a13 100644
--- 
a/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java
+++ 
b/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java
@@ -48,6 +48,7 @@ import org.apache.blur.BlurConfiguration;
 import org.apache.blur.concurrent.SimpleUncaughtExceptionHandler;
 import org.apache.blur.concurrent.ThreadWatcher;
 import org.apache.blur.gui.HttpJettyServer;
+import org.apache.blur.gui.JSONReporterServlet;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.manager.BlurQueryChecker;
@@ -56,7 +57,10 @@ import 
org.apache.blur.manager.indexserver.BlurServerShutDown;
 import org.apache.blur.manager.indexserver.BlurServerShutDown.BlurShutdown;
 import org.apache.blur.metrics.ReporterSetup;
 import org.apache.blur.server.ControllerServerEventHandler;
+import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol;
+import org.apache.blur.thirdparty.thrift_0_9_0.server.TServlet;
 import 
org.apache.blur.thirdparty.thrift_0_9_0.transport.TNonblockingServerSocket;
+import org.apache.blur.thrift.generated.Blur;
 import org.apache.blur.thrift.generated.Blur.Iface;
 import org.apache.blur.trace.Trace;
 import org.apache.blur.trace.TraceStorage;
@@ -64,6 +68,8 @@ import org.apache.blur.utils.BlurUtil;
 import org.apache.blur.utils.MemoryReporter;
 import org.apache.blur.zookeeper.ZkUtils;
 import org.apache.zookeeper.ZooKeeper;
+import org.mortbay.jetty.servlet.ServletHolder;
+import org.mortbay.jetty.webapp.WebAppContext;
 
 public class ThriftBlurControllerServer extends ThriftServer {
 
@@ -172,6 +178,13 @@ public class ThriftBlurControllerServer extends 
ThriftServer {
     } else {
       httpServer = null;
     }
+    
+    if (httpServer != null) {
+      WebAppContext context = httpServer.getContext();
+      context.addServlet(new ServletHolder(new TServlet(new 
Blur.Processor<Blur.Iface>(iface),
+          new TJSONProtocol.Factory())), "/blur");
+      context.addServlet(new ServletHolder(new JSONReporterServlet()), 
"/livemetrics");
+    }
 
     // This will shutdown the server when the correct path is set in zk
     BlurShutdown shutdown = new BlurShutdown() {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f82a4c9d/blur-gui/src/main/webapp/config.html
----------------------------------------------------------------------
diff --git a/blur-gui/src/main/webapp/config.html 
b/blur-gui/src/main/webapp/config.html
index c8afbe8..ba51c5a 100644
--- a/blur-gui/src/main/webapp/config.html
+++ b/blur-gui/src/main/webapp/config.html
@@ -38,7 +38,6 @@ function displayPage() {
          var config = client.configuration();
          var body = $("#page_body");
          var keys = Object.keys(config).sort();
-         body.append("<h1>Shard Server</h1>");
       body.append("<h2>Configuration</h2>");
       var s = "<table border=1 class=\"table-bordered table-striped 
table-condensed\"><tr><th>Name</th><th>Value</th></tr>";
          for (var i = 0; i < keys.length; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f82a4c9d/blur-gui/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/blur-gui/src/main/webapp/index.html 
b/blur-gui/src/main/webapp/index.html
index 0d48058..019aa6d 100644
--- a/blur-gui/src/main/webapp/index.html
+++ b/blur-gui/src/main/webapp/index.html
@@ -39,8 +39,6 @@ function displayPage() {
          var body = $("#page_body");
          for (var i = 0; i < clusters.length; i++) {
         var cluster = clusters[i];
-        body.append("<h1>Shard Server</h1>");
-
         body.append("<h2>Tables [" + cluster + "]</h2>");
            var tables = client.tableListByCluster(cluster);
            tables.sort();
@@ -61,6 +59,17 @@ s += "<tr><th>Name</th><th>Enabled</th><th>Totals 
Shards</th><th>Online Shards</
                  s += "</tr>";
                }
                body.append(s + "</table>");
+               
+               body.append("<h2>All Controller Servers</h2>");
+        var cservers = client.controllerServerList();
+        cservers.sort();
+        var l = "<ul>";
+           for (var t = 0; t < cservers.length; t++) {
+                 var server = cservers[t];
+                 var hostname = getHostName(server);
+                 l += "<li><a href=\"http://"+hostname+"\";>" + server + 
"</a></li>";
+               }
+               body.append(l + "</ul>");
 
         body.append("<h2>All Shard Servers in [" + cluster + "]</h2>");
         var servers = client.shardServerList(cluster);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f82a4c9d/blur-gui/src/main/webapp/metrics.html
----------------------------------------------------------------------
diff --git a/blur-gui/src/main/webapp/metrics.html 
b/blur-gui/src/main/webapp/metrics.html
index c5f6f48..acc3a75 100644
--- a/blur-gui/src/main/webapp/metrics.html
+++ b/blur-gui/src/main/webapp/metrics.html
@@ -39,7 +39,6 @@ function displayPage() {
          var body = $("#page_body");
          var keys = Object.keys(metrics).sort();
       var s = "";
-         s += "<h1>Shard Server</h1>";
       s += "<h2>Metrics</h2>";
       s += "<table border=1 class=\"table-bordered table-striped 
table-condensed\"><tr><th>Name</th><th>Value</th></tr>";
          for (var i = 0; i < keys.length; i++) {

Reply via email to