29
29
import org .apache .hadoop .hbase .util .Bytes ;
30
30
import org .apache .hadoop .hbase .util .ClassSize ;
31
31
import org .apache .yetus .audience .InterfaceAudience ;
32
-
33
32
import org .slf4j .Logger ;
34
33
import org .slf4j .LoggerFactory ;
35
34
62
61
@ InterfaceAudience .Private
63
62
public class StoreHotnessProtector {
64
63
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
+
65
68
private volatile int parallelPutToStoreThreadLimit ;
66
69
67
70
private volatile int parallelPreparePutToStoreThreadLimit ;
68
71
public final static String PARALLEL_PUT_STORE_THREADS_LIMIT =
69
72
"hbase.region.store.parallel.put.limit" ;
70
73
public final static String PARALLEL_PREPARE_PUT_STORE_MULTIPLIER =
71
74
"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 ;
73
76
private volatile int parallelPutToStoreThreadLimitCheckMinColumnCount ;
74
77
public final static String PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT =
75
78
"hbase.region.store.parallel.put.limit.min.column.count" ;
@@ -94,6 +97,13 @@ public void init(Configuration conf) {
94
97
conf .getInt (PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT ,
95
98
DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_NUM );
96
99
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
+ }
97
107
}
98
108
99
109
public void update (Configuration conf ) {
0 commit comments