Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@minotaur.apache.org Received: (qmail 15597 invoked from network); 15 Dec 2009 06:03:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Dec 2009 06:03:45 -0000 Received: (qmail 27540 invoked by uid 500); 15 Dec 2009 06:03:44 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 27446 invoked by uid 500); 15 Dec 2009 06:03:42 -0000 Mailing-List: contact hbase-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-user@hadoop.apache.org Delivered-To: mailing list hbase-user@hadoop.apache.org Received: (qmail 27433 invoked by uid 99); 15 Dec 2009 06:03:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Dec 2009 06:03:42 +0000 X-ASF-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of saint.ack@gmail.com designates 74.125.92.25 as permitted sender) Received: from [74.125.92.25] (HELO qw-out-2122.google.com) (74.125.92.25) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Dec 2009 06:03:40 +0000 Received: by qw-out-2122.google.com with SMTP id 3so737130qwe.35 for ; Mon, 14 Dec 2009 22:03:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=jHJEk3bUauF/JWQs73F3JonRe8EutM5bz34osxok5bo=; b=D4ITCA7PHstigHMb/RSRdjeNv0G0VWslyDfZUwdZAWmkm7h1ZPAZcBXauQxe7oAC0v 6bRuxGTPPe6TCVzhlfZ/eg4k0ImQ4femSRHBpKebrIZmCYEDISwIUUVS5t7W+VihrdVi MqYezwIq+zJjQQAeLmUPCcc/bZI3Ydjr85seU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=DZoqJ/3v75yvNOp6NCre/Vo5esfGSqagDyTd0osFZ/QWWt1SO5DSrFyorH4S19FWXQ Ehd7zRjZ/LalgSRORoILlmdq0GJSEPxh+EG0HURou4HuzpwZgP3rHzYPd9xokioqO/Lw mnk8jibw7vhVvIWeGybf4FR3DPh4fTiT/6AXM= MIME-Version: 1.0 Sender: saint.ack@gmail.com Received: by 10.229.102.165 with SMTP id g37mr3125719qco.65.1260856999422; Mon, 14 Dec 2009 22:03:19 -0800 (PST) In-Reply-To: References: Date: Mon, 14 Dec 2009 22:03:19 -0800 X-Google-Sender-Auth: bdc3e1bededbdcaf Message-ID: <7c962aed0912142203p67ab3803xdf6c697e45a6f0da@mail.gmail.com> Subject: Re: HBase Utility functions (for Java 5+) From: stack To: hbase-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=002354470674902be1047abe2520 --002354470674902be1047abe2520 Content-Type: text/plain; charset=ISO-8859-1 HBase requires java 6 (1.6) or above. St.Ack On Mon, Dec 14, 2009 at 7:41 PM, Paul Smith wrote: > Just wondering if anyone knows of an existing Hbase utility library that is > open sourced that can assist those that have Java5 and above. I'm starting > off in Hbase, and thinking it'd be great to have API calls similar to the > Google Collections framework. If one doesn't exist, I think I could start > off a new project in Google Code (ASL it). I think Hbase is targetted < > Java 5, so can't take advantage of this yet internally. > > The sorts of API functions I thought would be useful to make code more > readable would be something like: > > > HTable hTable = new > TableBuilder(hbaseConfiguration).withTableName("foo") > .withSimpleColumnFamilies("bar", "eek", > "moo").deleteAndRecreate(); > > and > > ResultScanner scanner = new > ResultScannerBuilder(hTable).withColumnFamilies( > "family1", "family2").build(); > > > taking advantage of varargs liberally and using nice Patterns etc. While > the Bytes class is useful, I'd personally benefit from an API that can > easily pack arbitrary multiple ints (and other data types) together into > byte[] for RowKeyGoodness(tm) ala: > > byte[] rowKey = BytePacker.pack(fooId, barId, eekId, mooId); > > (behind the scenes this is a vararg method that recursively packs each into > into byte[] via Bytes.add(byte[] b1, byte[] b2) etc. > > If anyone knows of a library that does this, pointers please. > > cheers, > > Paul --002354470674902be1047abe2520--