All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hive.tmpl.QueryProfileTmplImpl Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
// Autogenerated Jamon implementation
// /Users/pvary/dev/upstream/hive_rel/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon

package org.apache.hive.tmpl;

// 24, 1
import java.util.*;
// 25, 1
import org.apache.hadoop.hive.ql.QueryDisplay;
// 26, 1
import org.apache.hadoop.hive.ql.QueryInfo;
// 27, 1
import org.apache.hadoop.hive.conf.HiveConf;
// 28, 1
import org.apache.hive.service.cli.operation.OperationLogManager;

public class QueryProfileTmplImpl
  extends org.jamon.AbstractTemplateImpl
  implements org.apache.hive.tmpl.QueryProfileTmpl.Intf

{
  private final QueryInfo queryInfo;
  private final HiveConf hiveConf;
  // 30, 1
  
private boolean showGraph = false;
private boolean showStats = false;

  protected static org.apache.hive.tmpl.QueryProfileTmpl.ImplData __jamon_setOptionalArguments(org.apache.hive.tmpl.QueryProfileTmpl.ImplData p_implData)
  {
    return p_implData;
  }
  public QueryProfileTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hive.tmpl.QueryProfileTmpl.ImplData p_implData)
  {
    super(p_templateManager, __jamon_setOptionalArguments(p_implData));
    queryInfo = p_implData.getQueryInfo();
    hiveConf = p_implData.getHiveConf();
  }
  
  public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 34, 1
    jamonWriter.write("\n\n\n  \n    \n    HiveServer2\n    \n    \n\n    \n    \n    \n\n    \n    \n    \n    ");
    // 52, 5
    if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_SHOW_GRAPH) &&
      hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT) )
    {
      // 53, 82
      jamonWriter.write("\n      ");
      // 54, 7
      showGraph = true; 
      // 55, 7
      if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_SHOW_STATS) )
      {
        // 55, 83
        jamonWriter.write("\n        ");
        // 56, 9
        showStats = true; 
      }
      // 57, 13
      jamonWriter.write("\n    ");
    }
    // 58, 11
    jamonWriter.write("\n    ");
    // 59, 5
    if (showGraph )
    {
      // 59, 22
      jamonWriter.write("\n      \n      \n      \n    ");
    }
    // 63, 11
    jamonWriter.write("\n  \n\n  \n  
\n
\n
\n \n \"Hive\n
\n \n
\n
\n
\n\n\n "); // 91, 5 if (queryInfo == null ) { // 91, 30 jamonWriter.write("\n
\n

Query not found. It may have been deleted, increase hive.server2.webui.max.historic.queries\n to retain more historic query information.

\n
\n "); } // 96, 5 else { // 96, 12 jamonWriter.write("\n\n\n
\n
\n
\n

Query Information: "); // 102, 34 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryString()), jamonWriter); // 102, 134 jamonWriter.write("

\n
\n
\n
\n\n\n
\n \n
\n
\n "); // 118, 19 { // 118, 19 __jamon_innerUnit__baseProfile(jamonWriter, queryInfo ); } // 118, 59 jamonWriter.write("\n
\n
\n "); // 121, 19 { // 121, 19 __jamon_innerUnit__stages(jamonWriter, queryInfo ); } // 121, 54 jamonWriter.write("\n
\n
\n "); // 124, 19 { // 124, 19 __jamon_innerUnit__queryPlan(jamonWriter, queryInfo ); } // 124, 57 jamonWriter.write("\n
\n
\n "); // 127, 19 { // 127, 19 __jamon_innerUnit__perfLogging(jamonWriter, queryInfo ); } // 127, 59 jamonWriter.write("\n
\n
\n "); // 130, 19 { // 130, 19 __jamon_innerUnit__operationLog(jamonWriter, queryInfo ); } // 130, 60 jamonWriter.write("\n
\n
\n
\n\n "); } // 135, 10 jamonWriter.write("\n\n
\n
\n\n\n\n\n\n\n"); // 288, 1 if (showGraph ) { // 288, 18 jamonWriter.write("\n \n"); } // 297, 7 jamonWriter.write("\n\n\n
\n\n\n\n"); } // 145, 1 private void __jamon_innerUnit__baseProfile(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final QueryInfo queryInfo) throws java.io.IOException { // 149, 5 jamonWriter.write("\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n "); // 182, 9 if (queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getErrorMessage() != null ) { // 182, 109 jamonWriter.write("\n \n \n \n \n "); } // 187, 15 jamonWriter.write("\n \n \n \n \n
User Name"); // 152, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getUserName()), jamonWriter); // 152, 46 jamonWriter.write("
Query String"); // 156, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryString()), jamonWriter); // 156, 117 jamonWriter.write("
Id"); // 160, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getQueryId()), jamonWriter); // 160, 113 jamonWriter.write("
Execution Engine"); // 164, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getExecutionEngine()), jamonWriter); // 164, 53 jamonWriter.write("\n
State"); // 168, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getState()), jamonWriter); // 168, 43 jamonWriter.write("
Opened Timestamp"); // 172, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(queryInfo.getBeginTime())), jamonWriter); // 172, 57 jamonWriter.write("
Opened (s)"); // 176, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getElapsedTime()/1000), jamonWriter); // 176, 54 jamonWriter.write("
Closed Timestamp"); // 180, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getEndTime() == null ? "Open" : new Date(queryInfo.getEndTime())), jamonWriter); // 180, 97 jamonWriter.write("
Error"); // 185, 21 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getQueryDisplay().getErrorMessage()), jamonWriter); // 185, 72 jamonWriter.write("
Latency (s)"); // 190, 17 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getRuntime() == null ? "Not finished" : queryInfo.getRuntime()/1000), jamonWriter); // 190, 100 jamonWriter.write("
\n"); } // 381, 1 private void __jamon_innerUnit__operationLog(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final QueryInfo queryInfo) throws java.io.IOException { // 385, 1 jamonWriter.write("
\n
 ");
    // 386, 12
    org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(OperationLogManager.getOperationLog(queryInfo)), jamonWriter);
    // 386, 64
    jamonWriter.write("
\n
\n"); } // 195, 1 private void __jamon_innerUnit__stages(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final QueryInfo queryInfo) throws java.io.IOException { // 199, 4 jamonWriter.write("\n \n \n \n \n \n \n \n \n\n "); // 209, 8 if (queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getTaskDisplays() != null ) { // 209, 108 jamonWriter.write("\n "); // 210, 12 for (QueryDisplay.TaskDisplay taskDisplay : queryInfo.getQueryDisplay().getTaskDisplays() ) { // 210, 105 jamonWriter.write("\n \n \n \n \n \n \n \n \n "); } // 219, 19 jamonWriter.write("\n "); } // 220, 14 jamonWriter.write("\n
Stage IdStatusBegin TimeEnd TimeElapsed Time (s)Requires Lock
"); // 212, 24 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(taskDisplay.getTaskId() + ":" + taskDisplay.getTaskType()), jamonWriter); // 212, 87 jamonWriter.write(""); // 213, 24 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(taskDisplay.getStatus()), jamonWriter); // 213, 53 jamonWriter.write(""); // 214, 24 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(taskDisplay.getBeginTime() == null ? "" : new Date(taskDisplay.getBeginTime())), jamonWriter); // 214, 108 jamonWriter.write(""); // 215, 24 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(taskDisplay.getEndTime() == null ? "" : new Date(taskDisplay.getEndTime())), jamonWriter); // 215, 104 jamonWriter.write(""); // 216, 24 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(taskDisplay.getElapsedTime() == null ? "" : taskDisplay.getElapsedTime()/1000), jamonWriter); // 216, 107 jamonWriter.write(" (s) "); // 217, 24 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(taskDisplay.isRequireLock()), jamonWriter); // 217, 57 jamonWriter.write("
\n"); } // 225, 1 private void __jamon_innerUnit__queryPlan(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final QueryInfo queryInfo) throws java.io.IOException { // 229, 5 jamonWriter.write("
\n
Explain plan
\n
\n "); // 232, 9 if (showGraph ) { // 232, 26 jamonWriter.write("\n "); // 233, 11 if (queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getExplainPlan() != null && !queryInfo.getQueryDisplay().getExplainPlan().equals("UNKNOWN")) { // 235, 82 jamonWriter.write("\n
\n "); // 237, 13 if (showStats ) { // 237, 30 jamonWriter.write("\n
\n
\n
\n                
\n
\n
\n
\n
\n "); } // 246, 13 else { // 246, 20 jamonWriter.write("\n
\n            ");
        }
        // 248, 19
        jamonWriter.write("\n            \n          ");
      }
      // 271, 11
      else
      {
        // 271, 18
        jamonWriter.write("\n            
Query information not available. Query may have failed or plan size may exceed value of config hive.server2.webui.max.graph.size.
\n "); } // 273, 17 jamonWriter.write("\n "); } // 274, 9 else { // 274, 16 jamonWriter.write("\n "); // 275, 11 if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT) ) { // 275, 91 jamonWriter.write("\n
\n            ");
        // 277, 13
        org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getExplainPlan()), jamonWriter);
        // 277, 113
        jamonWriter.write("\n            
\n "); } // 279, 11 else { // 279, 18 jamonWriter.write("\n
\n            Set configuration hive.server2.webui.explain.output to true to view future query plans\n            
\n "); } // 283, 17 jamonWriter.write("\n "); } // 284, 15 jamonWriter.write("\n
\n
\n"); } // 300, 1 private void __jamon_innerUnit__perfLogging(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter, final QueryInfo queryInfo) throws java.io.IOException { // 304, 5 jamonWriter.write("
\n

Compile-time metadata operations

\n \n \n \n \n \n\n "); // 312, 11 if (queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.COMPILATION) != null ) { // 312, 139 jamonWriter.write("\n "); // 313, 14 for (Map.Entry time : queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.COMPILATION).entrySet() ) { // 313, 138 jamonWriter.write("\n \n \n \n \n "); } // 318, 21 jamonWriter.write("\n "); } // 319, 16 jamonWriter.write("\n
Call NameTime (ms)
"); // 315, 26 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(time.getKey()), jamonWriter); // 315, 45 jamonWriter.write(""); // 316, 26 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(time.getValue()), jamonWriter); // 316, 47 jamonWriter.write("
\n
\n\n
\n

Execution-time metadata operations

\n \n \n \n \n \n\n "); // 331, 11 if (queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.EXECUTION) != null ) { // 331, 137 jamonWriter.write("\n "); // 332, 14 for (Map.Entry time : queryInfo.getQueryDisplay().getHmsTimings(QueryDisplay.Phase.EXECUTION).entrySet() ) { // 332, 136 jamonWriter.write("\n \n \n \n \n "); } // 337, 21 jamonWriter.write("\n "); } // 338, 16 jamonWriter.write("\n
Call NameTime (ms)
"); // 334, 26 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(time.getKey()), jamonWriter); // 334, 45 jamonWriter.write(""); // 335, 26 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(time.getValue()), jamonWriter); // 335, 47 jamonWriter.write("
\n
\n\n
\n

Compile-Time Perf-Logger

\n \n \n \n \n \n\n "); // 350, 11 if (queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.COMPILATION) != null ) { // 350, 141 jamonWriter.write("\n "); // 351, 14 for (Map.Entry time : queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.COMPILATION).entrySet() ) { // 351, 141 jamonWriter.write("\n \n \n \n \n "); } // 356, 21 jamonWriter.write("\n "); } // 357, 16 jamonWriter.write("\n
Compile-time Call NameTime (ms)
"); // 353, 26 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(time.getKey()), jamonWriter); // 353, 45 jamonWriter.write(""); // 354, 26 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(time.getValue()), jamonWriter); // 354, 47 jamonWriter.write("
\n
\n\n
\n

Execution-Time Perf-Logger

\n \n \n \n \n \n\n "); // 369, 11 if (queryInfo.getQueryDisplay() != null && queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.EXECUTION) != null ) { // 369, 139 jamonWriter.write("\n "); // 370, 14 for (Map.Entry time : queryInfo.getQueryDisplay().getPerfLogTimes(QueryDisplay.Phase.EXECUTION).entrySet() ) { // 370, 139 jamonWriter.write("\n \n \n \n \n "); } // 375, 21 jamonWriter.write("\n "); } // 376, 16 jamonWriter.write("\n
Execution-time Call NameTime (ms)
"); // 372, 26 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(time.getKey()), jamonWriter); // 372, 45 jamonWriter.write(""); // 373, 26 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(time.getValue()), jamonWriter); // 373, 47 jamonWriter.write("
\n
\n"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy