diff --git a/CHANGES.txt b/CHANGES.txt index df661492327..e957a8fccdc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -397,6 +397,8 @@ Release 0.20.0 - Unreleased row tables & performance HBASE-1577 Move memcache to ConcurrentSkipListMap from ConcurrentSkipListSet + HBASE-1578 Change the name of the in-memory updates from 'memcache' to + 'memtable' or.... OPTIMIZATIONS HBASE-1412 Change values for delete column and column family in KeyValue diff --git a/bin/HBase.rb b/bin/HBase.rb index f982a2ae8b2..f01eec954b2 100644 --- a/bin/HBase.rb +++ b/bin/HBase.rb @@ -217,9 +217,9 @@ module HBase htd.setMaxFileSize(HTableDescriptor::DEFAULT_MAX_FILESIZE); args[READONLY]? htd.setReadOnly(JBoolean.valueOf(args[READONLY])) : htd.setReadOnly(HTableDescriptor::DEFAULT_READONLY); - args[MEMCACHE_FLUSHSIZE]? - htd.setMemcacheFlushSize(JLong.valueOf(args[MEMCACHE_FLUSHSIZE])) : - htd.setMemcacheFlushSize(HTableDescriptor::DEFAULT_MEMCACHE_FLUSH_SIZE); + args[MEMSTORE_FLUSHSIZE]? + htd.setMemStoreFlushSize(JLong.valueOf(args[MEMSTORE_FLUSHSIZE])) : + htd.setMemStoreFlushSize(HTableDescriptor::DEFAULT_MEMSTORE_FLUSH_SIZE); @admin.modifyTable(tableName.to_java_bytes, htd) else descriptor = hcd(args) diff --git a/bin/hirb.rb b/bin/hirb.rb index 8b5736a34ac..9acfe984a9a 100644 --- a/bin/hirb.rb +++ b/bin/hirb.rb @@ -156,7 +156,7 @@ HBASE SHELL COMMANDS: hbase> alter 't1', {NAME => 'f1', METHOD => 'delete'} You can also change table-scope attributes like MAX_FILESIZE - MEMCACHE_FLUSHSIZE and READONLY. + MEMSTORE_FLUSHSIZE and READONLY. For example, to change the max size of a family to 128MB, do: hbase> alter 't1', {METHOD => 'table_att', MAX_FILESIZE => '134217728'} diff --git a/conf/hbase-default.xml b/conf/hbase-default.xml index c69ecd62026..0e2a70e7f91 100644 --- a/conf/hbase-default.xml +++ b/conf/hbase-default.xml @@ -230,20 +230,20 @@ - hbase.regionserver.globalMemcache.upperLimit + hbase.regionserver.global.memstore.upperLimit 0.4 - Maximum size of all memcaches in a region server before new - updates are blocked and flushes are forced. Defaults to 40% of heap. + Maximum size of all memstores in a region server before new + updates are blocked and flushes are forced. Defaults to 40% of heap - hbase.regionserver.globalMemcache.lowerLimit + hbase.regionserver.global.memstore.lowerLimit 0.25 - When memcaches are being forced to flush to make room in + When memstores are being forced to flush to make room in memory, keep flushing until we hit this mark. Defaults to 30% of heap. - This value equal to hbase.regionserver.globalmemcache.upperLimit causes + This value equal to hbase.regionserver.global.memstore.upperLimit causes the minimum possible flushing to occur when updates are blocked due to - memcache limiting. + memstore limiting. @@ -268,22 +268,22 @@ - hbase.hregion.memcache.flush.size + hbase.hregion.memstore.flush.size 67108864 - A HRegion memcache will be flushed to disk if size of the memcache + Memstore will be flushed to disk if size of the memstore exceeds this number of bytes. Value is checked by a thread that runs - every hbase.server.thread.wakefrequency. + every hbase.server.thread.wakefrequency. - hbase.hregion.memcache.block.multiplier + hbase.hregion.memstore.block.multiplier 2 - Block updates if memcache has hbase.hregion.block.memcache + Block updates if memstore has hbase.hregion.block.memstore time hbase.hregion.flush.size bytes. Useful preventing - runaway memcache during spikes in update traffic. Without an - upper-bound, memcache fills such that when it flushes the + runaway memstore during spikes in update traffic. Without an + upper-bound, memstore fills such that when it flushes the resultant flush files take a long time to compact or split, or worse, we OOME. @@ -302,7 +302,7 @@ 3 If more than this number of HStoreFiles in any one HStore - (one HStoreFile is written per flush of memcache) then a compaction + (one HStoreFile is written per flush of memstore) then a compaction is run to rewrite all HStoreFiles files as one. Larger numbers put off compaction but when it runs, it takes longer to complete. During a compaction, updates cannot be flushed to disk. Long diff --git a/src/docs/src/documentation/content/xdocs/metrics.xml b/src/docs/src/documentation/content/xdocs/metrics.xml index 01acae8f480..c8744f438de 100644 --- a/src/docs/src/documentation/content/xdocs/metrics.xml +++ b/src/docs/src/documentation/content/xdocs/metrics.xml @@ -49,7 +49,7 @@

If you enable the hbase context, on regionservers you'll see total requests since last - metric emission, count of regions and storefiles as well as a count of memcache size. + metric emission, count of regions and storefiles as well as a count of memstore size. On the master, you'll see a count of the cluster's requests.

diff --git a/src/java/org/apache/hadoop/hbase/HServerLoad.java b/src/java/org/apache/hadoop/hbase/HServerLoad.java index d013657d9c5..8f5285b81b5 100644 --- a/src/java/org/apache/hadoop/hbase/HServerLoad.java +++ b/src/java/org/apache/hadoop/hbase/HServerLoad.java @@ -59,8 +59,8 @@ public class HServerLoad implements WritableComparable { private int stores; /** the number of storefiles for the region */ private int storefiles; - /** the current size of the memcache for the region, in MB */ - private int memcacheSizeMB; + /** the current size of the memstore for the region, in MB */ + private int memstoreSizeMB; /** the current total size of storefile indexes for the region, in MB */ private int storefileIndexSizeMB; @@ -75,16 +75,16 @@ public class HServerLoad implements WritableComparable { * @param name * @param stores * @param storefiles - * @param memcacheSizeMB + * @param memstoreSizeMB * @param storefileIndexSizeMB */ public RegionLoad(final byte[] name, final int stores, - final int storefiles, final int memcacheSizeMB, + final int storefiles, final int memstoreSizeMB, final int storefileIndexSizeMB) { this.name = name; this.stores = stores; this.storefiles = storefiles; - this.memcacheSizeMB = memcacheSizeMB; + this.memstoreSizeMB = memstoreSizeMB; this.storefileIndexSizeMB = storefileIndexSizeMB; } @@ -119,10 +119,10 @@ public class HServerLoad implements WritableComparable { } /** - * @return the memcache size, in MB + * @return the memstore size, in MB */ - public int getMemcacheSizeMB() { - return memcacheSizeMB; + public int getMemStoreSizeMB() { + return memstoreSizeMB; } /** @@ -156,10 +156,10 @@ public class HServerLoad implements WritableComparable { } /** - * @param memcacheSizeMB the memcache size, in MB + * @param memstoreSizeMB the memstore size, in MB */ - public void setMemcacheSizeMB(int memcacheSizeMB) { - this.memcacheSizeMB = memcacheSizeMB; + public void setMemStoreSizeMB(int memstoreSizeMB) { + this.memstoreSizeMB = memstoreSizeMB; } /** @@ -177,7 +177,7 @@ public class HServerLoad implements WritableComparable { in.readFully(this.name); this.stores = in.readInt(); this.storefiles = in.readInt(); - this.memcacheSizeMB = in.readInt(); + this.memstoreSizeMB = in.readInt(); this.storefileIndexSizeMB = in.readInt(); } @@ -186,7 +186,7 @@ public class HServerLoad implements WritableComparable { out.write(name); out.writeInt(stores); out.writeInt(storefiles); - out.writeInt(memcacheSizeMB); + out.writeInt(memstoreSizeMB); out.writeInt(storefileIndexSizeMB); } @@ -199,8 +199,8 @@ public class HServerLoad implements WritableComparable { Integer.valueOf(this.stores)); sb = Strings.appendKeyValue(sb, "storefiles", Integer.valueOf(this.storefiles)); - sb = Strings.appendKeyValue(sb, "memcacheSize", - Integer.valueOf(this.memcacheSizeMB)); + sb = Strings.appendKeyValue(sb, "memstoreSize", + Integer.valueOf(this.memstoreSizeMB)); sb = Strings.appendKeyValue(sb, "storefileIndexSize", Integer.valueOf(this.storefileIndexSizeMB)); return sb.toString(); @@ -350,12 +350,12 @@ public class HServerLoad implements WritableComparable { } /** - * @return Size of memcaches in MB + * @return Size of memstores in MB */ - public int getMemcacheSizeInMB() { + public int getMemStoreSizeInMB() { int count = 0; for (RegionLoad info: regionLoad) - count += info.getMemcacheSizeMB(); + count += info.getMemStoreSizeMB(); return count; } @@ -411,16 +411,16 @@ public class HServerLoad implements WritableComparable { * @param name * @param stores * @param storefiles - * @param memcacheSizeMB + * @param memstoreSizeMB * @param storefileIndexSizeMB * @deprecated Use {@link #addRegionInfo(RegionLoad)} */ @Deprecated public void addRegionInfo(final byte[] name, final int stores, - final int storefiles, final int memcacheSizeMB, + final int storefiles, final int memstoreSizeMB, final int storefileIndexSizeMB) { this.regionLoad.add(new HServerLoad.RegionLoad(name, stores, storefiles, - memcacheSizeMB, storefileIndexSizeMB)); + memstoreSizeMB, storefileIndexSizeMB)); } // Writable diff --git a/src/java/org/apache/hadoop/hbase/HTableDescriptor.java b/src/java/org/apache/hadoop/hbase/HTableDescriptor.java index 9ddc9d5b776..a4258e7e149 100644 --- a/src/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ b/src/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -70,9 +70,9 @@ ISerializable { public static final String READONLY = "READONLY"; public static final ImmutableBytesWritable READONLY_KEY = new ImmutableBytesWritable(Bytes.toBytes(READONLY)); - public static final String MEMCACHE_FLUSHSIZE = "MEMCACHE_FLUSHSIZE"; - public static final ImmutableBytesWritable MEMCACHE_FLUSHSIZE_KEY = - new ImmutableBytesWritable(Bytes.toBytes(MEMCACHE_FLUSHSIZE)); + public static final String MEMSTORE_FLUSHSIZE = "MEMSTORE_FLUSHSIZE"; + public static final ImmutableBytesWritable MEMSTORE_FLUSHSIZE_KEY = + new ImmutableBytesWritable(Bytes.toBytes(MEMSTORE_FLUSHSIZE)); public static final String IS_ROOT = "IS_ROOT"; public static final ImmutableBytesWritable IS_ROOT_KEY = new ImmutableBytesWritable(Bytes.toBytes(IS_ROOT)); @@ -94,7 +94,7 @@ ISerializable { public static final boolean DEFAULT_READONLY = false; - public static final int DEFAULT_MEMCACHE_FLUSH_SIZE = 1024*1024*64; + public static final int DEFAULT_MEMSTORE_FLUSH_SIZE = 1024*1024*64; public static final int DEFAULT_MAX_FILESIZE = 1024*1024*256; @@ -122,7 +122,7 @@ ISerializable { for(HColumnDescriptor descriptor : families) { this.families.put(descriptor.getName(), descriptor); } - setMemcacheFlushSize(16 * 1024); + setMemStoreFlushSize(16 * 1024); } /** @@ -440,19 +440,19 @@ ISerializable { /** * @return memory cache flush size for each hregion */ - public int getMemcacheFlushSize() { - byte [] value = getValue(MEMCACHE_FLUSHSIZE_KEY); + public int getMemStoreFlushSize() { + byte [] value = getValue(MEMSTORE_FLUSHSIZE_KEY); if (value != null) return Integer.valueOf(Bytes.toString(value)).intValue(); - return DEFAULT_MEMCACHE_FLUSH_SIZE; + return DEFAULT_MEMSTORE_FLUSH_SIZE; } /** - * @param memcacheFlushSize memory cache flush size for each hregion + * @param memstoreFlushSize memory cache flush size for each hregion */ - public void setMemcacheFlushSize(int memcacheFlushSize) { - setValue(MEMCACHE_FLUSHSIZE_KEY, - Bytes.toBytes(Integer.toString(memcacheFlushSize))); + public void setMemStoreFlushSize(int memstoreFlushSize) { + setValue(MEMSTORE_FLUSHSIZE_KEY, + Bytes.toBytes(Integer.toString(memstoreFlushSize))); } // public Collection getIndexes() { diff --git a/src/java/org/apache/hadoop/hbase/KeyValue.java b/src/java/org/apache/hadoop/hbase/KeyValue.java index 13b02e6b915..67ff09183ab 100644 --- a/src/java/org/apache/hadoop/hbase/KeyValue.java +++ b/src/java/org/apache/hadoop/hbase/KeyValue.java @@ -214,7 +214,7 @@ public class KeyValue implements Writable, HeapSize { /** * Lowest possible key. * Makes a Key with highest possible Timestamp, empty row and column. No - * key can be equal or lower than this one in memcache or in store file. + * key can be equal or lower than this one in memstore or in store file. */ public static final KeyValue LOWESTKEY = new KeyValue(HConstants.EMPTY_BYTE_ARRAY, HConstants.LATEST_TIMESTAMP); @@ -1771,7 +1771,7 @@ public class KeyValue implements Writable, HeapSize { int compareTimestamps(final long ltimestamp, final long rtimestamp) { // The below older timestamps sorting ahead of newer timestamps looks // wrong but it is intentional. This way, newer timestamps are first - // found when we iterate over a memcache and newer versions are the + // found when we iterate over a memstore and newer versions are the // first we trip over when reading from a store file. if (ltimestamp < rtimestamp) { return 1; diff --git a/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java b/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java index 8dd4c6fe4cb..52e5c1ded77 100644 --- a/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java +++ b/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java @@ -119,10 +119,10 @@ public class UnmodifyableHTableDescriptor extends HTableDescriptor { } /** - * @see org.apache.hadoop.hbase.HTableDescriptor#setMemcacheFlushSize(int) + * @see org.apache.hadoop.hbase.HTableDescriptor#setMemStoreFlushSize(int) */ @Override - public void setMemcacheFlushSize(int memcacheFlushSize) { + public void setMemStoreFlushSize(int memstoreFlushSize) { throw new UnsupportedOperationException("HTableDescriptor is read-only"); } diff --git a/src/java/org/apache/hadoop/hbase/regionserver/ColumnTracker.java b/src/java/org/apache/hadoop/hbase/regionserver/ColumnTracker.java index 4d68c86d9cd..dfb30261ca3 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/ColumnTracker.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/ColumnTracker.java @@ -36,7 +36,7 @@ import org.apache.hadoop.hbase.regionserver.QueryMatcher.MatchCode; *