File tree Expand file tree Collapse file tree
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/throttle Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6262public class StoreHotnessProtector {
6363 private static final Logger LOG = LoggerFactory .getLogger (StoreHotnessProtector .class );
6464
65- // We want to log just once so that users are aware of this tool
6665 private static volatile boolean loggedDisableMessage ;
6766
6867 private volatile int parallelPutToStoreThreadLimit ;
@@ -97,12 +96,23 @@ public void init(Configuration conf) {
9796 conf .getInt (PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_COUNT ,
9897 DEFAULT_PARALLEL_PUT_STORE_THREADS_LIMIT_MIN_COLUMN_NUM );
9998
100- if (!isEnable () && !loggedDisableMessage ) {
101- loggedDisableMessage = true ;
99+ if (!isEnable ()) {
100+ logDisabledMessageOnce ();
101+ }
102+ }
102103
104+ /**
105+ * {@link #init(Configuration)} is called for every Store that opens on a RegionServer.
106+ * Here we make a lightweight attempt to log this message once per RegionServer, rather than
107+ * per-Store. The goal is just to draw attention to this feature if debugging overload due to
108+ * heavy writes.
109+ */
110+ private static void logDisabledMessageOnce () {
111+ if (!loggedDisableMessage ) {
103112 LOG .info ("StoreHotnessProtector is disabled. Set {} > 0 to enable, "
104113 + "which may help mitigate load under heavy write pressure." ,
105114 PARALLEL_PUT_STORE_THREADS_LIMIT );
115+ loggedDisableMessage = true ;
106116 }
107117 }
108118
You can’t perform that action at this time.
0 commit comments