@InterfaceAudience.Private public class HeapMemorySizeUtil extends Object
Modifier and Type | Field and Description |
---|---|
private static int |
CONVERT_TO_PERCENTAGE |
static float |
DEFAULT_MEMSTORE_SIZE |
static float |
DEFAULT_MEMSTORE_SIZE_LOWER_LIMIT |
private static String |
JVM_HEAP_EXCEPTION |
private static org.apache.commons.logging.Log |
LOG |
static String |
MEMSTORE_SIZE_KEY |
static String |
MEMSTORE_SIZE_LOWER_LIMIT_KEY |
static String |
MEMSTORE_SIZE_LOWER_LIMIT_OLD_KEY |
static String |
MEMSTORE_SIZE_OLD_KEY |
Constructor and Description |
---|
HeapMemorySizeUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkForClusterFreeMemoryLimit(org.apache.hadoop.conf.Configuration conf)
Checks whether we have enough heap memory left out after portion for Memstore and Block cache.
|
static float |
getBlockCacheHeapPercent(org.apache.hadoop.conf.Configuration conf)
Retrieve configured size for on heap block cache as percentage of total heap.
|
static long |
getBucketCacheSize(org.apache.hadoop.conf.Configuration conf) |
static float |
getGlobalMemStoreLowerMark(org.apache.hadoop.conf.Configuration conf,
float globalMemStorePercent)
Retrieve configured size for global memstore lower water mark as fraction of global memstore
size.
|
static float |
getGlobalMemStorePercent(org.apache.hadoop.conf.Configuration c,
boolean logInvalid)
Retrieve global memstore configured size as percentage of total heap.
|
static float |
getL2BlockCacheHeapPercent(org.apache.hadoop.conf.Configuration conf) |
static long |
getLruCacheSize(org.apache.hadoop.conf.Configuration conf) |
static MemoryUsage |
safeGetHeapMemoryUsage()
Return JVM memory statistics while properly handling runtime exceptions from the JVM.
|
public static final String MEMSTORE_SIZE_KEY
public static final String MEMSTORE_SIZE_OLD_KEY
public static final String MEMSTORE_SIZE_LOWER_LIMIT_KEY
public static final String MEMSTORE_SIZE_LOWER_LIMIT_OLD_KEY
public static final float DEFAULT_MEMSTORE_SIZE
public static final float DEFAULT_MEMSTORE_SIZE_LOWER_LIMIT
private static final org.apache.commons.logging.Log LOG
private static final int CONVERT_TO_PERCENTAGE
private static final String JVM_HEAP_EXCEPTION
public static MemoryUsage safeGetHeapMemoryUsage()
MemoryUsage
public static void checkForClusterFreeMemoryLimit(org.apache.hadoop.conf.Configuration conf)
conf
- public static float getGlobalMemStorePercent(org.apache.hadoop.conf.Configuration c, boolean logInvalid)
c
- logInvalid
- public static float getGlobalMemStoreLowerMark(org.apache.hadoop.conf.Configuration conf, float globalMemStorePercent)
public static float getBlockCacheHeapPercent(org.apache.hadoop.conf.Configuration conf)
conf
- public static float getL2BlockCacheHeapPercent(org.apache.hadoop.conf.Configuration conf)
conf
- public static long getLruCacheSize(org.apache.hadoop.conf.Configuration conf)
conf
- used to read cache configsIllegalArgumentException
- if HFILE_BLOCK_CACHE_SIZE_KEY is > 1.0public static long getBucketCacheSize(org.apache.hadoop.conf.Configuration conf)
conf
- used to read config for bucket cache size. (< 1 is treated as % and > is treated as MiB)Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.