Return-Path: Delivered-To: apmail-lucene-hadoop-commits-archive@locus.apache.org Received: (qmail 74855 invoked from network); 12 Jun 2007 21:08:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jun 2007 21:08:50 -0000 Received: (qmail 42503 invoked by uid 500); 12 Jun 2007 21:08:53 -0000 Delivered-To: apmail-lucene-hadoop-commits-archive@lucene.apache.org Received: (qmail 42414 invoked by uid 500); 12 Jun 2007 21:08:53 -0000 Mailing-List: contact hadoop-commits-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-commits@lucene.apache.org Received: (qmail 42370 invoked by uid 99); 12 Jun 2007 21:08:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 14:08:52 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 14:08:48 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id A388C1A981A; Tue, 12 Jun 2007 14:08:28 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r546635 - in /lucene/hadoop/trunk/src/contrib/hbase: CHANGES.txt src/java/org/apache/hadoop/hbase/HClient.java Date: Tue, 12 Jun 2007 21:08:28 -0000 To: hadoop-commits@lucene.apache.org From: jimk@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070612210828.A388C1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jimk Date: Tue Jun 12 14:08:27 2007 New Revision: 546635 URL: http://svn.apache.org/viewvc?view=rev&rev=546635 Log: HADOOP-1469 Asychronous table creation Modified: lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HClient.java Modified: lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt?view=diff&rev=546635&r1=546634&r2=546635 ============================================================================== --- lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt (original) +++ lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt Tue Jun 12 14:08:27 2007 @@ -30,3 +30,4 @@ visibility (HADOOP-1466) 16. HADOOP-1479 Fix NPE in HStore#get if store file only has keys < passed key. 17. HADOOP-1476 Distributed version of 'Performance Evaluation' script + 18. HADOOP-1469 Asychronous table creation Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HClient.java URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HClient.java?view=diff&rev=546635&r1=546634&r2=546635 ============================================================================== --- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HClient.java (original) +++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HClient.java Tue Jun 12 14:08:27 2007 @@ -207,38 +207,48 @@ /** * Creates a new table * - * @param desc - table descriptor for table + * @param desc table descriptor for table * - * @throws IllegalArgumentException - if the table name is reserved - * @throws MasterNotRunningException - if master is not running - * @throws NoServerForRegionException - if root region is not being served + * @throws IllegalArgumentException if the table name is reserved + * @throws MasterNotRunningException if master is not running + * @throws NoServerForRegionException if root region is not being served * @throws IOException */ - public synchronized void createTable(HTableDescriptor desc) throws IOException { - checkReservedTableName(desc.getName()); - checkMaster(); - try { - this.master.createTable(desc); - - } catch(RemoteException e) { - handleRemoteException(e); - } + public synchronized void createTable(HTableDescriptor desc) + throws IOException { + createTableAsync(desc); // Save the current table - SortedMap oldServers = this.tableServers; - try { // Wait for new table to come on-line - findServersForTable(desc.getName()); - } finally { if(oldServers != null && oldServers.size() != 0) { // Restore old current table if there was one - this.tableServers = oldServers; } + } + } + + /** + * Creates a new table but does not block and wait for it to come online. + * + * @param desc table descriptor for table + * + * @throws IllegalArgumentException if the table name is reserved + * @throws MasterNotRunningException if master is not running + * @throws NoServerForRegionException if root region is not being served + * @throws IOException + */ + public synchronized void createTableAsync(HTableDescriptor desc) + throws IOException { + checkReservedTableName(desc.getName()); + checkMaster(); + try { + this.master.createTable(desc); + } catch (RemoteException e) { + handleRemoteException(e); } }