You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Doug Meil (JIRA)" <ji...@apache.org> on 2009/11/18 22:50:39 UTC

[jira] Created: (HBASE-1990) Add methods accepting strings for family/qualifier in client

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



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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780013#action_12780013 ] 

Andrew Purtell commented on HBASE-1990:
---------------------------------------

{quote}
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.
{quote}

No worries.

{quote}
2) I am assuming that the value is still going to take 'byte[]'
{quote}

Having convenience functions to address values with strings at user request I think is fine. But, HBase is really type agnostic with respect to both keys and values. Storing something as String does not and should not imply the String type is suitable representation for the value, or Integer, or Boolean, etc. 

> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782149#action_12782149 ] 

stack commented on HBASE-1990:
------------------------------

If we add in generic HTable, I think that would make this a non-0.20 change... Would be done in 0.21.

> 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.20.3, 0.21.0
>
>         Attachments: TestHTableGenerics.java
>
>
> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779742#action_12779742 ] 

stack commented on HBASE-1990:
------------------------------

+1 But you might want to wait Andrew.  I think Doug might have someone for the job (Doug?).

> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779684#action_12779684 ] 

Andrew Purtell commented on HBASE-1990:
---------------------------------------

This is no problem. As long as nobody votes this down I'll put in the convenience methods. 

> 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
>             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.


[jira] Updated: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Purtell updated HBASE-1990:
----------------------------------

    Assignee:     (was: Andrew Purtell)

> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Doug Meil (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780138#action_12780138 ] 

stack commented on HBASE-1990:
------------------------------

Lars, this sounds sweet.  Can you sketch more what a genericised (sp?) HTable would look like?

> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791703#action_12791703 ] 

stack commented on HBASE-1990:
------------------------------

@Vaibhav Good point

@Lars You mean byte [] , rather byte in your example above?   If so, that'd work.  As would our suggestion of an LCD Object.  Vaibhav, what you think of Lars' suggestion?

> 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.20.3, 0.21.0
>
>         Attachments: TestHTableGenerics.java
>
>
> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782138#action_12782138 ] 

stack commented on HBASE-1990:
------------------------------

I like this direction.  It does more than just String.  Regards the API change, if we changed all Put, Delete, Get, etc. to do generics instead, would it just add warnings since the old and new should erase to the same types?  Or would old compile not compile at all?

> 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.20.3, 0.21.0
>
>         Attachments: TestHTableGenerics.java
>
>
> 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.


[jira] Updated: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Purtell updated HBASE-1990:
----------------------------------

      Description: 
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.






  was:

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.






         Priority: Minor  (was: Major)
    Fix Version/s: 0.20.3
                   0.21.0
         Assignee: Andrew Purtell

> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Lars George (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Lars George (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars George updated HBASE-1990:
-------------------------------

    Attachment: TestHTableGenerics.java

TestHTableGenerics.java is a sample of how we could add generics support to the classes. Now, this could be in a contrib package, but maybe even in the standard API. Biggest issue is of course the API change again. And we want to keep the API as simple as possible I would assume and with byte[] it is already as generic as possible. 

I would opt for those classes to be in contrib, fully implemented of course and properly layed out and tested. My classes above are just an attempt to show a general idea, which is how to make a wrapper framework that adds all the various type support. 

What do you all think?

> 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
>
>         Attachments: TestHTableGenerics.java
>
>
> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Lars George (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791431#action_12791431 ] 

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

Vaibhav,

I think the idea was to use that as an optional "wrapper" around the purely byte oriented low level classes. Also, you can always still do this

{code}
Put<String, String, String, byte> put = new Put<String, String, String, byte>("row1");
put.add("family", "stringtest", Bytes.toBytes("stringdata"));
{code}

and do the value conversion to byte yourself. Or we add a "Object" type parameter and convert the value from Long, String, etc. internally (like an "auto boxing" or marshalling).

> 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.20.3, 0.21.0
>
>         Attachments: TestHTableGenerics.java
>
>
> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Vaibhav Puranik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790971#action_12790971 ] 

Vaibhav Puranik commented on HBASE-1990:
----------------------------------------

The concept of  TestHTableGenerics.java is good, but unfortunately it might not work even for simpler use cases. Let's discuss the following example:
{noformat}
Put<String, String, String, String> put =      new Put<String, String, String, String>("row1");
    put.add("family", "stringtest", "stringdata");
    ht.put(put.getPut());
{noformat}
The above example forces you to pick a data type for values at the instantiation of the Put object. But in most cases (at least in our software) we have different data types in a row such as Long, String, Custom Object etc.
Even a typical relational database table always have multiple data types in a row.

If you exclude the value and keep the value as byte array, it should be sufficient for 80% of the use cases. (Even though we have many columns where the column name is not a string, they are a minority)

> 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.20.3, 0.21.0
>
>         Attachments: TestHTableGenerics.java
>
>
> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Lars George (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780515#action_12780515 ] 

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

Will do. Let me try to do a proof in a unit test and then propose a solution.

> 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.


[jira] Updated: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-1990:
-------------------------

    Fix Version/s:     (was: 0.20.3)

Moving out of 0.20.3  I like Lars suggestion and looks like it would work after some discussion but this change in API better belongs in 0.21 IMO. Since 0.21 is not too far away, I'd say no harm punting it till then.  If anyone disagrees, please put it back into 0.20.3.

> 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
>
>         Attachments: TestHTableGenerics.java
>
>
> 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.


[jira] Commented: (HBASE-1990) Add methods accepting strings for family/qualifier in client

Posted by "Vaibhav Puranik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791728#action_12791728 ] 

Vaibhav Puranik commented on HBASE-1990:
----------------------------------------

It will be great if we could do autoboxing somehow for most common data types. That would certainly help. 

> 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.20.3, 0.21.0
>
>         Attachments: TestHTableGenerics.java
>
>
> 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.