Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E5B318DEA for ; Thu, 25 Jun 2015 17:19:10 +0000 (UTC) Received: (qmail 65013 invoked by uid 500); 25 Jun 2015 17:19:05 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 64960 invoked by uid 500); 25 Jun 2015 17:19:05 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 64946 invoked by uid 99); 25 Jun 2015 17:19:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jun 2015 17:19:05 +0000 Date: Thu, 25 Jun 2015 17:19:05 +0000 (UTC) From: "ramkrishna.s.vasudevan (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-13939) Make HFileReaderImpl.getFirstKeyInBlock() to return a Cell MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-13939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14601562#comment-14601562 ] ramkrishna.s.vasudevan commented on HBASE-13939: ------------------------------------------------ Ping!!! > Make HFileReaderImpl.getFirstKeyInBlock() to return a Cell > ---------------------------------------------------------- > > Key: HBASE-13939 > URL: https://issues.apache.org/jira/browse/HBASE-13939 > Project: HBase > Issue Type: Sub-task > Reporter: ramkrishna.s.vasudevan > Assignee: ramkrishna.s.vasudevan > Priority: Minor > Fix For: 2.0.0, 1.1.2 > > Attachments: HBASE-13939.patch, HBASE-13939_1.patch, HBASE-13939_2.patch, HBASE-13939_3.patch, HBASE-13939_3.patch, HBASE-13939_branch-1.1.patch > > > The getFirstKeyInBlock() in HFileReaderImpl is returning a BB. It is getting used in seekBefore cases. Because we return a BB we create a KeyOnlyKV once for comparison > {code} > if (reader.getComparator() > .compareKeyIgnoresMvcc( > new KeyValue.KeyOnlyKeyValue(firstKey.array(), firstKey.arrayOffset(), > firstKey.limit()), key) >= 0) { > long previousBlockOffset = seekToBlock.getPrevBlockOffset(); > // The key we are interested in > if (previousBlockOffset == -1) { > // we have a 'problem', the key we want is the first of the file. > return false; > } > ........ > {code} > And if the compare fails we again create another KeyOnlyKv > {code} > Cell firstKeyInCurrentBlock = new KeyValue.KeyOnlyKeyValue(Bytes.getBytes(firstKey)); > loadBlockAndSeekToKey(seekToBlock, firstKeyInCurrentBlock, true, key, true); > {code} > So one object will be enough and that can be returned by getFirstKeyInBlock. Also will be useful when we go with Buffered backed server cell to change in one place. -- This message was sent by Atlassian JIRA (v6.3.4#6332)