frostruan commented on code in PR #5247:
URL: https://github.com/apache/hbase/pull/5247#discussion_r1202805790


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java:
##########
@@ -924,4 +947,62 @@ public boolean equals(Object obj) {
       return compareTo(other) == 0;
     }
   }
+
+  private int getHandlerCount(Configuration conf) {
+    int handlerCount = conf.getInt("hbase.hstore.flusher.count", 2);
+    if (handlerCount < 1) {
+      LOG.warn(
+        "hbase.hstore.flusher.count was configed to {} which is less than 1, " 
+ "corrected to 1",
+        handlerCount);
+      handlerCount = 1;
+    }
+    return handlerCount;
+  }
+
+  @Override
+  public void onConfigurationChange(Configuration newConf) {
+    int newHandlerCount = getHandlerCount(newConf);
+    if (newHandlerCount != flushHandlers.length) {
+      LOG.info("update hbase.hstore.flusher.count from {} to {}", 
flushHandlers.length,
+        newHandlerCount);
+      lock.writeLock().lock();
+      try {
+        FlushHandler[] newFlushHandlers = new FlushHandler[newHandlerCount];
+        if (newHandlerCount > flushHandlers.length) {
+          System.arraycopy(flushHandlers, 0, newFlushHandlers, 0, 
flushHandlers.length);

Review Comment:
   Thanks for your suggestion. Will address this in the next commit. Still 
working on fixing the UT.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to