@InterfaceAudience.Private public class StoreHotnessProtector extends Object
There are three key parameters:
1. parallelPutToStoreThreadLimitCheckMinColumnCount: If the amount of columns exceed this threshold, the HotProtector will work, 100 by default
2. parallelPutToStoreThreadLimit: The amount of concurrency allowed to write puts to a Store at the same time.
3. parallelPreparePutToStoreThreadLimit: The amount of concurrency allowed to prepare writing puts to a Store at the same time.
Notice that our writing pipeline includes three key process: MVCC acquire, writing MemStore, and WAL. Only limit the concurrency of writing puts to Store(parallelPutToStoreThreadLimit) is not enough since the actual concurrency of puts may still exceed the limit when MVCC contention or slow WAL sync happens. This is why parallelPreparePutToStoreThreadLimit is needed.
This protector is enabled by default and could be turned off by setting hbase.region.store.parallel.put.limit to 0, supporting online configuration change.
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_PARALLEL_PREPARE_PUT_STORE_MULTIPLIER |
private static int |
DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT |
private static int |
DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_NUM |
static long |
FIXED_SIZE |
private static org.slf4j.Logger |
LOG |
private static boolean |
loggedDisableMessage |
static String |
PARALLEL_PREPARE_PUT_STORE_MULTIPLIER |
static String |
PARALLEL_PUT_STORE_THREADS_LIMIT |
static String |
PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT |
private int |
parallelPreparePutToStoreThreadLimit |
private int |
parallelPutToStoreThreadLimit |
private int |
parallelPutToStoreThreadLimitCheckMinColumnCount |
private Map<byte[],AtomicInteger> |
preparePutToStoreMap |
private Region |
region |
Constructor and Description |
---|
StoreHotnessProtector(Region region,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
finish(Map<byte[],List<Cell>> familyMaps) |
(package private) Map<byte[],AtomicInteger> |
getPreparePutToStoreMap() |
void |
init(org.apache.hadoop.conf.Configuration conf) |
boolean |
isEnable() |
private static void |
logDisabledMessageOnce()
init(Configuration) is called for every Store that opens on a RegionServer. |
void |
start(Map<byte[],List<Cell>> familyMaps) |
String |
toString() |
void |
update(org.apache.hadoop.conf.Configuration conf) |
private static final org.slf4j.Logger LOG
private static volatile boolean loggedDisableMessage
private volatile int parallelPutToStoreThreadLimit
private volatile int parallelPreparePutToStoreThreadLimit
public static final String PARALLEL_PUT_STORE_THREADS_LIMIT
public static final String PARALLEL_PREPARE_PUT_STORE_MULTIPLIER
private static final int DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT
private volatile int parallelPutToStoreThreadLimitCheckMinColumnCount
public static final String PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT
private static final int DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_NUM
private static final int DEFAULT_PARALLEL_PREPARE_PUT_STORE_MULTIPLIER
private final Map<byte[],AtomicInteger> preparePutToStoreMap
public static final long FIXED_SIZE
public StoreHotnessProtector(Region region, org.apache.hadoop.conf.Configuration conf)
public void init(org.apache.hadoop.conf.Configuration conf)
private static void logDisabledMessageOnce()
init(Configuration)
is called for every Store that opens on a RegionServer. Here we
make a lightweight attempt to log this message once per RegionServer, rather than per-Store.
The goal is just to draw attention to this feature if debugging overload due to heavy writes.public void update(org.apache.hadoop.conf.Configuration conf)
public void start(Map<byte[],List<Cell>> familyMaps) throws RegionTooBusyException
RegionTooBusyException
public boolean isEnable()
Map<byte[],AtomicInteger> getPreparePutToStoreMap()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.