@Test public void testWhenMemstoreAndBlockCacheMaxMinChecksFails() throws Exception { BlockCacheStub blockCache = new BlockCacheStub(0); MemstoreFlusherStub memStoreFlusher = new MemstoreFlusherStub(0); Configuration conf = HBaseConfiguration.create(); conf.setFloat(HeapMemoryManager.MEMSTORE_SIZE_MAX_RANGE_KEY, 0.75f); conf.setFloat(HeapMemoryManager.BLOCK_CACHE_SIZE_MIN_RANGE_KEY, 0.06f); try { new HeapMemoryManager(blockCache, memStoreFlusher, new RegionServerStub(conf)); fail(); } catch (RuntimeException e) { } conf = HBaseConfiguration.create(); conf.setFloat(HeapMemoryManager.MEMSTORE_SIZE_MIN_RANGE_KEY, 0.2f); conf.setFloat(HeapMemoryManager.BLOCK_CACHE_SIZE_MAX_RANGE_KEY, 0.7f); try { new HeapMemoryManager(blockCache, memStoreFlusher, new RegionServerStub(conf)); fail(); } catch (RuntimeException e) { } }
public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((ResizableBlockCache) blockCache, memStoreFlusher, server); } return null; }
HeapMemoryManager { public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((ResizableBlockCache) blockCache, memStoreFlusher, server); } return null; } }
HeapMemoryManager { public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((ResizableBlockCache) blockCache, memStoreFlusher, server); } return null; } @VisibleForTesting  HeapMemoryManager(ResizableBlockCache blockCache, FlushRequester memStoreFlusher,
      Server server); }
HeapMemoryManager { public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((ResizableBlockCache) blockCache, memStoreFlusher, server); } return null; } @VisibleForTesting  HeapMemoryManager(ResizableBlockCache blockCache, FlushRequester memStoreFlusher,
      Server server); static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher,
      Server server); void start(); void stop(); }
HeapMemoryManager { public static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher, Server server) { BlockCache blockCache = CacheConfig.instantiateBlockCache(conf); if (blockCache instanceof ResizableBlockCache) { return new HeapMemoryManager((ResizableBlockCache) blockCache, memStoreFlusher, server); } return null; } @VisibleForTesting  HeapMemoryManager(ResizableBlockCache blockCache, FlushRequester memStoreFlusher,
      Server server); static HeapMemoryManager create(Configuration conf, FlushRequester memStoreFlusher,
      Server server); void start(); void stop(); static final String BLOCK_CACHE_SIZE_MAX_RANGE_KEY; static final String BLOCK_CACHE_SIZE_MIN_RANGE_KEY; static final String MEMSTORE_SIZE_MAX_RANGE_KEY; static final String MEMSTORE_SIZE_MIN_RANGE_KEY; static final String HBASE_RS_HEAP_MEMORY_TUNER_PERIOD; static final int HBASE_RS_HEAP_MEMORY_TUNER_DEFAULT_PERIOD; static final String HBASE_RS_HEAP_MEMORY_TUNER_CLASS; }