[
https://issues.apache.org/jira/browse/HBASE-14882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15647093#comment-15647093
]
Xiang Li commented on HBASE-14882:
----------------------------------
Hi [~anoop.hbase]
After testing almost all code paths (sorry it took a long time) and verifying
by UT, patch 003 is uploaded for master branch. Please review and comment at
your most convenience. Thanks!
The following changes are included:
1. In the constructor of IndividualBytesFieldCell, remove the check on
qualifier and value. Do not throw IllegalArgumentException if qualifier/value
is null.
2. Handle some getters when qualifier/value/tags is null:
(1) Make getXXXArray() for qualifier, value and tags return
HConstansts.EMPTY_BYTE_ARRAY if qualifier/value/tags is null, and make
getXXXLength() for qualifier, value and tags return 0 if qualifier/value/tags
is null. Those have the same behaviors as KeyValue. By the way, input row is
checked by Mutation#checkRow() in the constructor of Put, and family is checked
in the constructor of IndividualBytesFieldCell, so in getXXXArray() and
getXXXLength() for row and family, there is no check whether it is null or not.
(2) In heapSize(), call getQualifierLength(), getValueLength() and
getTagsLength() instead of qualifier/value/tags.length, in case that
qualifier/value/tags is null.
(3) Add a new @Test called testNullQualifierValueTags to check the output of
getXXXArray(), getXXXLength() and getXXXOffset() when qualifier/value/tags is
null.
3. Add annotation to indicate the test category which
TestIndividualBytesFieldCell belongs to, according to HBASE-11911.
*One question:*, HBASE-16134 makes SettableSequenceId and SettableTimestamp
deprecated in 2.0 and to be removed in 3.0. Could I still use them in this JIRA
if I would like this JIRA get into 2.0?
> 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
>
> Attachments: HBASE-14882.master.000.patch,
> HBASE-14882.master.001.patch, HBASE-14882.master.002.patch,
> HBASE-14882.master.003.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)