hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Meil (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client
Date Thu, 19 Nov 2009 14:41:39 GMT

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

Doug Meil commented on HBASE-1990:
----------------------------------

I'll give it a shot.  :-)

Two questions: 

1) what timeframe?  (i.e., I'm expecting to try this 'soon' but not by tomorrow morning).
 Even though this is small, this would be my first attempt at an HBase change and I don't
want to screw it up.

2) I am assuming that the value is still going to take 'byte[]'.  I think it would be nice
to have methods that also took String (et al.) and "did the right thing" internally, but the
.get methods would get a little more complicated since overloading doesn't work with return
values (and they would probably need to be something like getString and getInt, etc.).  Any
changes along this line I think would require a separate JIRA ticket.

> 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
>            Assignee: Andrew Purtell
>            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.


Mime
View raw message