-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-27558 Scan quotas and limits should account for total block IO #4967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
7f7c8b6
7192417
9f9abc4
cfd4b55
4463e1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,4 +140,10 @@ public interface HFileScanner extends Shipper, Closeable { | |
| */ | ||
| @Override | ||
| void close(); | ||
|
|
||
| /** | ||
| * Returns the block size in bytes for the current block. Will only return a value once per block, | ||
| * otherwise 0. Used for calculating block IO in ScannerContext. | ||
| */ | ||
| int getCurrentBlockSizeOnce(); | ||
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -503,7 +503,8 @@ private boolean nextInternal(List<Cell> results, ScannerContext scannerContext) | |
| results.clear(); | ||
|
|
||
| // Read nothing as the rowkey was filtered, but still need to check time limit | ||
| if (scannerContext.checkTimeLimit(limitScope)) { | ||
| // We also check size limit because we might have read blocks in getting to this point. | ||
| if (scannerContext.checkAnyLimitReached(limitScope)) { | ||
| return true; | ||
| } | ||
| continue; | ||
|
|
@@ -561,8 +562,9 @@ private boolean nextInternal(List<Cell> results, ScannerContext scannerContext) | |
| // This row was totally filtered out, if this is NOT the last row, | ||
| // we should continue on. Otherwise, nothing else to do. | ||
| if (!shouldStop) { | ||
| // Read nothing as the cells was filtered, but still need to check time limit | ||
| if (scannerContext.checkTimeLimit(limitScope)) { | ||
| // Read nothing as the cells was filtered, but still need to check time limit. | ||
| // We also check size limit because we might have read blocks in getting to this point. | ||
| if (scannerContext.checkAnyLimitReached(limitScope)) { | ||
| return true; | ||
| } | ||
| continue; | ||
|
|
@@ -608,6 +610,11 @@ private boolean nextInternal(List<Cell> results, ScannerContext scannerContext) | |
| return scannerContext.setScannerState(NextState.NO_MORE_VALUES).hasMoreValues(); | ||
| } | ||
| if (!shouldStop) { | ||
| // Read nothing as the cells were filtered, but still need to check time limit. | ||
|
||
| // We also check size limit because we might have read blocks in getting to this point. | ||
| if (scannerContext.checkAnyLimitReached(limitScope)) { | ||
| return true; | ||
| } | ||
| continue; | ||
| } | ||
| } | ||
|
|
@@ -705,13 +712,21 @@ public int size() { | |
|
|
||
| protected boolean nextRow(ScannerContext scannerContext, Cell curRowCell) throws IOException { | ||
| assert this.joinedContinuationRow == null : "Trying to go to next row during joinedHeap read."; | ||
|
|
||
| // Enable skipping row mode, which disables limits and skips tracking progress for all | ||
| // but block size. We keep tracking block size because skipping a row in this way | ||
| // might involve reading blocks along the way. | ||
| scannerContext.setSkippingRow(true); | ||
|
|
||
| Cell next; | ||
| while ((next = this.storeHeap.peek()) != null && CellUtil.matchingRows(next, curRowCell)) { | ||
| // Check for thread interrupt status in case we have been signaled from | ||
| // #interruptRegionOperation. | ||
| region.checkInterrupt(); | ||
| this.storeHeap.next(MOCKED_LIST); | ||
| this.storeHeap.next(MOCKED_LIST, scannerContext); | ||
Apache9 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| scannerContext.setSkippingRow(false); | ||
| resetFilters(); | ||
|
|
||
| // Calling the hook in CP which allows it to do a fast forward | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.