diff --git a/LICENSE b/LICENSE
index 4be011216bca..a2b2dd6c2bec 100644
--- a/LICENSE
+++ b/LICENSE
@@ -297,28 +297,6 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABI
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-For json.human.js/json.human.css:
-
-Copyright (c) 2016 Mariano Guerra
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For argparse.py:
diff --git a/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon b/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon
index 16d4d30afc9c..b52cb800bd0b 100644
--- a/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon
+++ b/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon
@@ -25,30 +25,28 @@ java.util.*;
org.apache.hadoop.hive.ql.QueryDisplay;
org.apache.hadoop.hive.ql.QueryInfo;
org.apache.hadoop.hive.conf.HiveConf;
+org.apache.hive.common.util.HiveVersionInfo;
org.apache.hive.service.cli.operation.OperationLogManager;
+org.apache.hive.service.servlet.WebUiLayout;
%import>
<%class>
private boolean showGraph = false;
private boolean showStats = false;
+
+private String pill(String s) {
+ return WebUiLayout.pill(s);
+}
%class>
-
-
-
+
- HiveServer2
+ Query details · Hive WebUI
-
-
-
-
-
-
-
-
-
+
+
+
+
<%if hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_SHOW_GRAPH) &&
hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT) %>
<%java showGraph = true; %>
@@ -63,331 +61,236 @@ private boolean showStats = false;
%if>
-
-
-
-
-
+
+<%java
+ long startcode = hiveConf.getLong("startcode", System.currentTimeMillis());
+ long up = (System.currentTimeMillis() - startcode) / 1000;
+ String uptime = (up / 86400) + "d " + ((up % 86400) / 3600) + "h " + ((up % 3600) / 60) + "m";
+%>
+
+ <% WebUiLayout.sidebar("dashboard", HiveVersionInfo.getVersion(), uptime) #n %>
+
-
-
-
- <%if queryInfo == null %>
-
-
Query not found. It may have been deleted, increase hive.server2.webui.max.historic.queries
- to retain more historic query information.
-
- <%else>
-
-
-
-
+
+
+
+
<%def baseProfile>
<%args>
QueryInfo queryInfo;
%args>
-
-
- User Name
- <% queryInfo.getUserName() %>
-
-
- Query String
- <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryString() %>
-
-
- Id
- <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryId() %>
-
-
- Execution Engine
- <% queryInfo.getExecutionEngine() %>
-
-
- State
- <% queryInfo.getState() %>
-
-
- Opened Timestamp
- <% new Date(queryInfo.getBeginTime()) %>
-
-
- Opened (s)
- <% queryInfo.getElapsedTime()/1000 %>
-
-
- Closed Timestamp
- <% queryInfo.getEndTime() == null ? "Open" : new Date(queryInfo.getEndTime()) %>
-
+
+
+
+ User name <% queryInfo.getUserName() %>
+ Query string <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryString() %>
+ Id <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryId() %>
+ Execution engine <% queryInfo.getExecutionEngine() %>
+ State <% queryInfo.getState() %>
+ Opened timestamp <% new Date(queryInfo.getBeginTime()) %>
+ Opened (s) <% queryInfo.getElapsedTime()/1000 %>
+ Closed timestamp <% queryInfo.getEndTime() == null ? "Open" : new Date(queryInfo.getEndTime()) %>
<%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getErrorMessage() != null %>
-
- Error
- <% queryInfo.getQueryDisplay().getErrorMessage() %>
-
+ Error <% queryInfo.getQueryDisplay().getErrorMessage() %>
%if>
-
- Latency (s)
- <% queryInfo.getRuntime() == null ? "Not finished" : queryInfo.getRuntime()/1000 %>
-
+ Latency (s) <% queryInfo.getRuntime() == null ? "Not finished" : queryInfo.getRuntime()/1000 %>
+
+
%def>
<%def stages>
<%args>
QueryInfo queryInfo;
%args>
-
-
- Stage Id
- Status
- Begin Time
- End Time
- Elapsed Time (s)
- Requires Lock
-
-
- <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getTaskDisplays() != null %>
- <%for QueryDisplay.TaskDisplay taskDisplay : queryInfo.getQueryDisplay().getTaskDisplays() %>
-
- <% taskDisplay.getTaskId() + ":" + taskDisplay.getTaskType() %>
- <% taskDisplay.getStatus() %>
- <% taskDisplay.getBeginTime() == null ? "" : new Date(taskDisplay.getBeginTime()) %>
- <% taskDisplay.getEndTime() == null ? "" : new Date(taskDisplay.getEndTime()) %>
- <% taskDisplay.getElapsedTime() == null ? "" : taskDisplay.getElapsedTime()/1000 %> (s)
- <% taskDisplay.isRequireLock() %>
-
- %for>
- %if>
-
+
+
+
+ Stage id Status
+ Begin time End time
+ Elapsed (s) Requires lock
+
+
+ <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getTaskDisplays() != null %>
+ <%for QueryDisplay.TaskDisplay taskDisplay : queryInfo.getQueryDisplay().getTaskDisplays() %>
+
+ <% taskDisplay.getTaskId() + ":" + taskDisplay.getTaskType() %>
+ <% taskDisplay.getStatus() %>
+ <% taskDisplay.getBeginTime() == null ? "" : new Date(taskDisplay.getBeginTime()) %>
+ <% taskDisplay.getEndTime() == null ? "" : new Date(taskDisplay.getEndTime()) %>
+ <% taskDisplay.getElapsedTime() == null ? "" : taskDisplay.getElapsedTime()/1000 %>
+ <% taskDisplay.isRequireLock() %>
+
+ %for>
+ %if>
+
+
+
%def>
-
<%def queryPlan>
<%args>
QueryInfo queryInfo;
%args>
-
-
Explain plan
-
- <%if showGraph %>
- <%if queryInfo.getQueryDisplay() != null &&
- queryInfo.getQueryDisplay().getExplainPlan() != null &&
- !queryInfo.getQueryDisplay().getExplainPlan().equals("UNKNOWN")%>
-
- <%if showStats %>
-
- <%else>
-
- %if>
-
+
+
Explain plan
+
+ <%if showGraph %>
+ <%if queryInfo.getQueryDisplay() != null &&
+ queryInfo.getQueryDisplay().getExplainPlan() != null &&
+ !queryInfo.getQueryDisplay().getExplainPlan().equals("UNKNOWN")%>
+
+ <%if showStats %>
+
<%else>
-
Query information not available. Query may have failed or plan size may exceed value of config hive.server2.webui.max.graph.size.
+
%if>
+
<%else>
- <%if hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT) %>
-
- <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getExplainPlan() %>
-
- <%else>
-
- Set configuration hive.server2.webui.explain.output to true to view future query plans
-
- %if>
+
Query information not available. Query may have failed or plan size may exceed value of config hive.server2.webui.max.graph.size.
%if>
-
+ <%else>
+ <%if hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT) %>
+
<% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getExplainPlan() %>
+ <%else>
+
Set configuration hive.server2.webui.explain.output to true to view future query plans.
+ %if>
+ %if>
+
%def>
-<%if showGraph %>
-
-%if>
-
<%def perfLogging>
<%args>
QueryInfo queryInfo;
%args>
-
- Compile-time metadata operations
-
-
- Call Name
- Time (ms)
-
-
- <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.COMPILATION) != null %>
- <%for Map.Entry time : queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.COMPILATION).entrySet() %>
-
- <% time.getKey() %>
- <% time.getValue() %>
-
- %for>
- %if>
-
-
-
-
- Execution-time metadata operations
-
-
- Call Name
- Time (ms)
-
-
- <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.EXECUTION) != null %>
- <%for Map.Entry time : queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.EXECUTION).entrySet() %>
-
- <% time.getKey() %>
- <% time.getValue() %>
-
- %for>
- %if>
-
-
-
-
- Compile-Time Perf-Logger
-
-
- Compile-time Call Name
- Time (ms)
-
-
- <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.COMPILATION) != null %>
- <%for Map.Entry time : queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.COMPILATION).entrySet() %>
-
- <% time.getKey() %>
- <% time.getValue() %>
-
- %for>
- %if>
-
-
-
-
- Execution-Time Perf-Logger
-
-
- Execution-time Call Name
- Time (ms)
-
+ <& perfTable; title = "Compile-time metadata operations"; m = (queryInfo.getQueryDisplay() == null ? null : queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.COMPILATION)) &>
+ <& perfTable; title = "Execution-time metadata operations"; m = (queryInfo.getQueryDisplay() == null ? null : queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.EXECUTION)) &>
+ <& perfTable; title = "Compile-time perf logger"; m = (queryInfo.getQueryDisplay() == null ? null : queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.COMPILATION)) &>
+ <& perfTable; title = "Execution-time perf logger"; m = (queryInfo.getQueryDisplay() == null ? null : queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.EXECUTION)) &>
+%def>
- <%if queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.EXECUTION) != null %>
- <%for Map.Entry time : queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.EXECUTION).entrySet() %>
-
- <% time.getKey() %>
- <% time.getValue() %>
-
- %for>
- %if>
-
-
+<%def perfTable>
+<%args>
+ String title;
+ Map
m;
+%args>
+
+
<% title %>
+
+
+ Call name Time (ms)
+
+
+ <%if m != null %>
+ <%for Map.Entry time : m.entrySet() %>
+
+ <% time.getKey() %>
+ <% time.getValue() %>
+
+ %for>
+ <%else>
+ No data
+ %if>
+
+
+
%def>
<%def operationLog>
<%args>
QueryInfo queryInfo;
%args>
-
-
<% OperationLogManager.getOperationLog(queryInfo) %>
-
+
+
<% OperationLogManager.getOperationLog(queryInfo) %>
+
%def>
-
-
-
-
-