[
https://issues.apache.org/jira/browse/HBASE-13450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14505328#comment-14505328
]
stack commented on HBASE-13450:
-------------------------------
Failure looks related.
Please edit the description. I do not follow.
The binarySearch you add in Bytes is same as existing binarySearch only for the
comparator part: i.e. the only diff is s/comparator/Bytes.BYTES_RAWCOMPARATOR/
Why reproduce the body? Why not call the existing binarySearch passing
Bytes.BYTES_RAWCOMPARATOR as comparator.
We are replacing raw comparator for rows. Is this going to be safe for meta
file compares? (It looks like it going by change in HFileBlockIndex where if no
comparator, we use Bytes but if a comparator, we use it). Is what is going on
here a replacement of RawBytesComparator with Bytes.RAWCOMPARATOR?
Why write 'if(' and then follow it with 'else {'... i.e. sometimes you have a
space and other times not (In the rest of the code, the style is to have a
space).
What is RAW_BYTES in the below? Is this Bytes.RAWCOMPARATOR?
// Return null for RAW_BYTES
Is this right?
889 if (bloomType == BloomType.ROW) {
890 res = (Bytes.BYTES_RAWCOMPARATOR.compare(bloomKey,
bloomKeyOffset, bloomKeyLen,
891 lastBloomKey, lastBloomKeyOffset, lastBloomKeyLen) <=
0);
892 } else {
893 res =
(generalBloomFilterWriter.getComparator().compareFlatKey(bloomKey,
894 bloomKeyOffset, bloomKeyLen, lastBloomKey,
lastBloomKeyOffset, lastBloomKeyLen)) <= 0;
895 }
If row bloom, we use bytes... but if this is a meta table file, we should use
comparator ?
Rather than repeat the <= 0 test twice, why not do it once after you've done
the compares rather than do
if (res) {
Hmmm...
bloomType == BloomType.ROWCOL ? KeyValue.COMPARATOR : null);
but.. it is replacing...
bloomType == BloomType.ROWCOL ? KeyValue.COMPARATOR :
KeyValue.RAW_COMPARATOR);
... so, raw comparator is 'ok' if a row-only bloom. How does this work w/ meta
keys?
Rather than do this in a few places....
246 if (comparator != null) {
247 Bytes.writeByteArray(out,
Bytes.toBytes(comparator.getClass().getName()));
248 } else {
249 Bytes.writeByteArray(out,
Bytes.toBytes(Bytes.BYTES_RAWCOMPARATOR.getClass().getName()));
250
just pass comparator even if it is null and let the method internally figure
which comparator to use...
> Purge RawBytescomparator from the writers and readers after HBASE-10800
> -----------------------------------------------------------------------
>
> Key: HBASE-13450
> URL: https://issues.apache.org/jira/browse/HBASE-13450
> Project: HBase
> Issue Type: Sub-task
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Fix For: 2.0.0
>
> Attachments: HBASE-13450.patch
>
>
> The RawBytesComparator should not be coming in the HFiles, the writers and
> readers as we will be trying to use the Bytes.RAW_COMPARATOR directly. Also
> RawBytescomparator can no longer by CellComparator as we would like to deal
> with CellComparator for all the comparisons going forward.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)