You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2019/09/13 01:40:58 UTC

[impala] 01/02: IMPALA-8935: Add links to other daemons from webui

This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit b3eb2d3c99ad45250866b0ef2a55a795def4df2f
Author: Thomas Tauber-Marshall <tm...@cloudera.com>
AuthorDate: Tue Sep 10 15:00:26 2019 -0700

    IMPALA-8935: Add links to other daemons from webui
    
    This patch adds links on the /backends page of the webui to the
    webuis for the other backends.
    
    Testing:
    - Updated test_backends_page to check for the webui links.
    
    Change-Id: I4f92ed47ea3d96dbb8837f23467906510aec2e78
    Reviewed-on: http://gerrit.cloudera.org:8080/14215
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/service/impala-http-handler.cc | 5 +++++
 tests/webserver/test_web_pages.py     | 4 ++++
 www/backends.tmpl                     | 2 ++
 3 files changed, 11 insertions(+)

diff --git a/be/src/service/impala-http-handler.cc b/be/src/service/impala-http-handler.cc
index 3dee11b..ccbc520 100644
--- a/be/src/service/impala-http-handler.cc
+++ b/be/src/service/impala-http-handler.cc
@@ -934,6 +934,11 @@ void ImpalaHttpHandler::BackendsHandler(const Webserver::WebRequest& req,
         TNetworkAddressToString(backend.krpc_address).c_str(), document->GetAllocator());
     backend_obj.AddMember("address", str, document->GetAllocator());
     backend_obj.AddMember("krpc_address", krpc_address, document->GetAllocator());
+    string webserver_url =
+        Substitute("$0://$1", backend.secure_webserver ? "https" : "http",
+            TNetworkAddressToString(backend.debug_http_address));
+    Value webserver_url_val(webserver_url.c_str(), document->GetAllocator());
+    backend_obj.AddMember("webserver_url", webserver_url_val, document->GetAllocator());
     backend_obj.AddMember("is_coordinator", backend.is_coordinator,
         document->GetAllocator());
     backend_obj.AddMember("is_executor", backend.is_executor, document->GetAllocator());
diff --git a/tests/webserver/test_web_pages.py b/tests/webserver/test_web_pages.py
index 771a67c..3cb5bbc 100644
--- a/tests/webserver/test_web_pages.py
+++ b/tests/webserver/test_web_pages.py
@@ -594,6 +594,10 @@ class TestWebPage(ImpalaTestSuite):
     # Look at results for a single backend - they are not sorted.
     backend_row = response_json['backends'][0]
 
+    assert len(backend_row['webserver_url']) > 0
+    webserver_ports = ('25000', '25001', '25002')
+    assert backend_row['webserver_url'].endswith(webserver_ports)
+
     # The 'address' column is the backend port of the impalad.
     assert len(backend_row['address']) > 0
     be_ports = ('22000', '22001', '22002')
diff --git a/www/backends.tmpl b/www/backends.tmpl
index aa164b7..bbdbd6e 100644
--- a/www/backends.tmpl
+++ b/www/backends.tmpl
@@ -23,6 +23,7 @@ under the License.
 <table id="backends" class='table table-hover table-bordered'>
   <thead>
     <tr>
+      <th></th>
       <th>Address</th>
       <th>Krpc Address</th>
       <th>Coordinator</th>
@@ -39,6 +40,7 @@ under the License.
   <tbody>
     {{#backends}}
     <tr>
+      <td><a href='{{webserver_url}}'>Web UI</a></td>
       <td>{{address}}</td>
       <td>{{krpc_address}}</td>
       <td>{{is_coordinator}}</td>