HBASE-8161 setting blocking file count on table level doesn't work
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1460085 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9a528fbc17
commit
0b6546baed
|
@ -130,7 +130,7 @@ class DefaultStoreFileManager implements StoreFileManager {
|
|||
@Override
|
||||
public int getStoreCompactionPriority() {
|
||||
int blockingFileCount = conf.getInt(
|
||||
"hbase.hstore.blockingStoreFiles", HStore.DEFAULT_BLOCKING_STOREFILE_COUNT);
|
||||
HStore.BLOCKING_STOREFILES_KEY, HStore.DEFAULT_BLOCKING_STOREFILE_COUNT);
|
||||
return blockingFileCount - storefiles.size();
|
||||
}
|
||||
|
||||
|
|
|
@ -105,6 +105,7 @@ import com.google.common.collect.Lists;
|
|||
*/
|
||||
@InterfaceAudience.Private
|
||||
public class HStore implements Store {
|
||||
public static final String BLOCKING_STOREFILES_KEY = "hbase.hstore.blockingStoreFiles";
|
||||
public static final int DEFAULT_BLOCKING_STOREFILE_COUNT = 7;
|
||||
|
||||
static final Log LOG = LogFactory.getLog(HStore.class);
|
||||
|
@ -152,6 +153,8 @@ public class HStore implements Store {
|
|||
private static int flush_retries_number;
|
||||
private static int pauseTime;
|
||||
|
||||
private long blockingFileCount;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region
|
||||
|
@ -203,6 +206,9 @@ public class HStore implements Store {
|
|||
|
||||
this.verifyBulkLoads = conf.getBoolean("hbase.hstore.bulkload.verify", false);
|
||||
|
||||
this.blockingFileCount =
|
||||
conf.getInt(BLOCKING_STOREFILES_KEY, DEFAULT_BLOCKING_STOREFILE_COUNT);
|
||||
|
||||
if (HStore.closeCheckInterval == 0) {
|
||||
HStore.closeCheckInterval = conf.getInt(
|
||||
"hbase.hstore.close.check.interval", 10*1000*1000 /* 10 MB */);
|
||||
|
@ -1787,7 +1793,7 @@ public class HStore implements Store {
|
|||
}
|
||||
|
||||
public static final long FIXED_OVERHEAD =
|
||||
ClassSize.align((17 * ClassSize.REFERENCE) + (4 * Bytes.SIZEOF_LONG)
|
||||
ClassSize.align((17 * ClassSize.REFERENCE) + (5 * Bytes.SIZEOF_LONG)
|
||||
+ (2 * Bytes.SIZEOF_INT) + Bytes.SIZEOF_BOOLEAN);
|
||||
|
||||
public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD
|
||||
|
@ -1817,4 +1823,9 @@ public class HStore implements Store {
|
|||
void setScanInfo(ScanInfo scanInfo) {
|
||||
this.scanInfo = scanInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTooManyStoreFiles() {
|
||||
return getStorefilesCount() > this.blockingFileCount;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,6 @@ class MemStoreFlusher implements FlushRequester {
|
|||
"hbase.regionserver.global.memstore.upperLimit";
|
||||
private static final String LOWER_KEY =
|
||||
"hbase.regionserver.global.memstore.lowerLimit";
|
||||
private int blockingStoreFileCount;
|
||||
private long blockingWaitTime;
|
||||
private final Counter updatesBlockedMsHighWater = new Counter();
|
||||
|
||||
|
@ -111,8 +110,6 @@ class MemStoreFlusher implements FlushRequester {
|
|||
"because supplied " + LOWER_KEY + " was > " + UPPER_KEY);
|
||||
}
|
||||
this.globalMemStoreLimitLowMark = lower;
|
||||
this.blockingStoreFileCount =
|
||||
conf.getInt("hbase.hstore.blockingStoreFiles", HStore.DEFAULT_BLOCKING_STOREFILE_COUNT);
|
||||
this.blockingWaitTime = conf.getInt("hbase.hstore.blockingWaitTime",
|
||||
90000);
|
||||
int handlerCount = conf.getInt("hbase.hstore.flusher.count", 1);
|
||||
|
@ -480,8 +477,8 @@ class MemStoreFlusher implements FlushRequester {
|
|||
}
|
||||
|
||||
private boolean isTooManyStoreFiles(HRegion region) {
|
||||
for (Store hstore : region.stores.values()) {
|
||||
if (hstore.getStorefilesCount() > this.blockingStoreFileCount) {
|
||||
for (Store store : region.stores.values()) {
|
||||
if (store.hasTooManyStoreFiles()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -315,4 +315,9 @@ public interface Store extends HeapSize, StoreConfigInformation {
|
|||
* @param o Observer no longer interested in changes in set of Readers.
|
||||
*/
|
||||
public void deleteChangedReaderObserver(ChangedReadersObserver o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether this store has too many store files.
|
||||
*/
|
||||
public boolean hasTooManyStoreFiles();
|
||||
}
|
Loading…
Reference in New Issue