-
Notifications
You must be signed in to change notification settings - Fork 97
chore: add filter size check on read row request #166
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
Conversation
Currently, bigtable could only serve read row request with filter size of 20MB only. So adding this check to stop server request.
@@ -162,7 +166,11 @@ public Query range(ByteStringRange range) { | |||
* filters, please use {@link Filters#interleave()} or {@link Filters#chain()}. | |||
*/ | |||
public Query filter(Filters.Filter filter) { | |||
builder.setFilter(filter.toProto()); | |||
Preconditions.checkNotNull(filter, "filter can't be null"); |
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.
can we add a test please?
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.
Thanks for the review. Added test case for null check. I haven't added any test case for the filter size. I hope that should be fine.
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.
Apologies for being unclear, if you could add a test case for filter size as well that would be awesome :)
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.
I intentionally didn't add test case for that. Reason being the filter size needs to be more than 20MB, I thought that'd be a little large.
I would add unit test right away.
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.
Understood - LGTM. @igorbernstein2 any other thoughts?
Codecov Report
@@ Coverage Diff @@
## master #166 +/- ##
=========================================
Coverage ? 81.89%
Complexity ? 971
=========================================
Files ? 99
Lines ? 6025
Branches ? 331
=========================================
Hits ? 4934
Misses ? 912
Partials ? 179
Continue to review full report at Codecov.
|
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.
LGTM!
Currently, bigtable could only serve read row requests with the filter size of 20MB. Adding this check to prevent failure.