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 63F7C200D2D for ; Fri, 27 Oct 2017 22:52:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 62880160BF2; Fri, 27 Oct 2017 20:52:09 +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 A30D81609DD for ; Fri, 27 Oct 2017 22:52:08 +0200 (CEST) Received: (qmail 54208 invoked by uid 500); 27 Oct 2017 20:52:07 -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 54197 invoked by uid 99); 27 Oct 2017 20:52:07 -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, 27 Oct 2017 20:52:07 +0000 Received: from hw10447.local (unknown [167.102.188.146]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 217AF1A00C7 for ; Fri, 27 Oct 2017 20:52:07 +0000 (UTC) Subject: Re: Struggles around Cell#getType() To: dev@hbase.apache.org References: <107cdf05-169f-48da-4b48-cf32fd82030b@apache.org> From: Josh Elser Message-ID: <1b4098d1-4ed2-f80c-4202-914ec089def0@apache.org> Date: Fri, 27 Oct 2017 16:52:06 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:56.0) Gecko/20100101 Thunderbird/56.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit archived-at: Fri, 27 Oct 2017 20:52:09 -0000 Filed the following and tentatively tagged them for beta-1 (sorry, I know that's crappy as these are API things): https://issues.apache.org/jira/browse/HBASE-19111 https://issues.apache.org/jira/browse/HBASE-19112 On 10/27/17 1:40 PM, Chia-Ping Tsai wrote: > bq. You agree with Ram's suggestion for helper methods as a way forward? > Adding the CellUtil#isPut() is ok to me as the PUT is a basic operation in hbase. > > On 2017-10-28 00:58, Josh Elser wrote: >> Re-reading https://issues.apache.org/jira/browse/HBASE-8693 that Sergey >> pointed out, I more think that the maybe getType() was misintepreted >> from what Nick originally meant it to be. Maybe intentional, maybe not. >> >> I don't think getTimestamp() should be removed -- when we store multiple >> versions of a Key, users should be able to reconcile the Cells client >> side (e.g. consider a CP which performs some custom merging logic). >> >> getSequenceId() I'd agree probably doesn't belong. getTag() I'll hold >> off judgement because I'm constantly biased into thinking the feature is >> something that it isn't :) >> >> You agree with Ram's suggestion for helper methods as a way forward? >> >> On 10/27/17 7:29 AM, Chia-Ping Tsai wrote: >>> The CellBuilder#Data type is introduced to make sure all components used to builder cell are IA.Public. >>> >>> bq. Best as I can tell, Cell#getType() should be deprecated >>> As i see it, the Cell#getType, #getTimestamp, #getSequenceId, and #getTag should be deprecated as these methods is some kind of internal info of storage engine. As a key-value store, the key consisting of row, family, and qualifier is enough to the general purpose. Other fields belong to the specific storage engine, and they should not be in the Cell which is our "frontline" interface of data. >>> >>> >>> On 2017-10-27 06:40, Josh Elser wrote: >>>> Hiya, >>>> >>>> (Background: see HBASE-19002) >>>> >>>> In trying to write some example Observers, I found myself in a pickle: >>>> how do I tell if a Cell is a Put? >>>> >>>> * Cell#getType() returns a byte which corresponds to a KeyValue.Type >>>> * KeyValue.Type has API to convert a byte to Type >>>> * KeyValue (and thus KeyValue.Type) is IA.Private >>>> * DataType o.a.h.h.typesDataType _appears to me_ to be the replacement >>>> for the KeyValue.Type >>>> >>>> Best as I can tell, Cell#getType() should be deprecated and we should >>>> have some kind of API (method on Cell or CellUtil) which returns a >>>> DataType instead of Type. The details of the byte and the KeyValue.Type >>>> should be hidden inside the implementation. >>>> >>>> My hunch is that this is an accidental omission, but Stack recommended >>>> that I "ask the class" ;). What have I missed? I think this is trivial >>>> to fix; obviously, I don't want to make a fix if I just didn't look hard >>>> enough. >>>> >>>> Thanks! >>>> >>>> - Josh >>>> >>