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

org.apache.hive.generated.hiveserver2.hiveserver2_jsp Maven / Gradle / Ivy

package org.apache.hive.generated.hiveserver2;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
import org.apache.hive.common.util.HiveVersionInfo;
import org.apache.hive.service.cli.operation.Operation;
import org.apache.hive.service.cli.operation.SQLOperation;
import org.apache.hive.service.cli.operation.SQLOperationDisplay;
import org.apache.hive.service.cli.session.SessionManager;
import org.apache.hive.service.cli.session.HiveSession;
import javax.servlet.ServletContext;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import jodd.util.HtmlEncoder;

public final class hiveserver2_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.Vector _jspx_dependants;

  private org.apache.jasper.runtime.ResourceInjector _jspx_resourceInjector;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;
      _jspx_resourceInjector = (org.apache.jasper.runtime.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write("\n\n\n");

ServletContext ctx = getServletContext();
Configuration conf = (Configuration)ctx.getAttribute("hive.conf");
long startcode = conf.getLong("startcode", System.currentTimeMillis());
SessionManager sessionManager =
  (SessionManager)ctx.getAttribute("hive.sm");

      out.write("\n\n\n\n\n  \n    \n    HiveServer2\n    \n    \n\n    \n    \n    \n  \n\n  \n  
\n
\n
\n \n \"Hive\n
\n"); out.write(" \n
\n
\n
\n\n
\n
\n
\n

HiveServer2

\n
\n
\n
\n\n"); if (sessionManager != null) { long currentTime = System.currentTimeMillis(); out.write(" \n\n
\n

Active Sessions

\n\n \n \n \n \n \n \n \n"); Collection hiveSessions = sessionManager.getSessions(); for (HiveSession hiveSession: hiveSessions) { out.write("\n \n \n \n \n \n \n \n"); } out.write("\n\n \n\n
User NameIP AddressOperation CountActive Time (s)Idle Time (s)
"); out.print( hiveSession.getUserName() ); out.write(""); out.print( hiveSession.getIpAddress() ); out.write(""); out.print( hiveSession.getOpenOperationCount() ); out.write(""); out.print( (currentTime - hiveSession.getCreationTime())/1000 ); out.write(""); out.print( (currentTime - hiveSession.getLastAccessTime())/1000 ); out.write("
Total number of sessions: "); out.print( hiveSessions.size() ); out.write("
\n
\n\n
\n

Open Queries

\n\n \n \n \n \n \n \n \n \n \n \n "); int queries = 0; Collection operations = sessionManager.getOperationManager().getLiveSqlOperations(); for (SQLOperationDisplay operation : operations) { queries++; out.write("\n \n \n \n \n \n \n \n "); String link = "/query_page?operationId=" + operation.getOperationId(); out.write("\n \n \n\n"); } out.write("\n\n \n\n
User NameQueryExecution EngineStateOpened TimestampOpened (s)Latency (s)Drilldown Link
"); out.print( operation.getUserName() ); out.write(""); out.print( HtmlEncoder.strict(operation.getQueryDisplay() == null ? "Unknown" : operation.getQueryDisplay().getQueryString()) ); out.write(""); out.print( operation.getExecutionEngine() ); out.write("\n "); out.print( operation.getState() ); out.write(""); out.print( new Date(operation.getBeginTime()) ); out.write(""); out.print( operation.getElapsedTime()/1000 ); out.write(""); out.print( operation.getRuntime() == null ? "Not finished" : operation.getRuntime()/1000 ); out.write(" Drilldown
Total number of queries: "); out.print( queries ); out.write("
\n
\n\n\n
\n

Last Max "); out.print( conf.get(ConfVars.HIVE_SERVER2_WEBUI_MAX_HISTORIC_QUERIES.varname) ); out.write(" Closed Queries

\n\n \n \n \n \n \n \n \n \n \n \n "); queries = 0; operations = sessionManager.getOperationManager().getHistoricalSQLOperations(); for (SQLOperationDisplay operation : operations) { queries++; out.write("\n \n \n \n \n \n \n \n "); String link = "/query_page?operationId=" + operation.getOperationId(); out.write("\n \n \n\n"); } out.write("\n\n \n\n
User NameQueryExecution EngineStateOpened (s)Closed TimestampLatency (s)Drilldown Link
"); out.print( operation.getUserName() ); out.write(""); out.print( HtmlEncoder.strict(operation.getQueryDisplay() == null ? "Unknown" : operation.getQueryDisplay().getQueryString()) ); out.write(""); out.print( operation.getExecutionEngine() ); out.write("\n "); out.print( operation.getState() ); out.write(""); out.print( operation.getElapsedTime()/1000 ); out.write(""); out.print( operation.getEndTime() == null ? "In Progress" : new Date(operation.getEndTime()) ); out.write(""); out.print( operation.getRuntime()/1000 ); out.write(" Drilldown
Total number of queries: "); out.print( queries ); out.write("
\n
\n\n"); } out.write("\n\n
\n

Software Attributes

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Attribute NameValueDescription
Hive Version"); out.print( HiveVersionInfo.getVersion() ); out.write(", r"); out.print( HiveVersionInfo.getRevision() ); out.write("Hive version and revision
Hive Compiled"); out.print( HiveVersionInfo.getDate() ); out.write(','); out.write(' '); out.print( HiveVersionInfo.getUser() ); out.write("When Hive was compiled and by whom
HiveServer2 Start Time"); out.print( new Date(startcode) ); out.write("Date stamp of when this HiveServer2 was started
\n
\n
\n
\n\n\n"); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy