From 0aafa3ef8f388e8e78cf98528dfa470d4cbde707 Mon Sep 17 00:00:00 2001 From: Jean-Daniel Cryans Date: Fri, 6 Mar 2009 18:26:00 +0000 Subject: [PATCH] HBASE-1238 Under upload, region servers are unable to compact when loaded with hundreds of regions This is a hack, compactions may run prematurely. git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@751023 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ .../apache/hadoop/hbase/regionserver/MemcacheFlusher.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 342db2775ac..e6b5f0912d0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -35,6 +35,8 @@ Release 0.20.0 - Unreleased buffer each iteration-1185 wrong request/sec in the gui reporting wrong (Brian Beggs via Stack) HBASE-1245 hfile meta block handling bugs (Ryan Rawson via Stack) + HBASE-1238 Under upload, region servers are unable + to compact when loaded with hundreds of regions IMPROVEMENTS HBASE-1089 Add count of regions on filesystem to master UI; add percentage diff --git a/src/java/org/apache/hadoop/hbase/regionserver/MemcacheFlusher.java b/src/java/org/apache/hadoop/hbase/regionserver/MemcacheFlusher.java index 4e3db9b34b1..424654ee1e8 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/MemcacheFlusher.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/MemcacheFlusher.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; import java.lang.management.ManagementFactory; +import java.util.ArrayList; import java.util.ConcurrentModificationException; import java.util.HashSet; import java.util.SortedMap; @@ -268,6 +269,7 @@ class MemcacheFlusher extends Thread implements FlushRequester { private synchronized void flushSomeRegions() { // keep flushing until we hit the low water mark long globalMemcacheSize = -1; + ArrayList regionsToCompact = new ArrayList(); for (SortedMap m = this.server.getCopyOfOnlineRegionsSortedBySize(); (globalMemcacheSize = server.getGlobalMemcacheSize()) >= @@ -292,6 +294,10 @@ class MemcacheFlusher extends Thread implements FlushRequester { LOG.warn("Flush failed"); break; } + regionsToCompact.add(biggestMemcacheRegion); + } + for (HRegion region : regionsToCompact) { + server.compactSplitThread.compactionRequested(region, getName()); } } }