Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5BFD10309 for ; Fri, 19 Jul 2013 04:30:17 +0000 (UTC) Received: (qmail 36877 invoked by uid 500); 19 Jul 2013 04:30:14 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 36723 invoked by uid 500); 19 Jul 2013 04:30:01 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 36694 invoked by uid 99); 19 Jul 2013 04:29:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jul 2013 04:29:57 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ramkrishna.s.vasudevan@gmail.com designates 209.85.216.42 as permitted sender) Received: from [209.85.216.42] (HELO mail-qa0-f42.google.com) (209.85.216.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jul 2013 04:29:50 +0000 Received: by mail-qa0-f42.google.com with SMTP id hu16so3998424qab.1 for ; Thu, 18 Jul 2013 21:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=BGjjlAh2wQsusbBTaNEd/rHCWBtftaiAPOwPPMnDKCU=; b=X7Eu6V7Jz9Z63s9QOeiR6yafm/9YZmstf59ORK7hfhkRe+spxDIiQUG0/U1n/RkWZp yJtpae2VfvOzXiKN0EQ7WLSQ7OtUGoI0CSeeky7uk5BO2bS+1IoiptpIZfIiVY9seshz JLS1DrOK2toDsPtxAeRxifR6TaFKpX+Ua3UYyQDt+5MbOni4nBT4Gy6gCZYJVhIrL2Dm t9s9FaMTuS0s/0oWWva85IaZH92aghsRClYYATOvGlCWn7H1B6NkIKFXdhUEmmCTP8kV P+uTwlJQmyfF6LSoqp/smI44g7MR89IsDniLWmZ2ae2d2MPi68dEFj895Xyg5PTrGiAI iBug== MIME-Version: 1.0 X-Received: by 10.224.13.19 with SMTP id z19mr16938058qaz.12.1374208169847; Thu, 18 Jul 2013 21:29:29 -0700 (PDT) Received: by 10.49.116.143 with HTTP; Thu, 18 Jul 2013 21:29:29 -0700 (PDT) In-Reply-To: References: Date: Fri, 19 Jul 2013 09:59:29 +0530 Message-ID: Subject: Re: DISCUSS : HFile V3 proposal for tags in 0.96 From: ramkrishna vasudevan To: dev@hbase.apache.org Content-Type: multipart/alternative; boundary=089e0149ce04cfb17604e1d5c5d7 X-Virus-Checked: Checked by ClamAV on apache.org --089e0149ce04cfb17604e1d5c5d7 Content-Type: text/plain; charset=ISO-8859-1 What changes/differences that we would be introducing in the V3 format would be (I will put down in words under subcategory) To reduce the code duplicate we would subclass ReaderV3 and WriterV3 from ReaderV2 and WriterV2 respectively. *HFileBlockFormat* *=============* No change in V2 and V3. *KV serialization* *============* V2 no change V3 would now serailize the tags also after the Value part before the memstoreTS *FixedFileTrailer* *===========* Introduces a new information into the trailer which can be used in V3 to make tags optional. Suppose take the case that user selects V3 but in one CF there are no tags. Then we would write the tag bytes while flushing but during compaction using this header info we would just avoid writing tags in the compacted files. This would mean no impact on read performances after the compaction has been completed. V2 would code also tries to get this trailer info but this being null no impact on any of the existing code. *WriterV3 and ReaderV3* *=================* Tries to handle the tags based on the meta data from the trailer info. All the apis like seekTo, next(), getKeyValue() are now able to handle tags based on the flag passed during the construction of the Readers and Writers. We can be sure that for any instances of V2 the includeTags flag would always be false. *DataBlockEncoders* *==============* Additonal arguments added to the apis in the interfaces related to HFileDataBlockEncoders, BufferedDataBlockEncoders, HFileDataBlockEncodingContext etc. Again for V2 the new apis would still behave the same way and there would be no impact for V2 based usecases. The BuffereddataEncoder, being the base class for all encoders other than PrefixTree would now be tag aware. *PrefixTreeEncoders* *==============* Trying to keep changes minimal here but would ensure that there are no behaviourial changes while using PrefixTree with V2. *KeyValue class* *===========* Wil include changes to have a Tag class inside this. Apis to identify tags in a KV would be needed. Util method changes also would be there. For V2 based read/write flow the existing code path applies with no/minimal changes. Many testcases has to be changed to accomodate the api changes happening to the internal interfaces. I have listed down the changes at a high level, may be once you could see a patch that would give more clarity. Let me know if further information would be needed. Regards Ram On Thu, Jul 18, 2013 at 11:25 PM, Jimmy Xiang wrote: > Can you share some more details about it? A graph/chart/table showing the > specific difference will be helpful. > > Thanks, > Jimmy > > > On Thu, Jul 18, 2013 at 10:23 AM, Ted Yu wrote: > > > I have been following comments on HBASE-8496. > > > > I think introducing cell tagging through HFile v3 is acceptable. > > > > Looking forward to seeing your implementation. > > > > Cheers > > > > On Thu, Jul 18, 2013 at 10:14 AM, ramkrishna vasudevan < > > ramkrishna.s.vasudevan@gmail.com> wrote: > > > > > For the past couple of months, we have been working through various > > > prototypes for supporting inline storage of tags in cells as persisted > on > > > disk. Our goals are to support optional use of tags with minimal > changes > > to > > > core code while also avoiding performance impacts to users who do not > use > > > tags. > > > > > > For background, refer to the comments in > > > > > > > > > > > > https://issues.apache.org/jira/browse/HBASE-8496?focusedCommentId=13708228&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13708228 > > > > > > and > > > > > > > > > > > > https://issues.apache.org/jira/browse/HBASE-8496?focusedCommentId=13710653&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13710653 > > > > > > We have iterated on a couple of prototypes that implement tag > awareness > > in > > > DataBlockEncoders, later as a new type of Codec for Cells. This point > is > > > discussed in the above comments in HBASE-8496. > > > > > > We think that tag awareness in Cell Codecs is the right way, but there > > are > > > some shortcomings with the current interfaces internal to HFile that > need > > > to addressed in order to avoid any performance impacts for those who do > > not > > > want to use inline tags, and that may involve a drastic amount of code > > > change. > > > > > > We can avoid several problems with HFile V2 internals, and backwards > > > compatibility concerns, and allow for working tags support with no > > > performance impact and low risk to all HBase users who do not want tag > > > support, while still allowing for inline tags capabilities in a > shipping > > > version of HBase, by introducing this in a new V3 version for HFile. > > > > > > The new V3 version for HFile differs from earlier versions by > supporting > > > inline tag storage. This version does not change the HFileBlock format > > > whereas it just serializes and deserializes the Tag information that > > would > > > be persisted in the HFile. Having HFile V3 would also help to keep Tags > > > optional such that the existing cases where there are no tags are > totally > > > unaffected. Also we ensure that we keep the changes outside of the V3 > > > reader and writer minimal. Compatibility would not be a problem with > > > future versions when we go with Cell Codecs. What Codecs used for > > writing > > > the file will be persisted in the HFile header. Now for files that are > > > either V2 or V3 we will instantiate two default codecs that know to > deal > > > with serializations with and without tags. > > > > > > There have been thoughts on an HFile V3 prior, e.g.: > > > > > > > > > > > > https://issues.apache.org/jira/browse/HBASE-8496?focusedCommentId=13710653&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13710653 > > > > > > We have been working on this and will have a clean patch with good > > amount > > > of testing in time for 0.96. > > > > > > Although our focus is on performance-neutral persistence of inline cell > > > tags in 0.96 to enable a couple of security coprocessor users, > > introducing > > > an HFile V3 provides design freedom for some other features and > problems > > > too that can be developed through the 0.96 cycle into 0.98. > > > > > > Pls voice your opinion on this so that we can make this clear and may > be > > > define the scope of the patch. Also feel free to comment on HBASE-8496 > > on > > > your thoughts and ideas. > > > > > > Regards > > > > > > Ram > > > > > > --089e0149ce04cfb17604e1d5c5d7--