hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14882) Provide a Put API that adds the provided family, qualifier, value without copying
Date Mon, 22 Aug 2016 06:13:20 GMT

    [ https://issues.apache.org/jira/browse/HBASE-14882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15430104#comment-15430104
] 

Anoop Sam John commented on HBASE-14882:
----------------------------------------

Why not handling this API ? addImmutable(byte [] family, byte [] qualifier, byte [] value)


{code}
public byte[] getTagsArray() {
350	        return null;
351	      }
{code}
Better to return empty byte[]. We should be having constants declared for this some where.
HConstants?

All these checks on row, cf copied from KV class?

Any implication on class loading of the anonymous inner class? Every time code path reach,
need new defn and load? I dont think so.  Just asked for confirm.

{code}
if (family == null) {
231	      throw new IllegalArgumentException("Family is null");
232	    }
233	    if (family.length == 0) {  // family can not be ""
234	      throw new IllegalArgumentException("Family length is 0");
235	    }
236	    if (family.length > HConstants.MAX_FAMILY_LENGTH) {
237	      throw new IllegalArgumentException("Family length > " + HConstants.MAX_FAMILY_LENGTH);
238	    }
{code}
Can have a single if block with || check? Exception can say that the family has to be of length
> 0 and < max


> Provide a Put API that adds the provided family, qualifier, value without copying
> ---------------------------------------------------------------------------------
>
>                 Key: HBASE-14882
>                 URL: https://issues.apache.org/jira/browse/HBASE-14882
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 1.2.0
>            Reporter: Jerry He
>            Assignee: Xiang Li
>             Fix For: 2.0.0, 1.2.2
>
>         Attachments: HBASE-14882.master.000.patch
>
>
> In the Put API, we have addImmutable()
> {code}
>  /**
>    * See {@link #addColumn(byte[], byte[], byte[])}. This version expects
>    * that the underlying arrays won't change. It's intended
>    * for usage internal HBase to and for advanced client applications.
>    */
>   public Put addImmutable(byte [] family, byte [] qualifier, byte [] value)
> {code}
> But in the implementation, the family, qualifier and value are still being copied locally
to create kv.
> Hopefully we should provide an API that truly uses immutable family, qualifier and value.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message