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

Lars George commented on HBASE-1990:
------------------------------------

What about lightweight wrapper classes in contrib that expose these String 
based methods? Or - if possible and you want to go crazy - adds generics that 
denote the type you want. Internally you use that to call the right 
Bytes.toXYZ() method. That way this leaves the API unchanged being type 
agnostic and that wrapper would take care of more than just String types?

> Add methods accepting strings for family/qualifier in client 
> -------------------------------------------------------------
>
>                 Key: HBASE-1990
>                 URL: https://issues.apache.org/jira/browse/HBASE-1990
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Doug Meil
>            Priority: Minor
>             Fix For: 0.21.0, 0.20.3
>
>
> Consider the following client code...
>       byte b[] = result.getValue( Bytes.toBytes("family"), 
> Bytes.toBytes("qualifier") );
>         put.add( Bytes.toBytes("family"), Bytes.toBytes("qualifer"), 
> Bytes.toBytes( "value")  );
> ... the requirement to supply family and qualifiers as bytes causes code to 
> get cluttered and verbose.  At worst, it scares peoples un-necessarily about 
> HBase development, and at best, developers inevitably will get tired of doing 
> all this casting and then add their own wrapper classes around the HBase 
> client to make their code more readable.
> I would like to see something like this in the API...
>       byte b[] = result.getValue( "family"), "qualifier" );
>         put.add( "family", "qualifer", Bytes.toBytes( "value")  );
> ... where the Hbase client can perform the required Bytes.toBytes() 
> conversion behind the scenes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to