This is an automated email from the ASF dual-hosted git repository. binlijin pushed a commit to branch branch-2.3 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.3 by this push: new b4f613d HBASE-24377 MemStoreFlusher throw NullPointerException (#1721) b4f613d is described below commit b4f613d1af7366e2a050db960c7c4f2abddb79a6 Author: binlijin <binli...@gmail.com> AuthorDate: Mon May 18 09:58:28 2020 +0800 HBASE-24377 MemStoreFlusher throw NullPointerException (#1721) Signed-off-by: Ramkrishna <ramkris...@apache.org> Signed-off-by: Anoop Sam John <anoop.hb...@gmail.com> Signed-off-by: Duo Zhang <zhang...@apache.org> --- .../apache/hadoop/hbase/regionserver/MemStoreFlusher.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java index fcff217..b0f6315 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java @@ -86,8 +86,6 @@ class MemStoreFlusher implements FlushRequester { private final FlushHandler[] flushHandlers; private List<FlushRequestListener> flushRequestListeners = new ArrayList<>(1); - private FlushType flushType; - /** * Singleton instance inserted into flush queue used for signaling. */ @@ -148,17 +146,13 @@ class MemStoreFlusher implements FlushRequester { return this.updatesBlockedMsHighWater; } - public void setFlushType(FlushType flushType) { - this.flushType = flushType; - } - /** * The memstore across all regions has exceeded the low water mark. Pick * one region to flush and flush it synchronously (this is called from the * flush thread) * @return true if successful */ - private boolean flushOneForGlobalPressure() { + private boolean flushOneForGlobalPressure(FlushType flushType) { SortedMap<Long, HRegion> regionsBySize = null; switch(flushType) { case ABOVE_OFFHEAP_HIGHER_MARK: @@ -348,7 +342,7 @@ class MemStoreFlusher implements FlushRequester { // we still select the regions based on the region's memstore data size. // TODO : If we want to decide based on heap over head it can be done without tracking // it per region. - if (!flushOneForGlobalPressure()) { + if (!flushOneForGlobalPressure(type)) { // Wasn't able to flush any region, but we're above low water mark // This is unlikely to happen, but might happen when closing the // entire server - another thread is flushing regions. We'll just @@ -711,7 +705,6 @@ class MemStoreFlusher implements FlushRequester { try { flushType = isAboveHighWaterMark(); while (flushType != FlushType.NORMAL && !server.isStopped()) { - server.getMemStoreFlusher().setFlushType(flushType); if (!blocked) { startTime = EnvironmentEdgeManager.currentTime(); if (!server.getRegionServerAccounting().isOffheap()) { @@ -769,7 +762,6 @@ class MemStoreFlusher implements FlushRequester { } else { flushType = isAboveLowWaterMark(); if (flushType != FlushType.NORMAL) { - server.getMemStoreFlusher().setFlushType(flushType); wakeupFlushThread(); } }