@InterfaceAudience.Private public class CacheConfig extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BUCKET_CACHE_COMBINED_KEY |
static String |
BUCKET_CACHE_COMBINED_PERCENTAGE_KEY |
static String |
BUCKET_CACHE_IOENGINE_KEY
Configuration keys for Bucket cache
|
static String |
BUCKET_CACHE_PERSISTENT_PATH_KEY |
static String |
BUCKET_CACHE_SIZE_KEY |
static String |
BUCKET_CACHE_WRITER_QUEUE_KEY |
static String |
BUCKET_CACHE_WRITER_THREADS_KEY |
static String |
CACHE_BLOCKS_ON_WRITE_KEY
Configuration key to cache data blocks on write.
|
static String |
CACHE_BLOOM_BLOCKS_ON_WRITE_KEY
Configuration key to cache compound bloom filter blocks on write.
|
static String |
CACHE_DATA_BLOCKS_COMPRESSED_KEY
TODO: Implement this (jgray)
Configuration key to cache data blocks in compressed format.
|
static String |
CACHE_INDEX_BLOCKS_ON_WRITE_KEY
Configuration key to cache leaf and intermediate-level index blocks on
write.
|
static boolean |
DEFAULT_BUCKET_CACHE_COMBINED
Defaults for Bucket cache
|
static float |
DEFAULT_BUCKET_CACHE_COMBINED_PERCENTAGE |
static int |
DEFAULT_BUCKET_CACHE_WRITER_QUEUE |
static int |
DEFAULT_BUCKET_CACHE_WRITER_THREADS |
static boolean |
DEFAULT_CACHE_BLOOMS_ON_WRITE |
static boolean |
DEFAULT_CACHE_DATA_ON_READ |
static boolean |
DEFAULT_CACHE_DATA_ON_WRITE |
static boolean |
DEFAULT_CACHE_INDEXES_ON_WRITE |
static boolean |
DEFAULT_COMPRESSED_CACHE |
static boolean |
DEFAULT_EVICT_ON_CLOSE |
static boolean |
DEFAULT_IN_MEMORY |
static String |
EVICT_BLOCKS_ON_CLOSE_KEY
Configuration key to evict all blocks of a given file from the block cache
when the file is closed.
|
Constructor and Description |
---|
CacheConfig(CacheConfig cacheConf)
Constructs a cache configuration copied from the specified configuration.
|
CacheConfig(org.apache.hadoop.conf.Configuration conf)
Create a cache configuration using the specified configuration object and
defaults for family level settings.
|
CacheConfig(org.apache.hadoop.conf.Configuration conf,
HColumnDescriptor family)
Create a cache configuration using the specified configuration object and
family descriptor.
|
Modifier and Type | Method and Description |
---|---|
BlockCache |
getBlockCache()
Returns the block cache.
|
boolean |
isBlockCacheEnabled()
Checks whether the block cache is enabled.
|
boolean |
isInMemory() |
void |
setCacheDataOnWrite(boolean cacheDataOnWrite)
Only used for testing.
|
void |
setEvictOnClose(boolean evictOnClose)
Only used for testing.
|
boolean |
shouldCacheBlockOnRead(BlockType.BlockCategory category)
Should we cache a block of a particular category? We always cache
important blocks such as index blocks, as long as the block cache is
available.
|
boolean |
shouldCacheBloomsOnWrite() |
boolean |
shouldCacheCompressed() |
boolean |
shouldCacheDataOnRead()
Returns whether the blocks of this HFile should be cached on read or not.
|
boolean |
shouldCacheDataOnWrite() |
boolean |
shouldCacheIndexesOnWrite() |
boolean |
shouldEvictOnClose() |
String |
toString() |
public static final String CACHE_BLOCKS_ON_WRITE_KEY
public static final String CACHE_INDEX_BLOCKS_ON_WRITE_KEY
public static final String CACHE_BLOOM_BLOCKS_ON_WRITE_KEY
public static final String CACHE_DATA_BLOCKS_COMPRESSED_KEY
public static final String EVICT_BLOCKS_ON_CLOSE_KEY
public static final String BUCKET_CACHE_IOENGINE_KEY
public static final String BUCKET_CACHE_SIZE_KEY
public static final String BUCKET_CACHE_PERSISTENT_PATH_KEY
public static final String BUCKET_CACHE_COMBINED_KEY
public static final String BUCKET_CACHE_COMBINED_PERCENTAGE_KEY
public static final String BUCKET_CACHE_WRITER_THREADS_KEY
public static final String BUCKET_CACHE_WRITER_QUEUE_KEY
public static final boolean DEFAULT_BUCKET_CACHE_COMBINED
public static final int DEFAULT_BUCKET_CACHE_WRITER_THREADS
public static final int DEFAULT_BUCKET_CACHE_WRITER_QUEUE
public static final float DEFAULT_BUCKET_CACHE_COMBINED_PERCENTAGE
public static final boolean DEFAULT_CACHE_DATA_ON_READ
public static final boolean DEFAULT_CACHE_DATA_ON_WRITE
public static final boolean DEFAULT_IN_MEMORY
public static final boolean DEFAULT_CACHE_INDEXES_ON_WRITE
public static final boolean DEFAULT_CACHE_BLOOMS_ON_WRITE
public static final boolean DEFAULT_EVICT_ON_CLOSE
public static final boolean DEFAULT_COMPRESSED_CACHE
public CacheConfig(org.apache.hadoop.conf.Configuration conf, HColumnDescriptor family)
conf
- hbase configurationfamily
- column family configurationpublic CacheConfig(org.apache.hadoop.conf.Configuration conf)
conf
- hbase configurationpublic CacheConfig(CacheConfig cacheConf)
cacheConf
- public boolean isBlockCacheEnabled()
public BlockCache getBlockCache()
public boolean shouldCacheDataOnRead()
public boolean shouldCacheBlockOnRead(BlockType.BlockCategory category)
public boolean isInMemory()
public boolean shouldCacheDataOnWrite()
public void setCacheDataOnWrite(boolean cacheDataOnWrite)
cacheDataOnWrite
- whether data blocks should be written to the cache
when an HFile is writtenpublic boolean shouldCacheIndexesOnWrite()
public boolean shouldCacheBloomsOnWrite()
public boolean shouldEvictOnClose()
public void setEvictOnClose(boolean evictOnClose)
evictOnClose
- whether blocks should be evicted from the cache when an
HFile reader is closedpublic boolean shouldCacheCompressed()
Copyright © 2013 The Apache Software Foundation. All rights reserved.