@Test public void testOffheapMemstoreLowerWaterMarkLimitsDueToDataSize() { // setting 1G as offheap data size conf.setLong(MemorySizeUtil.OFFHEAP_MEMSTORE_SIZE_KEY, (1L * 1024L)); // try for default cases RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); // this will breach offheap limit as data size is higher and not due to heap size MemStoreSize memstoreSize = new MemStoreSize((3L * 1024L * 1024L * 1024L), 0, (1L * 1024L * 1024L * 1024L), 100); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_OFFHEAP_LOWER_MARK, regionServerAccounting.isAboveLowWaterMark()); }
@Test public void testOffheapMemstoreHigherWaterMarkLimitsDueToDataSize() { // setting 1G as offheap data size conf.setLong(MemorySizeUtil.OFFHEAP_MEMSTORE_SIZE_KEY, (1L * 1024L)); // try for default cases RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); // this will breach offheap limit as data size is higher and not due to heap size MemStoreSize memstoreSize = new MemStoreSize((3L * 1024L * 1024L * 1024L), 0, (1L * 1024L * 1024L * 1024L), 100); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_OFFHEAP_HIGHER_MARK, regionServerAccounting.isAboveHighWaterMark()); }
@Test public void testOffheapMemstoreHigherWaterMarkLimitsDueToHeapSize() { // setting 1G as offheap data size conf.setLong(MemorySizeUtil.OFFHEAP_MEMSTORE_SIZE_KEY, (1L * 1024L)); // try for default cases RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); // this will breach higher limit as heap size is higher and not due to offheap size long dataSize = regionServerAccounting.getGlobalOnHeapMemStoreLimit(); MemStoreSize memstoreSize = new MemStoreSize(dataSize, dataSize, 0, 100); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_ONHEAP_HIGHER_MARK, regionServerAccounting.isAboveHighWaterMark()); }
@Test public void testOffheapMemstoreLowerWaterMarkLimitsDueToHeapSize() { // setting 1G as offheap data size conf.setLong(MemorySizeUtil.OFFHEAP_MEMSTORE_SIZE_KEY, (1L * 1024L)); // try for default cases RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); // this will breach higher limit as heap size is higher and not due to offheap size long dataSize = regionServerAccounting.getGlobalOnHeapMemStoreLimit(); MemStoreSize memstoreSize = new MemStoreSize(dataSize, dataSize, 0, 100); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_ONHEAP_LOWER_MARK, regionServerAccounting.isAboveLowWaterMark()); } }
regionServerAccounting = new RegionServerAccounting(conf);
@Test public void testOnheapMemstoreLowerWaterMarkLimits() { RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); long dataSize = regionServerAccounting.getGlobalMemStoreLimit(); MemStoreSize memstoreSize = new MemStoreSize(dataSize, dataSize, 0, 0); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_ONHEAP_LOWER_MARK, regionServerAccounting.isAboveLowWaterMark()); }
@Test public void testOnheapMemstoreHigherWaterMarkLimits() { RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); long dataSize = regionServerAccounting.getGlobalMemStoreLimit(); MemStoreSize memstoreSize = new MemStoreSize(dataSize, dataSize, 0, 0); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_ONHEAP_HIGHER_MARK, regionServerAccounting.isAboveHighWaterMark()); }
when(rss.getServerName()).thenReturn(ServerName.valueOf("foo", 1, 1)); when(rss.getConfiguration()).thenReturn(CONF); when(rss.getRegionServerAccounting()).thenReturn(new RegionServerAccounting(CONF)); String string = org.apache.hadoop.hbase.executor.EventType.RS_COMPACTED_FILES_DISCHARGER .toString();
CONF.setInt("hbase.hstore.report.period", 0); final RegionServerAccounting rsAccounting = new RegionServerAccounting(CONF); RegionServerServices rs = Mockito.mock(RegionServerServices.class); ChunkCreator.initialize(MemStoreLABImpl.CHUNK_SIZE_DEFAULT, false, 0, 0, 0, null);
regionServerAccounting = new RegionServerAccounting(); cacheConfig = new CacheConfig(conf);
@Test public void testOffheapMemstoreLowerWaterMarkLimitsDueToDataSize() { // setting 1G as offheap data size conf.setLong(MemorySizeUtil.OFFHEAP_MEMSTORE_SIZE_KEY, (1L * 1024L)); // try for default cases RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); // this will breach offheap limit as data size is higher and not due to heap size MemStoreSize memstoreSize = new MemStoreSize((3L * 1024L * 1024L * 1024L), 0, (1L * 1024L * 1024L * 1024L)); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_OFFHEAP_LOWER_MARK, regionServerAccounting.isAboveLowWaterMark()); }
@Test public void testOffheapMemstoreHigherWaterMarkLimitsDueToDataSize() { // setting 1G as offheap data size conf.setLong(MemorySizeUtil.OFFHEAP_MEMSTORE_SIZE_KEY, (1L * 1024L)); // try for default cases RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); // this will breach offheap limit as data size is higher and not due to heap size MemStoreSize memstoreSize = new MemStoreSize((3L * 1024L * 1024L * 1024L), 0, (1L * 1024L * 1024L * 1024L)); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_OFFHEAP_HIGHER_MARK, regionServerAccounting.isAboveHighWaterMark()); }
@Test public void testOffheapMemstoreHigherWaterMarkLimitsDueToHeapSize() { // setting 1G as offheap data size conf.setLong(MemorySizeUtil.OFFHEAP_MEMSTORE_SIZE_KEY, (1L * 1024L)); // try for default cases RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); // this will breach higher limit as heap size is higher and not due to offheap size long dataSize = regionServerAccounting.getGlobalOnHeapMemStoreLimit(); MemStoreSize memstoreSize = new MemStoreSize(dataSize, dataSize, 0); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_ONHEAP_HIGHER_MARK, regionServerAccounting.isAboveHighWaterMark()); }
@Test public void testOffheapMemstoreLowerWaterMarkLimitsDueToHeapSize() { // setting 1G as offheap data size conf.setLong(MemorySizeUtil.OFFHEAP_MEMSTORE_SIZE_KEY, (1L * 1024L)); // try for default cases RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); // this will breach higher limit as heap size is higher and not due to offheap size long dataSize = regionServerAccounting.getGlobalOnHeapMemStoreLimit(); MemStoreSize memstoreSize = new MemStoreSize(dataSize, dataSize, 0); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_ONHEAP_LOWER_MARK, regionServerAccounting.isAboveLowWaterMark()); } }
@Test public void testOnheapMemstoreHigherWaterMarkLimits() { RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); long dataSize = regionServerAccounting.getGlobalMemStoreLimit(); MemStoreSize memstoreSize = new MemStoreSize(dataSize, dataSize, 0); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_ONHEAP_HIGHER_MARK, regionServerAccounting.isAboveHighWaterMark()); }
@Test public void testOnheapMemstoreLowerWaterMarkLimits() { RegionServerAccounting regionServerAccounting = new RegionServerAccounting(conf); long dataSize = regionServerAccounting.getGlobalMemStoreLimit(); MemStoreSize memstoreSize = new MemStoreSize(dataSize, dataSize, 0); regionServerAccounting.incGlobalMemStoreSize(memstoreSize); assertEquals(FlushType.ABOVE_ONHEAP_LOWER_MARK, regionServerAccounting.isAboveLowWaterMark()); }
regionServerAccounting = new RegionServerAccounting(); uncaughtExceptionHandler = new UncaughtExceptionHandler() { @Override
when(rss.getServerName()).thenReturn(ServerName.valueOf("foo", 1, 1)); when(rss.getConfiguration()).thenReturn(CONF); when(rss.getRegionServerAccounting()).thenReturn(new RegionServerAccounting(CONF)); String string = org.apache.hadoop.hbase.executor.EventType.RS_COMPACTED_FILES_DISCHARGER .toString();
CONF.setInt("hbase.hstore.report.period", 0); final RegionServerAccounting rsAccounting = new RegionServerAccounting(CONF); RegionServerServices rs = Mockito.mock(RegionServerServices.class); ChunkCreator.initialize(MemStoreLABImpl.CHUNK_SIZE_DEFAULT, false, 0, 0, 0, null);