You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by do...@apache.org on 2022/04/29 20:50:25 UTC

[accumulo] branch main updated: Highlight rows with recovering tservers in the tserver status table (#2663)

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

domgarguilo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new b3ac225d43 Highlight rows with recovering tservers in the tserver status table (#2663)
b3ac225d43 is described below

commit b3ac225d43bacf86bb280be48de750c409f45e66
Author: Dom G <do...@gmail.com>
AuthorDate: Fri Apr 29 16:50:18 2022 -0400

    Highlight rows with recovering tservers in the tserver status table (#2663)
    
    * highlight recovering tservers
    
    * add caption when there are recovering tservers
---
 .../accumulo/monitor/resources/js/tservers.js      | 32 ++++++++++++++++++++--
 .../apache/accumulo/monitor/templates/tservers.ftl |  1 +
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
index 1446b481a2..b17cd153d9 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/tservers.js
@@ -23,6 +23,22 @@ var tserversList;
  * Creates tservers initial table
  */
 $(document).ready(function() {
+    
+  const recoveryList = []
+  getRecoveryList().then(function () {
+    // fill recoveryList
+    JSON.parse(sessionStorage.recoveryList).recoveryList.forEach(entry => {
+      recoveryList.push(entry.server);
+    });
+
+    // only show the note about highlighted rows if there are rows to highlight
+    if (recoveryList.length === 0) {
+      $('#recovery-caption').hide();
+    } else {
+      $('#recovery-caption').show();
+    }
+  });
+    
     // Create a table for tserver list
     tserversList = $('#tservers').DataTable({
       "ajax": {
@@ -71,7 +87,19 @@ $(document).ready(function() {
         { "data": "indexCacheHitRate" },
         { "data": "dataCacheHitRate" },
         { "data": "osload" }
-      ]
+      ],
+      "rowCallback": function (row, data, index) {
+        // reset background of each row
+        $(row).css('background-color', '');
+
+        // return if current rows tserver is not recovering
+        if (!recoveryList.includes(data.hostname))
+          return;
+
+        // highlight current row
+        console.log('Highlighting row index:' + index + ' tserver:' + data.hostname);
+        $(row).css('background-color', 'gold');
+      }
     });
     refreshTServers();
 });
@@ -165,5 +193,5 @@ function clearDeadTServers(server) {
  * Generates the tserver table
  */
 function refreshTServersTable() {
-  if(tserversList) tserversList.ajax.reload(null, false ); // user paging is not reset on reload
+  if (tserversList) tserversList.ajax.reload(null, false); // user paging is not reset on reload
 }
diff --git a/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tservers.ftl b/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tservers.ftl
index 291595aea1..905abe435b 100644
--- a/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tservers.ftl
+++ b/server/monitor/src/main/resources/org/apache/accumulo/monitor/templates/tservers.ftl
@@ -49,6 +49,7 @@
             </thead>
             <tbody></tbody>
           </table>
+          <span id="recovery-caption" style="background-color: gold;">Highlighted rows correspond to tservers in recovery mode.</span>
           <table id="tservers" class="table table-bordered table-striped table-condensed">
             <thead>
               <tr>