drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sohami <...@git.apache.org>
Subject [GitHub] drill pull request #1241: DRILL-6364: Handle Cluster Info in WebUI when exis...
Date Wed, 02 May 2018 06:53:34 GMT
Github user sohami commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1241#discussion_r185406413
  
    --- Diff: exec/java-exec/src/main/resources/rest/index.ftl ---
    @@ -252,33 +255,129 @@
               timeout = setTimeout(reloadStatus, refreshTime);
           }
     
    -      function fillStatus(data,size) {
    -          var status_map = (data.responseJSON);
    -          for (i = 1; i <= size; i++) {
    -            var address = $("#row-"+i).find("#address").contents().get(0).nodeValue;
    -            address = address.trim();
    -            var port = $("#row-"+i).find("#port").html();
    -            var key = address+"-"+port;
    +      function fillStatus(dataResponse,size) {
    +          var status_map = (dataResponse.responseJSON);
    +          //In case localhost has gone down (i.e. we don't know status from ZK)
    +          if (typeof status_map == 'undefined') {
    +            //Query other nodes for state details
    +            for (j = 1; j <= size; j++) {
    +              if ($("#row-"+j).find("#current").html() == "Current") {
    +                continue; //Skip LocalHost
    +              }
    +              var address = $("#row-"+j).find("#address").contents().get(0).nodeValue.trim();
    +              var restPort = $("#row-"+j).find("#httpPort").contents().get(0).nodeValue.trim();
    +              var altStateUrl = location.protocol + "//" + address+":"+restPort + "/state";
    +              var goatResponse = $.getJSON(altStateUrl)
    +                    .done(function(stateDataJson) {
    +                        //Update Status & Buttons for alternate stateData
    +                        if (typeof status_map == 'undefined') {
    +                          status_map = (stateDataJson); //Update
    +                          updateStatusAndShutdown(stateDataJson);
    +                        }
    +                      });
    +              //Don't loop any more
    +              if (typeof status_map != 'undefined') {
    +                break;
    +              }
    +            }
    +          } else {
    +            updateStatusAndShutdown(status_map);
    +          }
    +      }
    +
    +      function updateStatusAndShutdown(status_map) {
    +        let bitMap = {};
    --- End diff --
    
    Ok but status_map is used in listNewDrillbits and point was to use only one, in this case
bit_map is fine.


---

Mime
View raw message