IMPALA-5454: Work around template rendering bug in /memz

A template parser issue means that in certain circumstances the JVM
memory metrics would not be rendered to /memz. This patch works around
the parser bug by rewriting the template not to use the problematic
nested construct.

Change-Id: Ie3f01a5cfd3c1c226532bab13895d922f05e94ee
Testing: Checked /memz on statestore, catalog, impalad.
Reviewed-on: http://gerrit.cloudera.org:8080/7106
Reviewed-by: Bharath Vissapragada <[email protected]>
Tested-by: Impala Public Jenkins


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

Branch: refs/heads/master
Commit: 88f1f86b3d2f9ed23a94e285bad6bf09f8c80c93
Parents: 1886da4
Author: Henry Robinson <[email protected]>
Authored: Wed Jun 7 15:21:09 2017 -0700
Committer: Impala Public Jenkins <[email protected]>
Committed: Thu Jun 8 22:08:03 2017 +0000

----------------------------------------------------------------------
 www/memz.tmpl | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/88f1f86b/www/memz.tmpl
----------------------------------------------------------------------
diff --git a/www/memz.tmpl b/www/memz.tmpl
index 2c221af..fca45c0 100644
--- a/www/memz.tmpl
+++ b/www/memz.tmpl
@@ -36,7 +36,8 @@ Memory consumption / limit: <strong>{{consumption}}</strong> 
/ <strong>{{mem_lim
     <th>Value</th>
     <th>Description</th>
   </tr>
-  {{#buffer_pool}}
+{{/buffer_pool}}
+{{#buffer_pool}}
   <tr>
     <td><tt>{{name}}</tt></td>
     {{! Is this a stats metric? }}
@@ -54,7 +55,8 @@ Memory consumption / limit: <strong>{{consumption}}</strong> 
/ <strong>{{mem_lim
       {{description}}
     </td>
   </tr>
-  {{/buffer_pool}}
+{{/buffer_pool}}
+{{?buffer_pool}}
 </table>
 {{/buffer_pool}}
 
@@ -66,7 +68,8 @@ Memory consumption / limit: <strong>{{consumption}}</strong> 
/ <strong>{{mem_lim
     <th>Value</th>
     <th>Description</th>
   </tr>
-  {{#jvm_total}}
+{{/jvm_total}}
+{{#jvm_total}}
   <tr>
     <td><tt>{{name}}</tt></td>
     {{! Is this a stats metric? }}
@@ -84,7 +87,8 @@ Memory consumption / limit: <strong>{{consumption}}</strong> 
/ <strong>{{mem_lim
       {{description}}
     </td>
   </tr>
-  {{/jvm_total}}
+{{/jvm_total}}
+{{?jvm_total}}
 </table>
 {{/jvm_total}}
 
@@ -97,7 +101,8 @@ Memory consumption / limit: <strong>{{consumption}}</strong> 
/ <strong>{{mem_lim
     <th>Value</th>
     <th>Description</th>
   </tr>
-  {{#jvm_heap}}
+{{/jvm_heap}}
+{{#jvm_heap}}
   <tr>
     <td><tt>{{name}}</tt></td>
     {{! Is this a stats metric? }}
@@ -115,7 +120,8 @@ Memory consumption / limit: 
<strong>{{consumption}}</strong> / <strong>{{mem_lim
       {{description}}
     </td>
   </tr>
-  {{/jvm_heap}}
+{{/jvm_heap}}
+{{?jvm_heap}}
 </table>
 {{/jvm_heap}}
 
@@ -127,7 +133,8 @@ Memory consumption / limit: 
<strong>{{consumption}}</strong> / <strong>{{mem_lim
     <th>Value</th>
     <th>Description</th>
   </tr>
-  {{#jvm_non_heap}}
+{{/jvm_non_heap}}
+{{#jvm_non_heap}}
   <tr>
     <td><tt>{{name}}</tt></td>
     {{! Is this a stats metric? }}
@@ -145,7 +152,8 @@ Memory consumption / limit: 
<strong>{{consumption}}</strong> / <strong>{{mem_lim
       {{description}}
     </td>
   </tr>
-  {{/jvm_non_heap}}
+{{/jvm_non_heap}}
+{{?jvm_non_heap}}
 </table>
 {{/jvm_non_heap}}
 

Reply via email to