@Override public long getHeapSize() { return this.memStoreSizing.getHeapSize(); }
@Override public long getMemStoreHeapSize() { return memStoreSizing.getHeapSize(); }
public boolean pushHead(MutableSegment segment) { // Record the ImmutableSegment' heap overhead when initialing MemStoreSizing memstoreAccounting = new NonThreadSafeMemStoreSizing(); ImmutableSegment immutableSegment = SegmentFactory.instance(). createImmutableSegment(segment, memstoreAccounting); if (region != null) { region.addMemStoreSize(memstoreAccounting.getDataSize(), memstoreAccounting.getHeapSize(), memstoreAccounting.getOffHeapSize(), memstoreAccounting.getCellsCount()); } synchronized (pipeline){ boolean res = addFirst(immutableSegment); readOnlyCopy = new LinkedList<>(pipeline); return res; } }
protected void resetActive() { // Record the MutableSegment' heap overhead when initialing MemStoreSizing memstoreAccounting = new NonThreadSafeMemStoreSizing(); // Reset heap to not include any keys active = SegmentFactory.instance().createMutableSegment(conf, comparator, memstoreAccounting); // regionServices can be null when testing if (regionServices != null) { regionServices.addMemStoreSize(memstoreAccounting.getDataSize(), memstoreAccounting.getHeapSize(), memstoreAccounting.getOffHeapSize(), memstoreAccounting.getCellsCount()); } timeOfOldestEdit = Long.MAX_VALUE; }
protected void writeMiniBatchOperationsToMemStore( final MiniBatchOperationInProgress<Mutation> miniBatchOp, final long writeNumber) throws IOException { MemStoreSizing memStoreAccounting = new NonThreadSafeMemStoreSizing(); visitBatchOperations(true, miniBatchOp.getLastIndexExclusive(), (int index) -> { // We need to update the sequence id for following reasons. // 1) If the op is in replay mode, FSWALEntry#stampRegionSequenceId won't stamp sequence id. // 2) If no WAL, FSWALEntry won't be used // we use durability of the original mutation for the mutation passed by CP. if (isInReplay() || getMutation(index).getDurability() == Durability.SKIP_WAL) { region.updateSequenceId(familyCellMaps[index].values(), writeNumber); } applyFamilyMapToMemStore(familyCellMaps[index], memStoreAccounting); return true; }); // update memStore size region.incMemStoreSize(memStoreAccounting.getDataSize(), memStoreAccounting.getHeapSize(), memStoreAccounting.getOffHeapSize(), memStoreAccounting.getCellsCount()); }
/** * Creates a snapshot of the current memstore. * Snapshot must be cleared by call to {@link #clearSnapshot(long)} */ @Override public MemStoreSnapshot snapshot() { // If snapshot currently has entries, then flusher failed or didn't call // cleanup. Log a warning. if (!this.snapshot.isEmpty()) { LOG.warn("Snapshot called again without clearing previous. " + "Doing nothing. Another ongoing flush or did we fail last attempt?"); } else { this.snapshotId = EnvironmentEdgeManager.currentTime(); if (!getActive().isEmpty()) { // Record the ImmutableSegment' heap overhead when initialing MemStoreSizing memstoreAccounting = new NonThreadSafeMemStoreSizing(); ImmutableSegment immutableSegment = SegmentFactory.instance(). createImmutableSegment(getActive(), memstoreAccounting); // regionServices can be null when testing if (regionServices != null) { regionServices.addMemStoreSize(memstoreAccounting.getDataSize(), memstoreAccounting.getHeapSize(), memstoreAccounting.getOffHeapSize(), memstoreAccounting.getCellsCount()); } this.snapshot = immutableSegment; resetActive(); } } return new MemStoreSnapshot(this.snapshotId, this.snapshot); }
if (msLab.isOnHeap()) { assertTrue("HeapSize should always bigger or equal than data size", sizeChangeForFirstCell.getHeapSize() >= sizeChangeForFirstCell .getDataSize()); assertTrue("HeapSize should always bigger or equal than data size", sizeChangeForSecondCell.getHeapSize() >= sizeChangeForSecondCell .getDataSize()); } else {