Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 4645 invoked from network); 25 Jun 2007 18:02:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2007 18:02:39 -0000 Received: (qmail 11122 invoked by uid 500); 25 Jun 2007 18:02:42 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 11104 invoked by uid 500); 25 Jun 2007 18:02:42 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 11095 invoked by uid 99); 25 Jun 2007 18:02:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jun 2007 11:02:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [204.209.205.52] (HELO mx01.telus.net) (204.209.205.52) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jun 2007 11:02:37 -0700 Received: from priv-edmwaa05.telusplanet.net ([207.81.126.109]) by priv-edmwes23.telusplanet.net (InterMail vM.7.08.02.00 201-2186-121-20061213) with ESMTP id <20070625180216.EZEE28684.priv-edmwes23.telusplanet.net@priv-edmwaa05.telusplanet.net> for ; Mon, 25 Jun 2007 12:02:16 -0600 Received: from [192.168.1.51] (d207-81-126-109.bchsia.telus.net [207.81.126.109]) by priv-edmwaa05.telusplanet.net (BorderWare MXtreme Infinity Mail Firewall) with ESMTP id 27VJRJBN5B for ; Mon, 25 Jun 2007 12:02:16 -0600 (MDT) Message-ID: <46800337.50109@troove.net> Date: Mon, 25 Jun 2007 11:02:31 -0700 From: James Kennedy User-Agent: Thunderbird 1.5.0.2 (X11/20060420) MIME-Version: 1.0 To: hadoop-dev@lucene.apache.org Subject: HBase HClient - Can we make it multi-table? References: <467AB5F5.4050605@apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I have an app that needs to access multiple HBase tables concurrently. The current HClient can only have one table open at a time even though it caches region servers of multiple tables as they are looked up. This means that my application layer must open multiple HClients, one per table, perhaps caching those HClients in a pool to reuse them (and their cached table data) as appropriate. or Shall I write an HClient patch that makes the HClient multi-table thread-safe? Essentially this would mean changing the interface to add table name parameters to methods like put(), commit(), startUpdate() etc, maintain a list of opened tables (as opposed to the single tableServers field), and ensure that it is thread-safe. I would also keep for each table a map for startUpdate() calls so that the the different rows of the same table could be updated concurrently. This would also make it possible to check for the rare case of clientid = rand.nextLong() collisions, if that's deemed necessary. Alternatively, perhaps what we need is something like an HClientManager/Factory which manages table info but gives out single-table HClients on request to be used for one-off transactions. This keeps the HClient simpler while keeping the cached regionInfo shared. Thoughts?