From 4559fbf12cd3ed8f166bc7851d650f26d63b1a4e Mon Sep 17 00:00:00 2001 From: eshcar Date: Sun, 15 Apr 2018 11:51:50 +0300 Subject: [PATCH] HBASE-20390: IMC Default Parameters for 2.0.0 --- .../apache/hadoop/hbase/regionserver/CompactingMemStore.java | 10 +++++----- .../hadoop/hbase/regionserver/MemStoreCompactionStrategy.java | 2 +- .../regionserver/TestCompactingToCellFlatMapMemStore.java | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java index ea4cc0870d..9eb7ba481f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java @@ -43,12 +43,12 @@ import org.apache.hadoop.hbase.wal.WAL; /** * A memstore implementation which supports in-memory compaction. * A compaction pipeline is added between the active set and the snapshot data structures; - * it consists of a list of kv-sets that are subject to compaction. - * Like the snapshot, all pipeline components are read-only; updates only affect the active set. + * it consists of a list of segments that are subject to compaction. + * Like the snapshot, all pipeline segments are read-only; updates only affect the active set. * To ensure this property we take advantage of the existing blocking mechanism -- the active set * is pushed to the pipeline while holding the region's updatesLock in exclusive mode. - * Periodically, a compaction is applied in the background to all pipeline components resulting - * in a single read-only component. The ``old'' components are discarded when no scanner is reading + * Periodically, a compaction is applied in the background to all pipeline segments resulting + * in a single read-only component. The ``old'' segments are discarded when no scanner is reading * them. */ @InterfaceAudience.Private @@ -62,7 +62,7 @@ public class CompactingMemStore extends AbstractMemStore { // Default fraction of in-memory-flush size w.r.t. flush-to-disk size public static final String IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY = "hbase.memstore.inmemoryflush.threshold.factor"; - private static final double IN_MEMORY_FLUSH_THRESHOLD_FACTOR_DEFAULT = 0.1; + private static final double IN_MEMORY_FLUSH_THRESHOLD_FACTOR_DEFAULT = 0.014; private static final Logger LOG = LoggerFactory.getLogger(CompactingMemStore.class); private HStore store; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactionStrategy.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactionStrategy.java index 2f16055fbc..6d28e37352 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactionStrategy.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactionStrategy.java @@ -42,7 +42,7 @@ public abstract class MemStoreCompactionStrategy { // The upper bound for the number of segments we store in the pipeline prior to merging. public static final String COMPACTING_MEMSTORE_THRESHOLD_KEY = "hbase.hregion.compacting.pipeline.segments.limit"; - public static final int COMPACTING_MEMSTORE_THRESHOLD_DEFAULT = 4; + public static final int COMPACTING_MEMSTORE_THRESHOLD_DEFAULT = 2; /** * Types of actions to be done on the pipeline upon MemStoreCompaction invocation. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java index 9523091af6..053321515d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java @@ -843,8 +843,10 @@ public class TestCompactingToCellFlatMapMemStore extends TestCompactingMemStore // set memstore to flat into CellChunkMap MemoryCompactionPolicy compactionType = MemoryCompactionPolicy.BASIC; + memstore.getConfiguration().setInt(MemStoreCompactionStrategy + .COMPACTING_MEMSTORE_THRESHOLD_KEY, 4); memstore.getConfiguration().set(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY, - String.valueOf(compactionType)); + String.valueOf(compactionType)); ((MyCompactingMemStore) memstore).initiateType(compactionType, memstore.getConfiguration()); ((CompactingMemStore) memstore).setIndexType(CompactingMemStore.IndexType.CHUNK_MAP); -- 2.15.1 (Apple Git-101)