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 27F667814 for ; Tue, 20 Sep 2011 05:42:02 +0000 (UTC) Received: (qmail 93722 invoked by uid 500); 20 Sep 2011 05:42:01 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 93688 invoked by uid 500); 20 Sep 2011 05:42: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 93678 invoked by uid 99); 20 Sep 2011 05:42:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2011 05:42:01 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ryanobjc@gmail.com designates 209.85.210.169 as permitted sender) Received: from [209.85.210.169] (HELO mail-iy0-f169.google.com) (209.85.210.169) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2011 05:41:55 +0000 Received: by iaen33 with SMTP id n33so340800iae.14 for ; Mon, 19 Sep 2011 22:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=JLr/kOj/A0mjt1ZkyTkUNirtL56V5ErnuqYMQZmbmwM=; b=ha7EAz9qeVUndHl6ZEx4YT5bfDUsYToaT0zm3zQWwjjdDdZUFufjINye1KbtmXujYp kgi2Ju5SdFLAsGokIuP2TG+G2T6X+AMx3/sxQCnVIKEgAjxPqu2adKeWHVTOVGInFyoC UEqk8tbR2r4kaHHwH4/ykcjGjDBQ90wWWDgTM= MIME-Version: 1.0 Received: by 10.231.25.19 with SMTP id x19mr684475ibb.16.1316497294001; Mon, 19 Sep 2011 22:41:34 -0700 (PDT) Received: by 10.231.14.134 with HTTP; Mon, 19 Sep 2011 22:41:33 -0700 (PDT) In-Reply-To: References: Date: Mon, 19 Sep 2011 22:41:33 -0700 Message-ID: Subject: Re: prefix compression implementation From: Ryan Rawson To: dev@hbase.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org So if the HCell or whatever ends up returning ByteBuffers, then that plays straight in to scatter/gather NIO calls, and if some of them are DBB, then so much the merrier. For example, the thrift stuff takes ByteBuffers when its calling for a byte sequence. -ryan On Mon, Sep 19, 2011 at 10:39 PM, Stack wrote: > One other thought is that exposing ByteRange, ByteBuffer, and v1 array > stuff in Interface seems like you are exposing 'implementation' > details that perhaps shouldn't show through. =A0I'm guessing its > unavoidable though if the Interface is to be used in a few different > contexts: i.e. "v1" has to work if we are to get this new stuff in, > some srcs will be DBBs, etc. > > St.Ack > > On Mon, Sep 19, 2011 at 10:33 PM, Stack wrote: >> On Mon, Sep 19, 2011 at 3:26 PM, Matt Corgan wrote= : >>> I don't think the name is all that important, though i thought HCell wa= s >>> less clumsy than KeyValue or KeyValueInterface. =A0Take a look at this >>> interface on github: >>> >>> https://github.com/hotpads/hbase-prefix-trie/blob/master/src/org/apache= /hadoop/hbase/model/HCell.java >>> >>> Seems like it should be trivially easy to get KeyValue to implement tha= t. >>> =A0Then it provides the right methods to make compareTo methods that wi= ll work >>> across different implementations. =A0The implementations of those metho= ds >>> might have an if-statement to determine the class of the "other" HCell,= and >>> choose the fastest byte comparison method behind the scenes. >>> >> >> I'd say call it Cell rather than HCell. >> >> You have getRowArray rather than getRow which we currently have but I >> suppose it makes sense since you can then group by suffix. >> >> There is a patch lying around that adds a version to KV by using top >> two bytes of the type byte. =A0If you need me to dig it up, just say >> (then you might not have to have v1 stuff in your Interface). >> >> You might need to add some equals for stuff like same row, cf, and >> qualifier... but they can come later. >> >> The comparator stuff is currently horrid because it depends on >> context; i.e. whether the KVs are from -ROOT- or .META. or from a >> userspace table. =A0There are some ideas for having it so only one >> comparator for all types but thats another issue. >> >> St.Ack >> >