/** * @return The increase in heap size because of this cell addition. This includes this cell POJO's * heap size itself and additional overhead because of addition on to CSLM. */ protected long heapSizeChange(Cell cell, boolean allocated) { long res = 0; if (allocated) { boolean onHeap = true; MemStoreLAB memStoreLAB = getMemStoreLAB(); if(memStoreLAB != null) { onHeap = memStoreLAB.isOnHeap(); } res += indexEntryOnHeapSize(onHeap); if(onHeap) { res += cell.heapSize(); } res = ClassSize.align(res); } return res; }
/**------------------------------------------------------------------------ * C-tor to be used when new CellChunkImmutableSegment is built as a result of compaction/merge * of a list of older ImmutableSegments. * The given iterator returns the Cells that "survived" the compaction. */ protected CellChunkImmutableSegment(CellComparator comparator, MemStoreSegmentsIterator iterator, MemStoreLAB memStoreLAB, int numOfCells, MemStoreCompactionStrategy.Action action) { super(null, comparator, memStoreLAB); // initialize the CellSet with NULL long indexOverhead = DEEP_OVERHEAD_CCM; // memStoreLAB cannot be null in this class boolean onHeap = getMemStoreLAB().isOnHeap(); // initiate the heapSize with the size of the segment metadata if (onHeap) { incMemStoreSize(0, indexOverhead, 0, 0); } else { incMemStoreSize(0, 0, indexOverhead, 0); } // build the new CellSet based on CellArrayMap and update the CellSet of the new Segment initializeCellSet(numOfCells, iterator, action); }
long indexOverhead = -CSLMImmutableSegment.DEEP_OVERHEAD_CSLM + DEEP_OVERHEAD_CCM; boolean onHeap = getMemStoreLAB().isOnHeap();
MemStoreLAB msLab = segment.getMemStoreLAB(); if (msLab != null) { if (msLab.isOnHeap()) { assertTrue("HeapSize should always bigger or equal than data size", sizeChangeForFirstCell.getHeapSize() >= sizeChangeForFirstCell