Skip to content

Commit 8a43178

Browse files
bbeaudreaultapurtell
authored andcommitted
HBASE-26814 Default StoreHotnessProtector to off, with logs to guide when to turn it on (#4194)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
1 parent 91cb302 commit 8a43178

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle/StoreHotnessProtector.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.apache.hadoop.hbase.util.Bytes;
3030
import org.apache.hadoop.hbase.util.ClassSize;
3131
import org.apache.yetus.audience.InterfaceAudience;
32-
3332
import org.slf4j.Logger;
3433
import org.slf4j.LoggerFactory;
3534

@@ -62,14 +61,18 @@
6261
@InterfaceAudience.Private
6362
public class StoreHotnessProtector {
6463
private static final Logger LOG = LoggerFactory.getLogger(StoreHotnessProtector.class);
64+
65+
// We want to log just once so that users are aware of this tool
66+
private static volatile boolean loggedDisableMessage;
67+
6568
private volatile int parallelPutToStoreThreadLimit;
6669

6770
private volatile int parallelPreparePutToStoreThreadLimit;
6871
public final static String PARALLEL_PUT_STORE_THREADS_LIMIT =
6972
"hbase.region.store.parallel.put.limit";
7073
public final static String PARALLEL_PREPARE_PUT_STORE_MULTIPLIER =
7174
"hbase.region.store.parallel.prepare.put.multiplier";
72-
private final static int DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT = 10;
75+
private final static int DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT = 0;
7376
private volatile int parallelPutToStoreThreadLimitCheckMinColumnCount;
7477
public final static String PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT =
7578
"hbase.region.store.parallel.put.limit.min.column.count";
@@ -94,6 +97,13 @@ public void init(Configuration conf) {
9497
conf.getInt(PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT,
9598
DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_NUM);
9699

100+
if (!isEnable() && !loggedDisableMessage) {
101+
loggedDisableMessage = true;
102+
103+
LOG.info("StoreHotnessProtector is disabled. Set {} > 0 to enable, "
104+
+ "which may help mitigate load under heavy write pressure.",
105+
PARALLEL_PUT_STORE_THREADS_LIMIT);
106+
}
97107
}
98108

99109
public void update(Configuration conf) {

0 commit comments

Comments
 (0)