[
https://issues.apache.org/jira/browse/HBASE-7941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13587375#comment-13587375
]
Nick Dimiduk commented on HBASE-7941:
-------------------------------------
One approache would be to expose language primitive types for qualifiers and
values. This has the benefit of hiding from the user the implementation details
of serialization of the types. However, I fear this would bloat the API
excessively. Such an implementation would need, say a {{Put#add}} method with
all combinations (byte[], String, int, long, double, &c) for qualifier coupled
with all combinations for value. This could be somewhat mitigated if such
methods accepted a builder pattern for constructing their arguments, ie
{{put.add(family).withQualifier("foo").withValue(5L);}}. Which leads me to...
An alternative would be to accept (in addition to byte[]) the base type for the
serialization implementation. Now you have only a cardinality of two for both
parameters, resulting in a smaller number of method signatures to maintain.
That is,
{noformat}
Put#add(byte[] family, byte[] qualifier, byte[] value)
Put#add(byte[] family, byte[] qualifier, <SerializationType> value)
Put#add(byte[] family, <SerializationType> qualifier, byte[] value)
Put#add(byte[] family, <SerializationType> qualifier, <SerializationType> value)
{noformat}
Since both proposed implementations provide a builder pattern for constructing
serialized objects, I see no reason to add additional helper constructs all
over the place.
> Provide client API with support for primitive types
> ---------------------------------------------------
>
> Key: HBASE-7941
> URL: https://issues.apache.org/jira/browse/HBASE-7941
> Project: HBase
> Issue Type: Improvement
> Components: Client
> Reporter: Nick Dimiduk
>
> Work is underway to provide a widely acceptable serialization format for
> primitive and complex types (HBASE-7221, HBASE-7692). With this completed,
> those serialization conveniences should be pushed up to users of the Client
> API by way of additional method signatures on Operation implementations (Get,
> Put, Delete, Scan, &c.).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira