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
HBASE-25736 Scan should be limited by read capacity unit quota if read size quota is not set #3127
base: master
Are you sure you want to change the base?
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
…d size quota is not set
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@@ -122,6 +126,9 @@ public void close() { | |||
|
|||
@Override | |||
public long getReadAvailable() { | |||
if (readAvailable == Long.MAX_VALUE && readCapacityUnitAvailable != Long.MAX_VALUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind explaing a bit more here? It will also effect the quota for operations other than scan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scan use this value to limit the result size:
long maxQuotaResultSize = Math.min(maxScannerResultSize, quota.getReadAvailable()); long maxResultSize; if (scanner.getMaxResultSize() > 0) { maxResultSize = Math.min(scanner.getMaxResultSize(), maxQuotaResultSize); } else { maxResultSize = maxQuotaResultSize; }
Now it only considers the 'read size' type quota, and if it is not set, the scan can not be limited. The 'read capacity unit' is also a type of size quota, we can use it to calculate the available read size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now only scan use it.
No description provided.