-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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-28717 Support FuzzyRowFilter in REST interface #6060
Conversation
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@@ -458,6 +520,12 @@ public FilterModel(Filter filter) { | |||
this.filters = new ArrayList<>(); | |||
this.filters.add(new FilterModel(((WhileMatchFilter) filter).getFilter())); | |||
break; | |||
case FuzzyRowFilter: | |||
this.fuzzyKeys = new ArrayList<>(); |
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.
nit: it might be worth to extract the size of the fuzzyKeys and initialize the array list with that as you do in other cases.
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.
Done.
* Returns the Fuzzy keys in the format expected by the constructor. | ||
* @return the Fuzzy keys in the format expected by the constructor | ||
*/ | ||
public List<Pair<byte[], byte[]>> getFuzzyKeys() { |
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.
nit: can we rename this method to resetIfPreprocessed?
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.
That would be misleading.
We are not changing the state of the object, we only revert the preprocessing on the copies that we return.
From the point of view of the caller, he gets back the same keys+masks that the filter was initialized with, the preprocessing and reverting that is an implementation detail.
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.
(actually, the don't care bytes are zeroed out, but we don't care about that)
*/ | ||
public List<Pair<byte[], byte[]>> getFuzzyKeys() { | ||
List<Pair<byte[], byte[]>> returnList = new ArrayList<>(fuzzyKeysData.size()); | ||
for (Pair<byte[], byte[]> fuzzyKey : fuzzyKeysData) { |
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.
Should we have a boolean flagging when masks have been preprocessed, so that we could avoid these loops when it hasn't?
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.
It doesn't really matter, becase this method is called only once when we serialize the filter on the client side for a REST call, so it is not in the hot path.
I can add the same checks that the preprocessMask() has for symmetry.
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 have added checks around the revert code.
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Funny, the code with my accidentally pasted URL compiled, and did not even break the code because "http:" got interpreted as a label, and the rest as a comment. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Signed-off-by: Ankit Singhal <ankit@apache.org> (cherry picked from commit 429d6ba)
No description provided.