hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heng Chen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14826) Small improvement in KVHeap seek() API
Date Tue, 17 Nov 2015 14:03:11 GMT

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

Heng Chen commented on HBASE-14826:

Sound reasonable.  
A little hint.   Last 'if' in patch seems not necessary。
+      if(scanner == null) {
+        current = null;
+        return false;
+      }

If  scanner is null,  loop will exist, and return false. Of course, we should set current
to be null.

> Small improvement in KVHeap seek() API
> --------------------------------------
>                 Key: HBASE-14826
>                 URL: https://issues.apache.org/jira/browse/HBASE-14826
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>            Priority: Minor
>         Attachments: HBASE-14826.patch
> Currently in seek/reseek() APIs we tend to do lot of priorityqueue related operations.
We initially add the current scanner to the heap, then poll and again add the scanner back
if the seekKey is greater than the topkey in that scanner. Since the KVs are always going
to be in increasing order and in ideal scan flow every seek/reseek is followed by a next()
call it should be ok if we start with checking the current scanner and then do a poll to get
the next scanner. Just avoid the initial PQ.add(current) call. This could save some comparisons.

This message was sent by Atlassian JIRA

View raw message