HBASE-2054 memstore size 0 is >= than blocking -2.0g size

HBASE-2057  Cluster won't stop


git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@892392 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2009-12-18 22:47:03 +00:00
parent 21bd10825a
commit 91fa2ad048
4 changed files with 18 additions and 12 deletions

View File

@ -133,6 +133,8 @@ Release 0.21.0 - Unreleased
HBASE-2044 HBASE-1822 removed not-deprecated APIs
HBASE-1960 Master should wait for DFS to come up when creating
hbase.version
HBASE-2054 memstore size 0 is >= than blocking -2.0g size
HBASE-2057 Cluster won't stop
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -91,9 +91,9 @@ public class HTableDescriptor implements WritableComparable<HTableDescriptor> {
public static final boolean DEFAULT_READONLY = false;
public static final int DEFAULT_MEMSTORE_FLUSH_SIZE = 1024*1024*64;
public static final long DEFAULT_MEMSTORE_FLUSH_SIZE = 1024*1024*64L;
public static final int DEFAULT_MAX_FILESIZE = 1024*1024*256;
public static final long DEFAULT_MAX_FILESIZE = 1024*1024*256L;
public static final boolean DEFAULT_DEFERRED_LOG_FLUSH = true;
@ -421,7 +421,7 @@ public class HTableDescriptor implements WritableComparable<HTableDescriptor> {
/**
* @return memory cache flush size for each hregion
*/
public int getMemStoreFlushSize() {
public long getMemStoreFlushSize() {
byte [] value = getValue(MEMSTORE_FLUSHSIZE_KEY);
if (value != null)
return Integer.valueOf(Bytes.toString(value)).intValue();

View File

@ -182,10 +182,10 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
private volatile WriteState writestate = new WriteState();
final int memstoreFlushSize;
final long memstoreFlushSize;
private volatile long lastFlushTime;
final FlushRequester flushListener;
private final int blockingMemStoreSize;
private final long blockingMemStoreSize;
final long threadWakeFrequency;
// Used to guard splits and closes
private final ReentrantReadWriteLock splitsAndClosesLock =
@ -216,11 +216,11 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
*/
public HRegion(){
this.basedir = null;
this.blockingMemStoreSize = 0;
this.blockingMemStoreSize = 0L;
this.conf = null;
this.flushListener = null;
this.fs = null;
this.memstoreFlushSize = 0;
this.memstoreFlushSize = 0L;
this.log = null;
this.regionCompactionDir = null;
this.regiondir = null;
@ -267,14 +267,14 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
}
this.regionCompactionDir =
new Path(getCompactionDir(basedir), encodedNameStr);
int flushSize = regionInfo.getTableDesc().getMemStoreFlushSize();
long flushSize = regionInfo.getTableDesc().getMemStoreFlushSize();
if (flushSize == HTableDescriptor.DEFAULT_MEMSTORE_FLUSH_SIZE) {
flushSize = conf.getInt("hbase.hregion.memstore.flush.size",
flushSize = conf.getLong("hbase.hregion.memstore.flush.size",
HTableDescriptor.DEFAULT_MEMSTORE_FLUSH_SIZE);
}
this.memstoreFlushSize = flushSize;
this.blockingMemStoreSize = this.memstoreFlushSize *
conf.getInt("hbase.hregion.memstore.block.multiplier", 1);
conf.getLong("hbase.hregion.memstore.block.multiplier", 2);
}
/**
@ -2398,7 +2398,7 @@ public class HRegion implements HConstants, HeapSize { // , Writable{
}
public static final long FIXED_OVERHEAD = ClassSize.align(
(3 * Bytes.SIZEOF_LONG) + (2 * Bytes.SIZEOF_INT) + Bytes.SIZEOF_BOOLEAN +
(5 * Bytes.SIZEOF_LONG) + Bytes.SIZEOF_BOOLEAN +
(19 * ClassSize.REFERENCE) + ClassSize.OBJECT);
public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD +

View File

@ -340,7 +340,11 @@ public class ZooKeeperWrapper implements HConstants {
} catch (InterruptedException e) {
LOG.warn("Failed to set state node in ZooKeeper", e);
} catch (KeeperException e) {
LOG.warn("Failed to set state node in ZooKeeper", e);
if(e.code() == KeeperException.Code.NODEEXISTS) {
LOG.debug("State node exists.");
} else {
LOG.warn("Failed to set state node in ZooKeeper", e);
}
}
return false;