-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-27788 Skip family comparing when compare cells inner the store #5171
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
This comment has been minimized.
This comment has been minimized.
|
I used to consider the same but soon I found that there are some tricks in our implementation, as we may generate some fake cell for seeking. I saw that you have already handled the case where left family length or right family length are zero, this is for some key only cell, but I'm afraid there could still be other type of fake cells, for example, when querying on a bloom filter enabled region, we may use bloom filter to generate a fake cell, if the type of the bloom filter is ROWCOL, maybe we could also include a fake family? |
Yeah, this is a fairly important class and does require detailed testing. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@Apache9 Checked the code, the bloom filter use empty family both in storing and checking, so seems ok. BTW, the method of checkGeneralBloomFilter use CellComparator.getInstance() directly which return CellComparatorImpl, will change them later. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparatorImpl.java
Outdated
Show resolved
Hide resolved
| if (comparator == MetaCellComparator.META_COMPARATOR) { | ||
| this.comparator = comparator; | ||
| } else { | ||
| this.comparator = InnerStoreCellComparator.INNER_STORE_COMPARATOR; |
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.
This is a bit strange, as we may not use the comparator passed in. We should use a new pattern to set the comparator here, otherwise it will confuse developers...
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.
Make sense, will refactor here.
Thanks.
This comment has been minimized.
This comment has been minimized.
|
Writing a perf test class for cellComparator, don't merge yet even if the tests pass. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Added perf test class named PerfTestCellComparator.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
More detailed test report, compareCnt is 1 billion. <style type='text/css'></style>
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Any other comments? @Apache9 @bbeaudreault |
|
|
||
| public static CellComparator getInnerStoreCellComparator(Configuration conf, byte[] tableName) { | ||
| if ( | ||
| conf != null && conf.getBoolean(HConstants.USE_META_CELL_COMPARATOR, |
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 move this judgement in upper layer so we do not need to move USE_META_CELL_COMPARATOR to HConstants? It is just for internal use, we'd better not put it into an IA.Public class...
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.
Let me try.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| */ | ||
| @Category({ MediumTests.class }) | ||
| @RunWith(Parameterized.class) | ||
| public class PerfTestCellComparator { |
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 think we'd better just post the JMH code on the jira issue? Without JMH, a micro bench is not very stable...
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.
| */ | ||
| // We could write the actual class name from 2.0 onwards and handle BC | ||
| private String comparatorClassName = CellComparator.getInstance().getClass().getName(); | ||
| private String comparatorClassName = |
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.
No compatibility issues?
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.
No compatibility issues?
Thought about it and i think so, because we do the conversion when we save and read the hfile, the actual store is the KVComparator, we can't change this since we want hbase1.x to be able to read the files generated in the new version. See the comment of getHBase1CompatibleName for more detail.
Thanks.
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
Any more comments? @Apache9 @bbeaudreault |
No description provided.