public static long getBlockCacheSizeInBytes(Configuration conf) {
    final String key = HConstants.HFILE_BLOCK_CACHE_MEMORY_SIZE_KEY;
    try {
      return Long.parseLong(conf.get(key));
    } catch (NumberFormatException e) {
      return (long) conf.getStorageSize(key, -1, StorageUnit.BYTES);
    }
  }
Retrieve an explicit block cache size in bytes in the configuration.
@param conf used to read cache configs
@return the number of bytes to use for LRU, negative if disabled.
@throws IllegalArgumentException if HFILE_BLOCK_CACHE_MEMORY_SIZE_KEY format is invalid
hbase-server/src/main/java/org/apache/hadoop/hbase/io/util/MemorySizeUtil.java