@InterfaceAudience.Private public class MemorySizeUtil 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.slf4j.Logger | 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 | 
| static String | OFFHEAP_MEMSTORE_SIZE_KEY | 
| Constructor and Description | 
|---|
| MemorySizeUtil() | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | checkForClusterFreeHeapMemoryLimit(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 | getGlobalMemStoreHeapLowerMark(org.apache.hadoop.conf.Configuration conf,
                              boolean honorOldConfig)Retrieve configured size for global memstore lower water mark as fraction of global memstore
 size. | 
| static float | getGlobalMemStoreHeapPercent(org.apache.hadoop.conf.Configuration c,
                            boolean logInvalid)Retrieve global memstore configured size as percentage of total heap. | 
| static Pair<Long,MemoryType> | getGlobalMemStoreSize(org.apache.hadoop.conf.Configuration conf) | 
| static long | getOnHeapCacheSize(org.apache.hadoop.conf.Configuration conf) | 
| static long | getOnheapGlobalMemStoreSize(org.apache.hadoop.conf.Configuration conf)Returns the onheap global memstore limit based on the config
 'hbase.regionserver.global.memstore.size'. | 
| 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 String OFFHEAP_MEMSTORE_SIZE_KEY
public static final float DEFAULT_MEMSTORE_SIZE
public static final float DEFAULT_MEMSTORE_SIZE_LOWER_LIMIT
private static final org.slf4j.Logger LOG
private static final int CONVERT_TO_PERCENTAGE
private static final String JVM_HEAP_EXCEPTION
public MemorySizeUtil()
public static MemoryUsage safeGetHeapMemoryUsage()
MemoryUsagepublic static void checkForClusterFreeHeapMemoryLimit(org.apache.hadoop.conf.Configuration conf)
conf - public static float getGlobalMemStoreHeapPercent(org.apache.hadoop.conf.Configuration c, boolean logInvalid)
c - logInvalid - public static float getGlobalMemStoreHeapLowerMark(org.apache.hadoop.conf.Configuration conf, boolean honorOldConfig)
public static Pair<Long,MemoryType> getGlobalMemStoreSize(org.apache.hadoop.conf.Configuration conf)
public static long getOnheapGlobalMemStoreSize(org.apache.hadoop.conf.Configuration conf)
conf - public static float getBlockCacheHeapPercent(org.apache.hadoop.conf.Configuration conf)
conf - public static long getOnHeapCacheSize(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–2021 The Apache Software Foundation. All rights reserved.