public class org.apache.hive.http.ProfileServlet extends javax.servlet.http.HttpServlet
{
private static final long serialVersionUID;
private static final org.slf4j.Logger LOG;
private static final java.lang.String ACCESS_CONTROL_ALLOW_METHODS;
private static final java.lang.String ALLOWED_METHODS;
private static final java.lang.String ACCESS_CONTROL_ALLOW_ORIGIN;
private static final java.lang.String CONTENT_TYPE_TEXT;
private static final java.lang.String ASYNC_PROFILER_HOME_ENV;
private static final java.lang.String ASYNC_PROFILER_HOME_SYSTEM_PROPERTY;
private static final int DEFAULT_DURATION_SECONDS;
private static final java.util.concurrent.atomic.AtomicInteger ID_GEN;
static final java.lang.String OUTPUT_DIR;
private java.util.concurrent.locks.Lock profilerLock;
private java.lang.Integer pid;
private java.lang.String asyncProfilerHome;
private transient java.lang.Process process;
public void <init>()
{
org.slf4j.Logger v;
java.util.concurrent.locks.ReentrantLock v;
org.apache.hive.http.ProfileServlet v;
java.lang.String v, v;
java.lang.Integer v, v;
v := @this: org.apache.hive.http.ProfileServlet;
specialinvoke v.<javax.servlet.http.HttpServlet: void <init>()>();
v = new java.util.concurrent.locks.ReentrantLock;
specialinvoke v.<java.util.concurrent.locks.ReentrantLock: void <init>()>();
v.<org.apache.hive.http.ProfileServlet: java.util.concurrent.locks.Lock profilerLock> = v;
v = staticinvoke <org.apache.hive.http.ProfileServlet: java.lang.String getAsyncProfilerHome()>();
v.<org.apache.hive.http.ProfileServlet: java.lang.String asyncProfilerHome> = v;
v = staticinvoke <org.apache.hive.common.util.ProcessUtils: java.lang.Integer getPid()>();
v.<org.apache.hive.http.ProfileServlet: java.lang.Integer pid> = v;
v = <org.apache.hive.http.ProfileServlet: org.slf4j.Logger LOG>;
v = v.<org.apache.hive.http.ProfileServlet: java.lang.Integer pid>;
v = v.<org.apache.hive.http.ProfileServlet: java.lang.String asyncProfilerHome>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("Servlet process PID: {} asyncProfilerHome: {}", v, v);
return;
}
protected void doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) throws java.io.IOException
{
java.lang.Integer v, v, v, v, v, v, v, v, v, v, v, v, v;
java.lang.Long v, v;
java.util.Map v, v, v;
java.io.PrintWriter v, v, v, v, v, v, v, v;
org.apache.hive.http.ProfileServlet v;
com.google.common.base.Joiner v;
java.lang.Throwable v;
java.lang.Double v;
java.util.ArrayList v;
javax.servlet.http.HttpServletRequest v;
org.apache.hive.http.ProfileServlet$Output v;
org.apache.hive.http.ProfileServlet$Event v;
java.lang.String v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
java.io.File v;
java.util.concurrent.locks.Lock v, v, v;
javax.servlet.ServletContext v;
java.util.concurrent.atomic.AtomicInteger v;
boolean v, v, v, v, v, v, v;
java.lang.Process v, v, v;
int v, v, v, v;
org.slf4j.Logger v, v;
javax.servlet.http.HttpServletResponse v;
java.util.concurrent.TimeUnit v;
java.lang.InterruptedException v;
v := @this: org.apache.hive.http.ProfileServlet;
v := @parameter: javax.servlet.http.HttpServletRequest;
v := @parameter: javax.servlet.http.HttpServletResponse;
v = virtualinvoke v.<org.apache.hive.http.ProfileServlet: javax.servlet.ServletContext getServletContext()>();
v = staticinvoke <org.apache.hive.http.HttpServer: boolean isInstrumentationAccessAllowed(javax.servlet.ServletContext,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)>(v, v, v);
if v != 0 goto label;
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setStatus(int)>(401);
specialinvoke v.<org.apache.hive.http.ProfileServlet: void setResponseHeader(javax.servlet.http.HttpServletResponse)>(v);
v = interfaceinvoke v.<javax.servlet.http.HttpServletResponse: java.io.PrintWriter getWriter()>();
virtualinvoke v.<java.io.PrintWriter: void write(java.lang.String)>("Unauthorized: Instrumentation access is not allowed!");
return;
label:
v = v.<org.apache.hive.http.ProfileServlet: java.lang.String asyncProfilerHome>;
if v == null goto label;
v = v.<org.apache.hive.http.ProfileServlet: java.lang.String asyncProfilerHome>;
v = virtualinvoke v.<java.lang.String: java.lang.String trim()>();
v = virtualinvoke v.<java.lang.String: boolean isEmpty()>();
if v == 0 goto label;
label:
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setStatus(int)>(500);
specialinvoke v.<org.apache.hive.http.ProfileServlet: void setResponseHeader(javax.servlet.http.HttpServletResponse)>(v);
v = interfaceinvoke v.<javax.servlet.http.HttpServletResponse: java.io.PrintWriter getWriter()>();
virtualinvoke v.<java.io.PrintWriter: void write(java.lang.String)>("ASYNC_PROFILER_HOME env is not set.");
return;
label:
v = v.<org.apache.hive.http.ProfileServlet: java.lang.Integer pid>;
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Integer getInteger(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.Integer)>(v, "pid", v);
v.<org.apache.hive.http.ProfileServlet: java.lang.Integer pid> = v;
v = v.<org.apache.hive.http.ProfileServlet: java.lang.Integer pid>;
if v != null goto label;
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setStatus(int)>(500);
specialinvoke v.<org.apache.hive.http.ProfileServlet: void setResponseHeader(javax.servlet.http.HttpServletResponse)>(v);
v = interfaceinvoke v.<javax.servlet.http.HttpServletResponse: java.io.PrintWriter getWriter()>();
virtualinvoke v.<java.io.PrintWriter: void write(java.lang.String)>("\'pid\' query parameter unspecified or unable to determine PID of current process.");
return;
label:
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(10);
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Integer getInteger(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.Integer)>(v, "duration", v);
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: org.apache.hive.http.ProfileServlet$Output getOutput(javax.servlet.http.HttpServletRequest)>(v);
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: org.apache.hive.http.ProfileServlet$Event getEvent(javax.servlet.http.HttpServletRequest)>(v);
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Long getLong(javax.servlet.http.HttpServletRequest,java.lang.String)>(v, "interval");
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Integer getInteger(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.Integer)>(v, "jstackdepth", null);
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Long getLong(javax.servlet.http.HttpServletRequest,java.lang.String)>(v, "bufsize");
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.util.Map getParameterMap()>();
v = interfaceinvoke v.<java.util.Map: boolean containsKey(java.lang.Object)>("thread");
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.util.Map getParameterMap()>();
v = interfaceinvoke v.<java.util.Map: boolean containsKey(java.lang.Object)>("simple");
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Integer getInteger(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.Integer)>(v, "width", null);
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Integer getInteger(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.Integer)>(v, "height", null);
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Double getMinWidth(javax.servlet.http.HttpServletRequest)>(v);
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.util.Map getParameterMap()>();
v = interfaceinvoke v.<java.util.Map: boolean containsKey(java.lang.Object)>("reverse");
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>("method");
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>("event");
if v == null goto label;
if v == null goto label;
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setStatus(int)>(400);
specialinvoke v.<org.apache.hive.http.ProfileServlet: void setResponseHeader(javax.servlet.http.HttpServletResponse)>(v);
v = interfaceinvoke v.<javax.servlet.http.HttpServletResponse: java.io.PrintWriter getWriter()>();
virtualinvoke v.<java.io.PrintWriter: void write(java.lang.String)>("Event and method aren\'t allowed to be both used in the same request.");
return;
label:
v = v.<org.apache.hive.http.ProfileServlet: java.lang.Process process>;
if v == null goto label;
v = v.<org.apache.hive.http.ProfileServlet: java.lang.Process process>;
v = virtualinvoke v.<java.lang.Process: boolean isAlive()>();
if v != 0 goto label;
label:
v = v.<org.apache.hive.http.ProfileServlet: java.util.concurrent.locks.Lock profilerLock>;
v = <java.util.concurrent.TimeUnit: java.util.concurrent.TimeUnit SECONDS>;
v = interfaceinvoke v.<java.util.concurrent.locks.Lock: boolean tryLock(long,java.util.concurrent.TimeUnit)>(3, v);
if v == 0 goto label;
label:
v = new java.io.File;
v = <org.apache.hive.http.ProfileServlet: java.lang.String OUTPUT_DIR>;
v = v.<org.apache.hive.http.ProfileServlet: java.lang.Integer pid>;
if v != null goto label;
v = virtualinvoke v.<org.apache.hive.http.ProfileServlet$Event: java.lang.String name()>();
v = virtualinvoke v.<java.lang.String: java.lang.String toLowerCase()>();
goto label;
label:
v = v;
label:
v = <org.apache.hive.http.ProfileServlet: java.util.concurrent.atomic.AtomicInteger ID_GEN>;
v = virtualinvoke v.<java.util.concurrent.atomic.AtomicInteger: int incrementAndGet()>();
v = virtualinvoke v.<org.apache.hive.http.ProfileServlet$Output: java.lang.String name()>();
v = virtualinvoke v.<java.lang.String: java.lang.String toLowerCase()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.Integer,java.lang.String,int,java.lang.String)>(v, v, v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("async-prof-pid-\u0001-\u0001-\u.\u0001");
specialinvoke v.<java.io.File: void <init>(java.lang.String,java.lang.String)>(v, v);
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.String getProfilerScriptPath()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-e");
if v != null goto label;
v = virtualinvoke v.<org.apache.hive.http.ProfileServlet$Event: java.lang.String getInternalName()>();
goto label;
label:
v = v;
label:
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-d");
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u0001");
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-o");
v = virtualinvoke v.<org.apache.hive.http.ProfileServlet$Output: java.lang.String name()>();
v = virtualinvoke v.<java.lang.String: java.lang.String toLowerCase()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-f");
v = virtualinvoke v.<java.io.File: java.lang.String getAbsolutePath()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
if v == null goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-i");
v = virtualinvoke v.<java.lang.Long: java.lang.String toString()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
label:
if v == null goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-j");
v = virtualinvoke v.<java.lang.Integer: java.lang.String toString()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
label:
if v == null goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-b");
v = virtualinvoke v.<java.lang.Long: java.lang.String toString()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
label:
if v == 0 goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-t");
label:
if v == 0 goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("-s");
label:
if v == null goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("--width");
v = virtualinvoke v.<java.lang.Integer: java.lang.String toString()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
label:
if v == null goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("--height");
v = virtualinvoke v.<java.lang.Integer: java.lang.String toString()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
label:
if v == null goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("--minwidth");
v = virtualinvoke v.<java.lang.Double: java.lang.String toString()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
label:
if v == 0 goto label;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>("--reverse");
label:
v = v.<org.apache.hive.http.ProfileServlet: java.lang.Integer pid>;
v = virtualinvoke v.<java.lang.Integer: java.lang.String toString()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
v = staticinvoke <org.apache.hive.common.util.ProcessUtils: java.lang.Process runCmdAsync(java.util.List)>(v);
v.<org.apache.hive.http.ProfileServlet: java.lang.Process process> = v;
specialinvoke v.<org.apache.hive.http.ProfileServlet: void setResponseHeader(javax.servlet.http.HttpServletResponse)>(v);
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setStatus(int)>(202);
v = virtualinvoke v.<java.io.File: java.lang.String getName()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("/prof-output/\u0001");
v = interfaceinvoke v.<javax.servlet.http.HttpServletResponse: java.io.PrintWriter getWriter()>();
v = virtualinvoke v.<org.apache.hive.http.ProfileServlet$Event: java.lang.String getInternalName()>();
v = staticinvoke <com.google.common.base.Joiner: com.google.common.base.Joiner on(java.lang.String)>(" ");
v = virtualinvoke v.<com.google.common.base.Joiner: java.lang.String join(java.lang.Iterable)>(v);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String,java.lang.String,int,java.lang.String)>(v, v, v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Started [\u] profiling. This page will automatically redirect to \u after \u seconds.\n\ncommand:\n\u0001");
virtualinvoke v.<java.io.PrintWriter: void write(java.lang.String)>(v);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(0);
v = specialinvoke v.<org.apache.hive.http.ProfileServlet: java.lang.Integer getInteger(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.Integer)>(v, "refreshDelay", v);
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
v = v + v;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int,java.lang.String)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u;\u0001");
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setHeader(java.lang.String,java.lang.String)>("Refresh", v);
v = interfaceinvoke v.<javax.servlet.http.HttpServletResponse: java.io.PrintWriter getWriter()>();
virtualinvoke v.<java.io.PrintWriter: void flush()>();
label:
v = v.<org.apache.hive.http.ProfileServlet: java.util.concurrent.locks.Lock profilerLock>;
interfaceinvoke v.<java.util.concurrent.locks.Lock: void unlock()>();
goto label;
label:
v := @caughtexception;
v = v.<org.apache.hive.http.ProfileServlet: java.util.concurrent.locks.Lock profilerLock>;
interfaceinvoke v.<java.util.concurrent.locks.Lock: void unlock()>();
throw v;
label:
specialinvoke v.<org.apache.hive.http.ProfileServlet: void setResponseHeader(javax.servlet.http.HttpServletResponse)>(v);
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setStatus(int)>(500);
v = interfaceinvoke v.<javax.servlet.http.HttpServletResponse: java.io.PrintWriter getWriter()>();
virtualinvoke v.<java.io.PrintWriter: void write(java.lang.String)>("Unable to acquire lock. Another instance of profiler might be running.");
v = <org.apache.hive.http.ProfileServlet: org.slf4j.Logger LOG>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(3);
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Object)>("Unable to acquire lock in {} seconds. Another instance of profiler might be running.", v);
label:
goto label;
label:
v := @caughtexception;
v = <org.apache.hive.http.ProfileServlet: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Throwable)>("Interrupted while acquiring profile lock.", v);
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setStatus(int)>(500);
goto label;
label:
specialinvoke v.<org.apache.hive.http.ProfileServlet: void setResponseHeader(javax.servlet.http.HttpServletResponse)>(v);
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setStatus(int)>(500);
v = interfaceinvoke v.<javax.servlet.http.HttpServletResponse: java.io.PrintWriter getWriter()>();
virtualinvoke v.<java.io.PrintWriter: void write(java.lang.String)>("Another instance of profiler is already running.");
label:
return;
catch java.lang.Throwable from label to label with label;
catch java.lang.InterruptedException from label to label with label;
}
private java.lang.String getProfilerScriptPath()
{
java.nio.file.LinkOption[] v;
java.lang.String[] v;
org.apache.hive.http.ProfileServlet v;
java.lang.String v, v, v, v;
java.nio.file.Path v;
boolean v;
v := @this: org.apache.hive.http.ProfileServlet;
v = v.<org.apache.hive.http.ProfileServlet: java.lang.String asyncProfilerHome>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u0001/bin/asprof");
v = newarray (java.lang.String)[0];
v = staticinvoke <java.nio.file.Paths: java.nio.file.Path get(java.lang.String,java.lang.String[])>(v, v);
v = newarray (java.nio.file.LinkOption)[0];
v = staticinvoke <java.nio.file.Files: boolean exists(java.nio.file.Path,java.nio.file.LinkOption[])>(v, v);
if v == 0 goto label;
v = interfaceinvoke v.<java.nio.file.Path: java.lang.String toString()>();
goto label;
label:
v = v.<org.apache.hive.http.ProfileServlet: java.lang.String asyncProfilerHome>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u0001/profiler.sh");
label:
return v;
}
private java.lang.Integer getInteger(javax.servlet.http.HttpServletRequest, java.lang.String, java.lang.Integer)
{
javax.servlet.http.HttpServletRequest v;
java.lang.NumberFormatException v;
org.apache.hive.http.ProfileServlet v;
java.lang.String v, v;
java.lang.Integer v, v;
v := @this: org.apache.hive.http.ProfileServlet;
v := @parameter: javax.servlet.http.HttpServletRequest;
v := @parameter: java.lang.String;
v := @parameter: java.lang.Integer;
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>(v);
if v == null goto label;
label:
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(java.lang.String)>(v);
label:
return v;
label:
v := @caughtexception;
return v;
label:
return v;
catch java.lang.NumberFormatException from label to label with label;
}
private java.lang.Long getLong(javax.servlet.http.HttpServletRequest, java.lang.String)
{
javax.servlet.http.HttpServletRequest v;
java.lang.Long v;
java.lang.NumberFormatException v;
org.apache.hive.http.ProfileServlet v;
java.lang.String v, v;
v := @this: org.apache.hive.http.ProfileServlet;
v := @parameter: javax.servlet.http.HttpServletRequest;
v := @parameter: java.lang.String;
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>(v);
if v == null goto label;
label:
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(java.lang.String)>(v);
label:
return v;
label:
v := @caughtexception;
return null;
label:
return null;
catch java.lang.NumberFormatException from label to label with label;
}
private java.lang.Double getMinWidth(javax.servlet.http.HttpServletRequest)
{
javax.servlet.http.HttpServletRequest v;
java.lang.Double v;
java.lang.NumberFormatException v;
org.apache.hive.http.ProfileServlet v;
java.lang.String v;
v := @this: org.apache.hive.http.ProfileServlet;
v := @parameter: javax.servlet.http.HttpServletRequest;
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>("minwidth");
if v == null goto label;
label:
v = staticinvoke <java.lang.Double: java.lang.Double valueOf(java.lang.String)>(v);
label:
return v;
label:
v := @caughtexception;
return null;
label:
return null;
catch java.lang.NumberFormatException from label to label with label;
}
private org.apache.hive.http.ProfileServlet$Event getEvent(javax.servlet.http.HttpServletRequest)
{
javax.servlet.http.HttpServletRequest v;
org.apache.hive.http.ProfileServlet v;
org.apache.hive.http.ProfileServlet$Event v, v, v;
java.lang.String v;
v := @this: org.apache.hive.http.ProfileServlet;
v := @parameter: javax.servlet.http.HttpServletRequest;
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>("event");
if v == null goto label;
v = staticinvoke <org.apache.hive.http.ProfileServlet$Event: org.apache.hive.http.ProfileServlet$Event fromInternalName(java.lang.String)>(v);
if v != null goto label;
v = <org.apache.hive.http.ProfileServlet$Event: org.apache.hive.http.ProfileServlet$Event CPU>;
goto label;
label:
v = v;
label:
return v;
label:
v = <org.apache.hive.http.ProfileServlet$Event: org.apache.hive.http.ProfileServlet$Event CPU>;
return v;
}
private org.apache.hive.http.ProfileServlet$Output getOutput(javax.servlet.http.HttpServletRequest)
{
org.slf4j.Logger v;
java.lang.IllegalArgumentException v;
javax.servlet.http.HttpServletRequest v;
org.apache.hive.http.ProfileServlet$Output v, v, v;
org.apache.hive.http.ProfileServlet v;
java.lang.String v, v, v, v;
v := @this: org.apache.hive.http.ProfileServlet;
v := @parameter: javax.servlet.http.HttpServletRequest;
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>("output");
v = virtualinvoke v.<java.lang.String: java.lang.String trim()>();
v = virtualinvoke v.<java.lang.String: java.lang.String toUpperCase()>();
v = interfaceinvoke v.<javax.servlet.http.HttpServletRequest: java.lang.String getParameter(java.lang.String)>("output");
if v == null goto label;
label:
v = staticinvoke <org.apache.hive.http.ProfileServlet$Output: org.apache.hive.http.ProfileServlet$Output valueOf(java.lang.String)>(v);
label:
return v;
label:
v := @caughtexception;
v = <org.apache.hive.http.ProfileServlet: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Object)>("Output format value \'{}\' is invalid, returning with default HTML", v);
v = <org.apache.hive.http.ProfileServlet$Output: org.apache.hive.http.ProfileServlet$Output HTML>;
return v;
label:
v = <org.apache.hive.http.ProfileServlet$Output: org.apache.hive.http.ProfileServlet$Output HTML>;
return v;
catch java.lang.IllegalArgumentException from label to label with label;
}
private void setResponseHeader(javax.servlet.http.HttpServletResponse)
{
javax.servlet.http.HttpServletResponse v;
org.apache.hive.http.ProfileServlet v;
v := @this: org.apache.hive.http.ProfileServlet;
v := @parameter: javax.servlet.http.HttpServletResponse;
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setHeader(java.lang.String,java.lang.String)>("Access-Control-Allow-Methods", "GET");
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setHeader(java.lang.String,java.lang.String)>("Access-Control-Allow-Origin", "*");
interfaceinvoke v.<javax.servlet.http.HttpServletResponse: void setContentType(java.lang.String)>("text/plain; charset=utf-8");
return;
}
static java.lang.String getAsyncProfilerHome()
{
java.lang.String v, v;
boolean v;
v = staticinvoke <java.lang.System: java.lang.String getenv(java.lang.String)>("ASYNC_PROFILER_HOME");
if v == null goto label;
v = virtualinvoke v.<java.lang.String: java.lang.String trim()>();
v = virtualinvoke v.<java.lang.String: boolean isEmpty()>();
if v == 0 goto label;
label:
v = staticinvoke <java.lang.System: java.lang.String getProperty(java.lang.String)>("async.profiler.home");
label:
return v;
}
static void <clinit>()
{
org.slf4j.Logger v;
java.util.concurrent.atomic.AtomicInteger v;
java.lang.String v, v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lorg/apache/hive/http/ProfileServlet;");
<org.apache.hive.http.ProfileServlet: org.slf4j.Logger LOG> = v;
v = new java.util.concurrent.atomic.AtomicInteger;
specialinvoke v.<java.util.concurrent.atomic.AtomicInteger: void <init>(int)>(0);
<org.apache.hive.http.ProfileServlet: java.util.concurrent.atomic.AtomicInteger ID_GEN> = v;
v = staticinvoke <java.lang.System: java.lang.String getProperty(java.lang.String)>("java.io.tmpdir");
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u0001/prof-output");
<org.apache.hive.http.ProfileServlet: java.lang.String OUTPUT_DIR> = v;
return;
}
}