Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D0282200D1D for ; Sat, 30 Sep 2017 00:06:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CEA8B1609ED; Fri, 29 Sep 2017 22:06:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E65731609D1 for ; Sat, 30 Sep 2017 00:06:25 +0200 (CEST) Received: (qmail 29733 invoked by uid 500); 29 Sep 2017 22:06:24 -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 29722 invoked by uid 99); 29 Sep 2017 22:06:24 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Sep 2017 22:06:24 +0000 Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 3523C1A0185 for ; Fri, 29 Sep 2017 22:06:23 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id b184so1533662oii.13 for ; Fri, 29 Sep 2017 15:06:23 -0700 (PDT) X-Gm-Message-State: AMCzsaXWM7cKGPDHTvN3PA1Vtf5rZ8cD6SVJl0UAZbs+PEy0Zym08/Ah 8OG5h1NlImjjuJ8s2iHsr2d0lpN0CRwlxtem7dA= X-Google-Smtp-Source: AOwi7QDB+t7BSH//JpazdZMjNJ8b5GHe37E+261N89R9BOKHaAiyiSmE6IMACcI5imYXAqqjZgN1NkbhQucxZNT7JNs= X-Received: by 10.157.68.132 with SMTP id v4mr3946908ote.274.1506722783049; Fri, 29 Sep 2017 15:06:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.81.200 with HTTP; Fri, 29 Sep 2017 15:05:42 -0700 (PDT) In-Reply-To: References: From: Andrew Purtell Date: Fri, 29 Sep 2017 15:05:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [DISCUSS] Move Type out of KeyValue To: "dev@hbase.apache.org" Content-Type: multipart/alternative; boundary="f4030437aa24424062055a5b3cdb" archived-at: Fri, 29 Sep 2017 22:06:27 -0000 --f4030437aa24424062055a5b3cdb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =E2=80=8BConstruct a normal put or delete or batch mutation, add whatever e= xtra state you need in one or more operation attributes, and use a regionobserver to extend normal processing to handle the extra state. I'm curious what dispatching to extension code because of a custom cell type buys you over dispatching to extension code because of the presence of an attribute (or cell tag). For example, in security coprocessors we take attribute data and attach it to the cell using cell tags. Later we check for cell tag(s) to determine if we have to take special action when the cell is accessed by a scanner, or during some operations (e.g. appends or increments have to do extra handling for cell security tags). On Fri, Sep 29, 2017 at 2:43 PM, Chia-Ping Tsai wrote= : > > Instead of a custom cell, could you use a regular cell with a custom > > operation attribute (see OperationWithAttributes). > Pardon me, I didn't get what you said. > > > > On 2017-09-30 04:31, Andrew Purtell wrote: > > Instead of a custom cell, could you use a regular cell with a custom > > operation attribute (see OperationWithAttributes). > > > > On Fri, Sep 29, 2017 at 1:28 PM, Chia-Ping Tsai > wrote: > > > > > The custom cell help us to save memory consumption. We don't have own > > > serialization/deserialization mechanism, hence to transform data from > > > client to server needs many conversion phase (user data -> Put/Cell -= > > pb > > > object). The cost of conversion is large in transferring bulk data. I= n > > > fact, we also have custom mutation to manage the memory usage of inne= r > cell > > > collection. > > > > > > On 2017-09-30 02:43, Andrew Purtell wrote: > > > > What are the use cases for a custom cell? It seems a dangerously lo= w > > > level > > > > thing to attempt and perhaps we should unwind support for it. But > perhaps > > > > there is a compelling justification. > > > > > > > > > > > > On Thu, Sep 28, 2017 at 10:20 PM, Chia-Ping Tsai < > chia7712@apache.org> > > > > wrote: > > > > > > > > > Thanks for all comment. > > > > > > > > > > The problem i want to resolve is the valid code should be exposed > as > > > > > IA.Public. Otherwise, end user have to access the IA.Private clas= s > to > > > build > > > > > the custom cell. > > > > > > > > > > For example, I have a use case which plays a streaming role in ou= r > > > > > appliaction. It > > > > > applies the CellBuilder(HBASE-18519) to build custom cells. These > cells > > > > > have many same fields so they are put in shared-memory for > avoiding GC > > > > > pause. Everything is wonderful. However, we have to access the > > > IA.Private > > > > > class - KeyValue#Type - to get the valid code of Put. > > > > > > > > > > I believe there are many use cases of custom cell, and > consequently it > > > is > > > > > worth adding a way to get the valid type via IA.Public class. > > > Otherwise, it > > > > > may imply that the custom cell is based on a unstable way, becaus= e > the > > > > > related code can be changed at any time. > > > > > -- > > > > > Chia-Ping > > > > > > > > > > On 2017-09-29 00:49, Andrew Purtell wrote: > > > > > > I agree with Stack. Was typing up a reply to Anoop but let me > move it > > > > > down > > > > > > here. > > > > > > > > > > > > The type code exposes some low level details of how our current > > > stores > > > > > are > > > > > > architected. But what if in the future you could swap out HStor= e > > > > > implements > > > > > > Store with PStore implements Store, where HStore is backed by > HFiles > > > and > > > > > > PStore is backed by Parquet? Just as a hypothetical example. I > know > > > there > > > > > > would be larger issues if this were actually attempted. Bear wi= th > > > me. You > > > > > > can imagine some different new Store implementation that has so= me > > > > > > advantages but is not a design derived from the log structured > merge > > > tree > > > > > > if you like. Most values from a new Cell.Type based on > KeyValue.Type > > > > > > wouldn't apply to cells from such a thing because they are > > > particular to > > > > > > how LSMs work. I'm sure such a project if attempted would make = a > > > number > > > > > of > > > > > > changes requiring a major version increment and low level detai= ls > > > could > > > > > be > > > > > > unwound from Cell then, but if we could avoid doing it in the > first > > > > > place, > > > > > > I think it would better for maintainability. > > > > > > > > > > > > > > > > > > On Thu, Sep 28, 2017 at 9:39 AM, Stack wrote= : > > > > > > > > > > > > > On Thu, Sep 28, 2017 at 2:25 AM, Chia-Ping Tsai < > > > chia7712@apache.org> > > > > > > > wrote: > > > > > > > > > > > > > > > hi folks, > > > > > > > > > > > > > > > > User is allowed to create custom cell but the valid code of > type > > > - > > > > > > > > KeyValue#Type - is declared as IA.Private. As i see it, we > should > > > > > expose > > > > > > > > KeyValue#Type as Public Client. Three possible ways are sho= wn > > > below: > > > > > > > > 1) Change declaration of KeyValue#Type from IA.Private to > > > IA.Public > > > > > > > > 2) Move KeyValue#Type into Cell. > > > > > > > > 3) Move KeyValue#Type to upper level > > > > > > > > > > > > > > > > Any suggestions? > > > > > > > > > > > > > > > > > > > > > > > What is the problem that we are trying to solve Chia-Ping? Yo= u > > > want to > > > > > make > > > > > > > Cells of a new Type? > > > > > > > > > > > > > > My first reaction is that KV#Type is particular to the KV > > > > > implementation. > > > > > > > Any new Cell implementation should not have to adopt the > KeyValue > > > > > typing > > > > > > > mechanism. > > > > > > > > > > > > > > S > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > Chia-Ping > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Best regards, > > > > > > Andrew > > > > > > > > > > > > Words like orphans lost among the crosstalk, meaning torn from > > > truth's > > > > > > decrepit hands > > > > > > - A23, Crosstalk > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Best regards, > > > > Andrew > > > > > > > > Words like orphans lost among the crosstalk, meaning torn from > truth's > > > > decrepit hands > > > > - A23, Crosstalk > > > > > > > > > > > > > > > -- > > Best regards, > > Andrew > > > > Words like orphans lost among the crosstalk, meaning torn from truth's > > decrepit hands > > - A23, Crosstalk > > > --=20 Best regards, Andrew Words like orphans lost among the crosstalk, meaning torn from truth's decrepit hands - A23, Crosstalk --f4030437aa24424062055a5b3cdb--