hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Purtell (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HBASE-5296) confusing code in HFileBlockIndex.seekToBlockIndex()
Date Sat, 11 Apr 2015 01:09:15 GMT

     [ https://issues.apache.org/jira/browse/HBASE-5296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrew Purtell resolved HBASE-5296.
-----------------------------------
    Resolution: Incomplete
      Assignee:     (was: Mikhail Bautin)

> confusing code in HFileBlockIndex.seekToBlockIndex()
> ----------------------------------------------------
>
>                 Key: HBASE-5296
>                 URL: https://issues.apache.org/jira/browse/HBASE-5296
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Prakash Khemani
>
> {code}
>     public HFileBlock seekToDataBlock(final byte[] key, int keyOffset,
>         int keyLength, HFileBlock currentBlock, boolean cacheBlocks,
>         boolean pread, boolean isCompaction)
>         throws IOException {
>       int rootLevelIndex = rootBlockContainingKey(key, keyOffset, keyLength);
>       if (rootLevelIndex < 0 || rootLevelIndex >= blockOffsets.length) {
>         return null;
>       }
> {code}
> In the above code rootLevelIndex is never greater-than-or-equal-to blockOffsets.length.
> (It can confuse reading of the code if you follow it from StoreFileScanner.seek(kv))



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message