hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Purtell <apurt...@apache.org>
Subject Re: HBase Utility functions (for Java 5+)
Date Wed, 16 Dec 2009 00:28:31 GMT
Thanks for the feedback Paul.

I agree the Builder pattern is an interesting option. Please see
https://issues.apache.org/jira/browse/HBASE-2051

    - Andy




________________________________
From: Paul Smith <psmith@aconex.com>
To: hbase-user@hadoop.apache.org
Sent: Tue, December 15, 2009 3:21:44 PM
Subject: Re: HBase Utility functions (for Java 5+)


On 16/12/2009, at 7:04 AM, stack wrote:

> On Tue, Dec 15, 2009 at 9:56 AM, Kevin Peterson <kevinpet@gmail.com> wrote:
> 
>> These kinds of cleaner APIs would be a good way to prevent the standard
>> situation of one engineer on the team figuring out HBase, then others say
>> "why is this so complicated" so they write an internal set of wrappers and
>> utility methods.
>> 
> 
> This wouldn't solve the problems for people who want a full ORM, but I think
>> there's an in-between sweet spot that abstracts away byte[] but still
>> exposes column families and such.
>> 
> 
> 
> What do fellas think of Lars' George's genercizing (sp? word?) of the client
> API?  See his patch up in https://issues.apache.org/jira/browse/HBASE-1990.
> Would this be enough?
> St.Ack

That's a pretty good start, but I think a good collection of useful builders and utilities
that handle the 80% case will help HBase gain much more traction.  As an person starting with
HBase, there are a lot of concepts to get, Bytes definitely get in the way of seeing the real
underlying patterns.  I'm a total believer in understanding the internals to get the best
out of a product, but that often comes after experimentation, and these high-level libraries
grease the wheels for faster 'grok'ing the concepts.

Thinking out loud here, but something like this may be useful (more useful?, I dunno, I'm
still used to this):

PutBuilder builder = new PutBuilder(hTable);
// first Row
builder.withRowKey(1stRowKey).withColumnFamily("foo").put("columnA", valueA).put("columnB",valueB);
// secondRow
builder.withRowKey(2ndRowKey).withColumnFamily("eek").put("columnC", valueC).put("columnD",valueD);
...
builder.putAll();

I also feel a little silly, because I've only JUST discovered the Writables class, my initial
example of packing 4 ints is silly, a simple Class that implements Writeable is a much more
elegant solution (I wasn't sure why Bytes.add(..) only took 2 or 3 args).

Paul


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message