HBASE-1892 [performance] make hbase splits run faster
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@934285 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
27d8d69932
commit
b9aeb3e125
|
@ -506,6 +506,7 @@ Release 0.21.0 - Unreleased
|
|||
HBASE-2440 Master UI should check against known bad JDK versions and
|
||||
warn the user (Todd Lipcon via Stack)
|
||||
HBASE-2430 Disable frag display in trunk, let HBASE-2165 replace it
|
||||
HBASE-1892 [performance] make hbase splits run faster
|
||||
|
||||
NEW FEATURES
|
||||
HBASE-1961 HBase EC2 scripts
|
||||
|
|
|
@ -468,13 +468,14 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
|
|||
LOG.warn("region " + this + " already closed");
|
||||
return null;
|
||||
}
|
||||
this.closing.set(true);
|
||||
synchronized (splitLock) {
|
||||
boolean wasFlushing = false;
|
||||
synchronized (writestate) {
|
||||
// Disable compacting and flushing by background threads for this
|
||||
// region.
|
||||
writestate.writesEnabled = false;
|
||||
LOG.debug("Closing " + this + ": compactions & flushes disabled ");
|
||||
wasFlushing = writestate.flushing;
|
||||
LOG.debug("Closing " + this + ": disabling compactions & flushes");
|
||||
while (writestate.compacting || writestate.flushing) {
|
||||
LOG.debug("waiting for" +
|
||||
(writestate.compacting ? " compaction" : "") +
|
||||
|
@ -488,7 +489,15 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
|
|||
}
|
||||
}
|
||||
}
|
||||
// If we were not just flushing, is it worth doing a preflush...one
|
||||
// that will clear out of the bulk of the memstore before we put up
|
||||
// the close flag?
|
||||
if (!abort && !wasFlushing && worthPreFlushing()) {
|
||||
LOG.info("Running close preflush of " + this.getRegionNameAsString());
|
||||
internalFlushcache();
|
||||
}
|
||||
newScannerLock.writeLock().lock();
|
||||
this.closing.set(true);
|
||||
try {
|
||||
splitsAndClosesLock.writeLock().lock();
|
||||
LOG.debug("Updates disabled for region, no outstanding scanners on " +
|
||||
|
@ -521,6 +530,14 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if its worth doing a flush before we put up the close flag.
|
||||
*/
|
||||
private boolean worthPreFlushing() {
|
||||
return this.memstoreSize.get() >
|
||||
this.conf.getLong("hbase.hregion.preclose.flush.size", 1024 * 1024 * 5);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// HRegion accessors
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -312,6 +312,21 @@
|
|||
every hbase.server.thread.wakefrequency.
|
||||
</description>
|
||||
</property>
|
||||
<property>
|
||||
<name>hbase.hregion.preclose.flush.size</name>
|
||||
<value>5242880</value>
|
||||
<description>
|
||||
If the memstores in a region are this size or larger when we go
|
||||
to close, run a "pre-flush" to clear out memstores before we put up
|
||||
the region closed flag and take the region offline. On close,
|
||||
a flush is run under the close flag up to empty memory. During
|
||||
this time the region is offline and we are not taking on any writes.
|
||||
If the memstore content large, this flush could take a long time to
|
||||
complete. The preflush is meant to clean out the bulk of the memstore
|
||||
before putting up the close flag and taking the region offline so the
|
||||
flush that runs under the close flag has little to do.
|
||||
</description>
|
||||
</property>
|
||||
<property>
|
||||
<name>hbase.hregion.memstore.block.multiplier</name>
|
||||
<value>2</value>
|
||||
|
|
Loading…
Reference in New Issue