mirror of
https://github.com/apache/impala.git
synced 2025-12-19 09:58:28 -05:00
Currently, the scripts in the entire webUI contain variable and function declarations using the ES5 standard. In such declarations, all the variables are attached to the browser's window object, polluting the global scope. Additionally, many unnamed functions can be represented with cleaner and concise syntax. This patch refactors such declarations, using the ES6 syntax. -> Replacing 'var' declarations with 'let' and 'const' - To improve browser's memory utilization - For better scoping, immutability and readability -> Replacing unnamed function declarations with arrow functions - Better scoping by binding 'this' object to the surrounding context These improve maintainability and browser's memory utilization. Across many instances within the webUI scripts, no particular naming scheme is being followed for variable and function identifiers. Hence, they have been revised with the following naming scheme. -> All function names have been declared using camel case. -> All constant primitive values and strings have been declared in uppercase. -> All other types of variables have been declared using snake case. This naming scheme allows easier distinction between functions, constants and other variables, based on the identifiers. These changes to code style are further enforced during code review through IMPALA-13473. Change-Id: Ie38f2c642ede14956a2c6d551a58e42538204768 Reviewed-on: http://gerrit.cloudera.org:8080/21851 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
186 lines
5.5 KiB
Cheetah
186 lines
5.5 KiB
Cheetah
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
{{> www/common-header.tmpl }}
|
|
|
|
<h2>Active backend(s): {{num_active_backends}}</h2>
|
|
|
|
<table id="backends" class='table table-hover table-bordered table-responsive'>
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>Address</th>
|
|
<th>Krpc Address</th>
|
|
<th>Backend Id</th>
|
|
<th>Version</th>
|
|
<th>Process Start Time</th>
|
|
<th>Coordinator</th>
|
|
<th>Executor</th>
|
|
<th>Memory Limit for Admission</th>
|
|
<th>Memory Reserved</th>
|
|
<th>Memory Admitted by Queries Submitted to this Coordinator</th>
|
|
<th>Admission Control Slots In Use</th>
|
|
<th>Num. Queries Admitted by this Coordinator</th>
|
|
<th>Executor Groups</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#backends}}
|
|
{{?is_active}}
|
|
<tr>
|
|
<td><a href='{{webserver_url}}'>Web UI</a></td>
|
|
<td>{{address}}</td>
|
|
<td>{{krpc_address}}</td>
|
|
<td>{{backend_id}}</td>
|
|
<td>{{version}}</td>
|
|
<td>{{process_start_time}}</td>
|
|
<td>{{is_coordinator}}</td>
|
|
<td>{{is_executor}}</td>
|
|
<td>{{admit_mem_limit}}</td>
|
|
<td>{{mem_reserved}}</td>
|
|
<td>{{mem_admitted}}</td>
|
|
<td>{{admission_slots_in_use}}/{{admission_slots}}</td>
|
|
<td>{{num_admitted}}</td>
|
|
<td>{{executor_groups}}</td>
|
|
</tr>
|
|
{{/is_active}}
|
|
{{/backends}}
|
|
</tbody>
|
|
</table>
|
|
|
|
{{#num_quiescing_backends}}
|
|
<h2>Quiescing backend(s)<sup><a href='#' data-toggle="tooltip" title="{{> www/quiescing_tooltip.txt }}">[?]</a></sup>: {{num_quiescing_backends}}</h2>
|
|
|
|
<table id="quiescing_backends" class='table table-hover table-bordered table-responsive'>
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>Address</th>
|
|
<th>Krpc Address</th>
|
|
<th>Backend Id</th>
|
|
<th>Version</th>
|
|
<th>Process Start Time</th>
|
|
<th>Coordinator</th>
|
|
<th>Executor</th>
|
|
<th>Memory Limit for Admission</th>
|
|
<th>Memory Reserved</th>
|
|
<th>Memory Admitted by Queries Submitted to this Coordinator</th>
|
|
<th>Admission Control Slots In Use</th>
|
|
<th>Num. Queries Admitted by this Coordinator</th>
|
|
<th>Executor Groups</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#backends}}
|
|
{{?is_quiescing}}
|
|
<tr>
|
|
<td><a href='{{webserver_url}}'>Web UI</a></td>
|
|
<td>{{address}}</td>
|
|
<td>{{krpc_address}}</td>
|
|
<td>{{backend_id}}</td>
|
|
<td>{{version}}</td>
|
|
<td>{{process_start_time}}</td>
|
|
<td>{{is_coordinator}}</td>
|
|
<td>{{is_executor}}</td>
|
|
<td>{{admit_mem_limit}}</td>
|
|
<td>{{mem_reserved}}</td>
|
|
<td>{{mem_admitted}}</td>
|
|
<td>{{admission_slots_in_use}}/{{admission_slots}}</td>
|
|
<td>{{num_admitted}}</td>
|
|
<td>{{executor_groups}}</td>
|
|
</tr>
|
|
{{/is_quiescing}}
|
|
{{/backends}}
|
|
</tbody>
|
|
</table>
|
|
{{/num_quiescing_backends}}
|
|
|
|
{{#num_blacklisted_backends}}
|
|
<h2>Blacklisted backend(s)<sup><a href='#' data-toggle="tooltip" title="{{> www/blacklisted_tooltip.txt }}">[?]</a></sup>: {{num_blacklisted_backends}}</h2>
|
|
|
|
<table id="blacklisted_backends" class='table table-hover table-bordered table-responsive'>
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>Address</th>
|
|
<th>Krpc Address</th>
|
|
<th>Backend Id</th>
|
|
<th>Version</th>
|
|
<th>Process Start Time</th>
|
|
<th>Blacklisting Cause</th>
|
|
<th>Time remaining on blacklist</th>
|
|
<th>Coordinator</th>
|
|
<th>Executor</th>
|
|
<th>Memory Limit for Admission</th>
|
|
<th>Memory Reserved</th>
|
|
<th>Memory Admitted by Queries Submitted to this Coordinator</th>
|
|
<th>Admission Control Slots In Use</th>
|
|
<th>Num. Queries Admitted by this Coordinator</th>
|
|
<th>Executor Groups</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#backends}}
|
|
{{?is_blacklisted}}
|
|
<tr>
|
|
<td><a href='{{webserver_url}}'>Web UI</a></td>
|
|
<td>{{address}}</td>
|
|
<td>{{krpc_address}}</td>
|
|
<td>{{backend_id}}</td>
|
|
<td>{{version}}</td>
|
|
<td>{{process_start_time}}</td>
|
|
<td>{{blacklist_cause}}</td>
|
|
<td>{{blacklist_time_remaining}}</td>
|
|
<td>{{is_coordinator}}</td>
|
|
<td>{{is_executor}}</td>
|
|
<td>{{admit_mem_limit}}</td>
|
|
<td>{{mem_reserved}}</td>
|
|
<td>{{mem_admitted}}</td>
|
|
<td>{{admission_slots_in_use}}/{{admission_slots}}</td>
|
|
<td>{{num_admitted}}</td>
|
|
<td>{{executor_groups}}</td>
|
|
</tr>
|
|
{{/is_blacklisted}}
|
|
{{/backends}}
|
|
</tbody>
|
|
</table>
|
|
{{/num_blacklisted_backends}}
|
|
|
|
<script>
|
|
$(document).ready(() => {
|
|
$('#backends').DataTable({
|
|
"order": [[ 0, "desc" ]],
|
|
"pageLength": 100
|
|
});
|
|
});
|
|
$(document).ready(() => {
|
|
$('#quiescing_backends').DataTable({
|
|
"order": [[ 0, "desc" ]],
|
|
"pageLength": 100
|
|
});
|
|
});
|
|
$(document).ready(() => {
|
|
$('#blacklisted_backends').DataTable({
|
|
"order": [[ 0, "desc" ]],
|
|
"pageLength": 100
|
|
});
|
|
});
|
|
</script>
|
|
|
|
{{> www/common-footer.tmpl}}
|