void incMemStoreSize(long dataSizeDelta, long heapSizeDelta, long offHeapSizeDelta, int cellsCountDelta) { if (this.rsAccounting != null) { rsAccounting.incGlobalMemStoreSize(dataSizeDelta, heapSizeDelta, offHeapSizeDelta); } long dataSize = this.memStoreSizing.incMemStoreSize(dataSizeDelta, heapSizeDelta, offHeapSizeDelta, cellsCountDelta); checkNegativeMemStoreDataSize(dataSize, dataSizeDelta); }
void incGlobalMemStoreSize(MemStoreSize mss) { incGlobalMemStoreSize(mss.getDataSize(), mss.getHeapSize(), mss.getOffHeapSize()); }
@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()); } }
@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()); }
@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 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 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 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()); }