@Override public MemStoreSize getFlushableSize() { MemStoreSize mss = getSnapshotSize(); return mss.getDataSize() > 0? mss: getActive().getMemStoreSize(); }
@Override public void completeMiniBatchOperations( final MiniBatchOperationInProgress<Mutation> miniBatchOp, final WriteEntry writeEntry) throws IOException { super.completeMiniBatchOperations(miniBatchOp, writeEntry); region.mvcc.advanceTo(getOrigLogSeqNum()); } }
private void pushTailToSnapshot() { VersionedSegmentsList segments = pipeline.getVersionedTail(); pushToSnapshot(segments.getStoreSegments()); // In Swap: don't close segments (they are in snapshot now) and don't update the region size pipeline.swap(segments,null,false, false); }
public int getNumHFilesForRS(final HRegionServer rs, final TableName tableName, final byte[] family) { int numHFiles = 0; for (Region region : rs.getRegions(tableName)) { numHFiles += region.getStore(family).getStorefilesCount(); } return numHFiles; }
private MemStoreSize doDropStoreMemStoreContentsForSeqId(HStore s, long currentSeqId) throws IOException { MemStoreSize flushableSize = s.getFlushableSize(); this.decrMemStoreSize(flushableSize); StoreFlushContext ctx = s.createFlushContext(currentSeqId, FlushLifeCycleTracker.DUMMY); ctx.prepare(); ctx.abort(); return flushableSize; }
/** * @param cell Find the row that comes after this one. If null, we return the * first. * @return Next row or null if none found. */ Cell getNextRow(final Cell cell) { return getLowest( getNextRow(cell, this.getActive().getCellSet()), getNextRow(cell, this.snapshot.getCellSet())); }
@Override public int compare(KeyValueScanner left, KeyValueScanner right) { int rowComparison = compareRows(left.peek(), right.peek()); if (rowComparison != 0) { return -rowComparison; } return super.compare(left, right); }
@Override public void flushCache(MonitoredTask status) throws IOException { RegionServerServices rsService = region.getRegionServerServices(); ThroughputController throughputController = rsService == null ? null : rsService.getFlushThroughputController(); tempFiles = HStore.this.flushCache(cacheFlushSeqNum, snapshot, status, throughputController, tracker); }
@Override public long getHFilesSize() { // Include only StoreFiles which are HFiles return getStorefilesSize(this.storeEngine.getStoreFileManager().getStorefiles(), HStoreFile::isHFile); }
public MemStoreSize getPipelineSize() { MemStoreSizing memStoreSizing = new NonThreadSafeMemStoreSizing(); LinkedList<? extends Segment> localCopy = readOnlyCopy; for (Segment segment : localCopy) { memStoreSizing.incMemStoreSize(segment.getMemStoreSize()); } return memStoreSizing.getMemStoreSize(); }
private HStore init(String methodName, Configuration conf, TableDescriptorBuilder builder, ColumnFamilyDescriptor hcd, MyStoreHook hook, boolean switchToPread) throws IOException { initHRegion(methodName, conf, builder, hcd, hook, switchToPread); if (hook == null) { store = new HStore(region, hcd, conf); } else { store = new MyStore(region, hcd, conf, hook, switchToPread); } return store; }
/** * @param checkerScope The scope that the limit is being checked from * @return true when the limit is enforceable from the checker's scope and it has been reached */ boolean checkSizeLimit(LimitScope checkerScope) { return hasSizeLimit(checkerScope) && (progress.getDataSize() >= limits.getDataSize() || progress.getHeapSize() >= limits.getHeapSize()); }
protected MutableSegment(CellSet cellSet, CellComparator comparator, MemStoreLAB memStoreLAB, MemStoreSizing memstoreSizing) { super(cellSet, comparator, memStoreLAB, TimeRangeTracker.create(TimeRangeTracker.Type.SYNC)); incMemStoreSize(0, DEEP_OVERHEAD, 0, 0); // update the mutable segment metadata if (memstoreSizing != null) { memstoreSizing.incMemStoreSize(0, DEEP_OVERHEAD, 0, 0); } }
private StoreFileReader createStreamReader(boolean canUseDropBehind) throws IOException { initReader(); StoreFileReader reader = fileInfo.open(this.fs, this.cacheConf, canUseDropBehind, -1L, primaryReplica, refCount, false); reader.copyFields(this.reader); return reader; }
@Override protected long keySize() { // Need to consider dataSize/keySize of all segments in pipeline and active long keySize = getActive().getDataSize(); for (Segment segment : this.pipeline.getSegments()) { keySize += segment.getDataSize(); } return keySize; }
@Override protected long heapSize() { // Need to consider heapOverhead of all segments in pipeline and active long h = getActive().getHeapSize(); for (Segment segment : this.pipeline.getSegments()) { h += segment.getHeapSize(); } return h; }
/** * @param checkerScope The scope that the limit is being checked from * @return true when the limit is enforceable from the checker's scope and it has been reached */ boolean checkBatchLimit(LimitScope checkerScope) { return hasBatchLimit(checkerScope) && progress.getBatch() >= limits.getBatch(); }
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); }
protected void pushActiveToPipeline(MutableSegment currActive) { if (!currActive.isEmpty()) { pipeline.pushHead(currActive); resetActive(); } }
void decrMemStoreSize(long dataSizeDelta, long heapSizeDelta, long offHeapSizeDelta, int cellsCountDelta) { if (this.rsAccounting != null) { rsAccounting.decGlobalMemStoreSize(dataSizeDelta, heapSizeDelta, offHeapSizeDelta); } long dataSize = this.memStoreSizing.decMemStoreSize(dataSizeDelta, heapSizeDelta, offHeapSizeDelta, cellsCountDelta); checkNegativeMemStoreDataSize(dataSize, -dataSizeDelta); }