-
Notifications
You must be signed in to change notification settings - Fork 433
Additional functions to create filters. #89
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
Additional functions to create filters. #89
Conversation
| * | ||
| * TODO(#84) - document what is the effect of n <= 0 | ||
| */ | ||
| static Filter Latest(std::int32_t n) { |
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 use an unsigned int here, or is int32 the correct type to pass down the call stack?
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.
The rest of the stack expects an int32.
| * TODO(#84) - document what is the effect of n <= 0 | ||
| */ | ||
| static Filter CellsRowLimit(int n) { | ||
| static Filter CellsRowLimit(std::int32_t n) { |
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.
Same comment here re: unsigned, if possible.
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.
The rest of the stack expects an int32.
| * TODO(#84) - document what is the effect of n <= 0 | ||
| */ | ||
| static Filter CellsRowOffset(int n) { | ||
| static Filter CellsRowOffset(std::int32_t n) { |
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.
Same comment here re: unsigned, if possible.
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.
The rest of the stack expects an int32.
bigtable/client/filters.h
Outdated
| * TODO(#84) - decide what happens if the probability is out of range. | ||
| * | ||
| * @param probability the probability that any row will be selected. It | ||
| * must be in the [0.0, 1.0] range. |
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.
[...] must be in the range [0.0, 1.0].
but you can also simplify it to:
[...] must be in the range [0, 1].
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.
Did the first, I like making it explicit that is a floating point range, but will change if you feel strongly about it.
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.
Floating point range SGTM.
bigtable/client/filters.h
Outdated
| * different ranges the following functions are available. | ||
| */ | ||
| /** | ||
| * Return a filter that accepts values in the [@p start, @p end) range. |
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.
[...]
values in the range [@p start, @p end).
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.
Fixed.
bigtable/client/filters.h
Outdated
| } | ||
|
|
||
| /** | ||
| * Return a filter that accepts columns in the (@p start, @p end) range |
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.
Same as above.
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.
Fixed.
bigtable/client/filters.h
Outdated
| * Each value accepted by previous filters in modified to include the @p | ||
| * label. | ||
| * | ||
| * @note Currently it is not possible to apply more than one label in a |
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.
Currently, it is ...
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.
Fixed.
bigtable/client/filters.h
Outdated
| * filter expression, that is, a chain can only contain a single | ||
| * ApplyLabelTransformer() filter. This limitation may be lifted in | ||
| * the future. It is possible to have multiple ApplyLabelTransformer | ||
| * filters in a Union() filter, though in this case each copy of a cell |
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.
, though in this case, each [...]
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.
Fixed.
| * | ||
| * @param label the label applied to each cell. The labels must be at most 15 | ||
| * characters long, and must match the `[a-z0-9\\-]` pattern. | ||
| * TODO(#84) - change this if we decide to validate inputs in the client side |
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.
Will this TODO be automatically included in the documentation on the previous line for @param label? Did you want that to happen? Do we need a blank line between the arg doc comment and the TODO to dissociate them?
Same comment elsewhere, I've seen this pattern a few times.
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.
Did not want that, thanks for catching it. Fixed, and looked for the pattern elsewhere too.
| * | ||
| * TODO(#84) - document what happens if end < start | ||
| */ | ||
| static Filter ColumnRangeLeftOpen(std::string column_family, |
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.
@sduskis, @garye, @DanielMahu — do we actually support column range queries? I thought we only support row range queries, and column families and column qualifiers need to be specified explicitly, one at a time.
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.
ColumnRangeFilters can be applied just like any other filter:
https://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto#L390
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.
OK, got it, so column families are discrete (must be specified explicitly), while column qualifiers are continuous (can be selected individually, or via a range).
This is another step to fix googleapis#30. It introduces more functions to create filters, though these are less common ones.
dbf3fd3 to
904595b
Compare
mbrukman
left a comment
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.
Minor comments, please feel free to squash + merge after you address them, though the style guide on comments should be added as a TODO somewhere, perhaps (in the style guide PR, maybe?).
|
|
||
| /// Create a filter that accepts only the last @a n values. | ||
| static Filter Latest(int n) { | ||
| /** |
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.
Do we have a pattern for when we use /** ... */ vs. when we use /// comments? Does Doxygen handle both of them? Do they behave differently somehow?
This should be documented in the style guide, and we should be consistent, assuming they are identical.
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.
The style guide proposed in #98 includes guidelines for when to use /** */ vs. /// and yes, Doxygen supports both.
bigtable/client/filters.h
Outdated
| * range. In most cases applications use [start,end) ranges, and the | ||
| * ValueRange() and ColumnRange() functions are offered to support the | ||
| * common case. For the less common cases where the application needs | ||
| * different ranges the following functions are available. |
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.
s/ranges the/ranges, the/
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.
Fixed.
bigtable/client/filters.h
Outdated
| * @name Less common range filters. | ||
| * | ||
| * Cloud Bigtable range filters can include or exclude the limits of the | ||
| * range. In most cases applications use [start,end) ranges, and the |
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.
s/start,end/start, end/ (add space after comma)
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.
Fixed.
This is another step to fix #30. It introduces more
functions to create filters, though these are less
common ones.