hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiang Li (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14882) Provide a Put API that adds the provided family, qualifier, value without copying
Date Tue, 23 Aug 2016 14:35:21 GMT

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

Xiang Li commented on HBASE-14882:
----------------------------------

[~anoop.hbase], thanks for the comments!

1. Regarding 
bq. Why not handling this API ? addImmutable(byte [] family, byte [] qualifier, byte [] value)
It internally calls the updated function, as 
{code}
  public Put addImmutable(byte [] family, byte [] qualifier, byte [] value) {
    return addImmutable(family, qualifier, this.ts, value);
  }
{code}
So do not need to be updated.

2. Regarding the return value of getTagsArray()
Yes, I should return an empty byte array. Updated to use EMPTY_BYTE_ARRAY in HConstants.

3. Regarding
bq. All these checks on row, cf copied from KV class?
KeyValue has the similar function to check the parameters passed to the constructors. It is
called checkParameters(), starting from line 827 of KeyValue, as well as some other places.
I add some more check based on it.

4. Regarding
bq. 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 need to check if I get your idea. Do you worry that it might impact performance to use
anonymous inner class here? I see, but I have no idea so far. Will study.

5. Regarding
bq. Can have a single if block with || check? Exception can say that the family has to be
of length > 0 and < max
Thanks for the comments! Addressed. 

> 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