hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ramkrishna.s.vasudevan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14099) StoreFile.passesKeyRangeFilter need not create Cells from the Scan's start and stop Row
Date Tue, 21 Jul 2015 05:44:04 GMT

    [ https://issues.apache.org/jira/browse/HBASE-14099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14634547#comment-14634547

ramkrishna.s.vasudevan commented on HBASE-14099:

Before patch it was, 
boolean nonOverLapping = ((getComparator().compare(firstKeyKV, largestScanKeyValue)) >
KeyValue largestScanKeyValue = scan.isReversed() ? KeyValueUtil		
1369	          .createLastOnRow(scan.getStartRow()) : KeyValueUtil.createLastOnRow(scan		
1370	          .getStopRow());
So this is going to have the type as Minimum.  So at any cost once the row part is not going
to same we are going to return -1 from the comparator because 
    if (rFamLength + rQualLength == 0
        && right.getTypeByte() == Type.Minimum.getCode()) {
      return -1;
The KV is not going to have any family or qualifier with it. So once the row is not going
to match then we always take the first Cell as lesser only.
Coming to this
 (getComparator().compare(lastKeyKV, smallestScanKeyValue)) < 0;
Though the smallest key value is going to have type as MAXIMUM but there is no family or qual
associated with it.  So at any point if the rows are not matching then we will always be returning
a value > 0 and thus failing the above condition.  If the formed fake key is going to have
a family or qual then it is different.  But here we just use the row along with type and ts.

Does it make sense now Lars?

> StoreFile.passesKeyRangeFilter need not create Cells from the Scan's start and stop Row
> ---------------------------------------------------------------------------------------
>                 Key: HBASE-14099
>                 URL: https://issues.apache.org/jira/browse/HBASE-14099
>             Project: HBase
>          Issue Type: Improvement
>          Components: Performance, Scanners
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 2.0.0
>         Attachments: HBASE-14099.patch, HBASE-14099_1.patch, HBASE-14099_2.patch, HBASE-14099_3.patch,
HBASE-14099_4.patch, storefile.png
> During profiling saw that the code here in passesKeyRangeFilter in Storefile
> {code}
>   KeyValue smallestScanKeyValue = scan.isReversed() ? KeyValueUtil
>           .createFirstOnRow(scan.getStopRow()) : KeyValueUtil.createFirstOnRow(scan
>           .getStartRow());
>       KeyValue largestScanKeyValue = scan.isReversed() ? KeyValueUtil
>           .createLastOnRow(scan.getStartRow()) : KeyValueUtil.createLastOnRow(scan
>           .getStopRow());
> {code}
> This row need not be copied now considering that we have CellComparator.compareRows(Cell,
> We have already refactored the firstKeyKv and lastKeyKV as part of other JIRAs.

This message was sent by Atlassian JIRA

View raw message