public class org.apache.hadoop.hive.common.HeapMemoryMonitor extends java.lang.Object
{
private static final org.slf4j.Logger LOG;
private static final double DEFAULT_THRESHOLD;
private static final java.lang.management.MemoryPoolMXBean tenuredGenPool;
private final double threshold;
private java.util.List listeners;
private javax.management.NotificationListener notificationListener;
public void <init>(double)
{
byte v, v;
java.lang.management.MemoryPoolMXBean v;
double v, v;
java.util.ArrayList v;
org.apache.hadoop.hive.common.HeapMemoryMonitor v;
v := @this: org.apache.hadoop.hive.common.HeapMemoryMonitor;
v := @parameter: double;
specialinvoke v.<java.lang.Object: void <init>()>();
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: java.util.List listeners> = v;
v = v cmpg 0.0;
if v <= 0 goto label;
v = v cmpl 1.0;
if v <= 0 goto label;
label:
v = 0.7;
goto label;
label:
v = v;
label:
v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: double threshold> = v;
v = <org.apache.hadoop.hive.common.HeapMemoryMonitor: java.lang.management.MemoryPoolMXBean tenuredGenPool>;
specialinvoke v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: void setupTenuredGenPoolThreshold(java.lang.management.MemoryPoolMXBean)>(v);
return;
}
private void setupTenuredGenPoolThreshold(java.lang.management.MemoryPoolMXBean)
{
long v;
java.lang.management.MemoryPoolMXBean v;
java.lang.Long v, v;
int v;
java.lang.management.MemoryUsage v;
boolean v, v, v, v;
double v, v;
org.apache.hadoop.hive.common.HeapMemoryMonitor v;
org.slf4j.Logger v, v;
java.util.Iterator v;
java.util.List v;
java.lang.Object v;
v := @this: org.apache.hadoop.hive.common.HeapMemoryMonitor;
v := @parameter: java.lang.management.MemoryPoolMXBean;
if v != null goto label;
return;
label:
v = staticinvoke <java.lang.management.ManagementFactory: java.util.List getMemoryPoolMXBeans()>();
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: java.lang.management.MemoryUsage getUsage()>();
v = virtualinvoke v.<java.lang.management.MemoryUsage: long getMax()>();
v = v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: double threshold>;
v = v * v;
staticinvoke <java.lang.Math: double floor(double)>(v);
v = staticinvoke <org.apache.hadoop.hive.common.HeapMemoryMonitor: boolean isTenured(java.lang.management.MemoryPoolMXBean)>(v);
if v == 0 goto label;
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: boolean isCollectionUsageThresholdSupported()>();
if v == 0 goto label;
v = <org.apache.hadoop.hive.common.HeapMemoryMonitor: org.slf4j.Logger LOG>;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("Setting collection usage threshold to {}", v);
interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: void setCollectionUsageThreshold(long)>(v);
return;
label:
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: boolean isUsageThresholdSupported()>();
if v == 0 goto label;
v = <org.apache.hadoop.hive.common.HeapMemoryMonitor: org.slf4j.Logger LOG>;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("Setting usage threshold to {}", v);
interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: void setUsageThreshold(long)>(v);
return;
label:
return;
}
private static java.lang.management.MemoryPoolMXBean getTenuredGenPool()
{
org.slf4j.Logger v;
java.util.Iterator v;
java.util.List v;
java.lang.Object v;
java.lang.String v, v;
boolean v, v, v, v;
v = staticinvoke <java.lang.management.ManagementFactory: java.util.List getMemoryPoolMXBeans()>();
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = staticinvoke <java.lang.System: java.lang.String getProperty(java.lang.String)>("java.vendor");
v = staticinvoke <org.apache.hadoop.hive.common.HeapMemoryMonitor: boolean isTenured(java.lang.management.MemoryPoolMXBean)>(v);
if v == 0 goto label;
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: boolean isCollectionUsageThresholdSupported()>();
if v == 0 goto label;
return v;
label:
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: boolean isUsageThresholdSupported()>();
if v == 0 goto label;
return v;
label:
v = <org.apache.hadoop.hive.common.HeapMemoryMonitor: org.slf4j.Logger LOG>;
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: java.lang.String getName()>();
interfaceinvoke v.<org.slf4j.Logger: void error(java.lang.String,java.lang.Object,java.lang.Object)>("{} vendor does not support isCollectionUsageThresholdSupported() and isUsageThresholdSupported() for tenured memory pool \'{}\'.", v, v);
goto label;
label:
return null;
}
private static boolean isTenured(java.lang.management.MemoryPoolMXBean)
{
java.lang.management.MemoryType v, v;
java.lang.management.MemoryPoolMXBean v;
java.lang.String v;
boolean v, v, v, v, v, v, v, v;
v := @parameter: java.lang.management.MemoryPoolMXBean;
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: java.lang.management.MemoryType getType()>();
v = <java.lang.management.MemoryType: java.lang.management.MemoryType HEAP>;
if v == v goto label;
return 0;
label:
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: java.lang.String getName()>();
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("CMS Old Gen");
if v != 0 goto label;
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("PS Old Gen");
if v != 0 goto label;
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("G1 Old Gen");
if v != 0 goto label;
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("Old Space");
if v != 0 goto label;
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("Tenured Gen");
if v != 0 goto label;
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("Java heap");
if v != 0 goto label;
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("GenPauseless Old Gen");
if v == 0 goto label;
label:
v = 1;
goto label;
label:
v = 0;
label:
return v;
}
public void registerListener(org.apache.hadoop.hive.common.HeapMemoryMonitor$Listener)
{
java.util.List v;
org.apache.hadoop.hive.common.HeapMemoryMonitor$Listener v;
org.apache.hadoop.hive.common.HeapMemoryMonitor v;
v := @this: org.apache.hadoop.hive.common.HeapMemoryMonitor;
v := @parameter: org.apache.hadoop.hive.common.HeapMemoryMonitor$Listener;
v = v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: java.util.List listeners>;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
return;
}
public java.lang.management.MemoryUsage getTenuredGenMemoryUsage()
{
java.lang.management.MemoryPoolMXBean v, v;
java.lang.management.MemoryUsage v;
org.apache.hadoop.hive.common.HeapMemoryMonitor v;
v := @this: org.apache.hadoop.hive.common.HeapMemoryMonitor;
v = <org.apache.hadoop.hive.common.HeapMemoryMonitor: java.lang.management.MemoryPoolMXBean tenuredGenPool>;
if v != null goto label;
return null;
label:
v = <org.apache.hadoop.hive.common.HeapMemoryMonitor: java.lang.management.MemoryPoolMXBean tenuredGenPool>;
v = interfaceinvoke v.<java.lang.management.MemoryPoolMXBean: java.lang.management.MemoryUsage getUsage()>();
return v;
}
public void start()
{
java.lang.management.MemoryMXBean v;
javax.management.NotificationListener v, v;
java.lang.management.MemoryPoolMXBean v;
org.apache.hadoop.hive.common.HeapMemoryMonitor v;
v := @this: org.apache.hadoop.hive.common.HeapMemoryMonitor;
v = <org.apache.hadoop.hive.common.HeapMemoryMonitor: java.lang.management.MemoryPoolMXBean tenuredGenPool>;
if v != null goto label;
return;
label:
v = staticinvoke <java.lang.management.ManagementFactory: java.lang.management.MemoryMXBean getMemoryMXBean()>();
v = staticinvoke <org.apache.hadoop.hive.common.HeapMemoryMonitor$lambda_start_0__3: javax.management.NotificationListener bootstrap$(org.apache.hadoop.hive.common.HeapMemoryMonitor)>(v);
v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: javax.management.NotificationListener notificationListener> = v;
v = v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: javax.management.NotificationListener notificationListener>;
interfaceinvoke v.<javax.management.NotificationEmitter: void addNotificationListener(javax.management.NotificationListener,javax.management.NotificationFilter,java.lang.Object)>(v, null, null);
return;
}
public void close()
{
java.lang.management.MemoryMXBean v;
javax.management.NotificationListener v, v;
org.slf4j.Logger v;
javax.management.ListenerNotFoundException v;
org.apache.hadoop.hive.common.HeapMemoryMonitor v;
v := @this: org.apache.hadoop.hive.common.HeapMemoryMonitor;
v = v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: javax.management.NotificationListener notificationListener>;
if v == null goto label;
v = staticinvoke <java.lang.management.ManagementFactory: java.lang.management.MemoryMXBean getMemoryMXBean()>();
label:
v = v.<org.apache.hadoop.hive.common.HeapMemoryMonitor: javax.management.NotificationListener notificationListener>;
interfaceinvoke v.<javax.management.NotificationEmitter: void removeNotificationListener(javax.management.NotificationListener)>(v);
label:
goto label;
label:
v := @caughtexception;
v = <org.apache.hadoop.hive.common.HeapMemoryMonitor: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Throwable)>("Failed to remove HeapMemoryMonitor notification listener from MemoryMXBean", v);
label:
return;
catch javax.management.ListenerNotFoundException from label to label with label;
}
static void <clinit>()
{
org.slf4j.Logger v;
java.lang.management.MemoryPoolMXBean v;
java.lang.Class v;
java.lang.String v;
v = class "Lorg/apache/hadoop/hive/common/HeapMemoryMonitor;";
v = virtualinvoke v.<java.lang.Class: java.lang.String getName()>();
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.String)>(v);
<org.apache.hadoop.hive.common.HeapMemoryMonitor: org.slf4j.Logger LOG> = v;
v = staticinvoke <org.apache.hadoop.hive.common.HeapMemoryMonitor: java.lang.management.MemoryPoolMXBean getTenuredGenPool()>();
<org.apache.hadoop.hive.common.HeapMemoryMonitor: java.lang.management.MemoryPoolMXBean tenuredGenPool> = v;
return;
}
}