HBASE-8282-User triggered flushes does not allow compaction to get triggered even if compaction criteria is met (Ram)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1484519 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ramkrishna 2013-05-20 16:35:55 +00:00
parent 39e7e66ae9
commit 190aac3613
2 changed files with 7 additions and 2 deletions

View File

@ -1298,7 +1298,7 @@ public class HRegion implements HeapSize { // , Writable{
* <p>This method may block for some time, so it should not be called from a * <p>This method may block for some time, so it should not be called from a
* time-sensitive thread. * time-sensitive thread.
* *
* @return true if cache was flushed * @return true if the region needs compacting
* *
* @throws IOException general io exceptions * @throws IOException general io exceptions
* @throws DroppedSnapshotException Thrown when replay of hlog is required * @throws DroppedSnapshotException Thrown when replay of hlog is required

View File

@ -3607,7 +3607,12 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
} }
FlushRegionResponse.Builder builder = FlushRegionResponse.newBuilder(); FlushRegionResponse.Builder builder = FlushRegionResponse.newBuilder();
if (shouldFlush) { if (shouldFlush) {
builder.setFlushed(region.flushcache()); boolean result = region.flushcache();
if (result) {
this.compactSplitThread.requestCompaction(region,
"Compaction through user triggered flush");
}
builder.setFlushed(result);
} }
builder.setLastFlushTime(region.getLastFlushTime()); builder.setLastFlushTime(region.getLastFlushTime());
return builder.build(); return builder.build();