Return-Path: Delivered-To: apmail-hadoop-hbase-commits-archive@minotaur.apache.org Received: (qmail 54856 invoked from network); 29 Sep 2009 21:07:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Sep 2009 21:07:02 -0000 Received: (qmail 71740 invoked by uid 500); 29 Sep 2009 21:07:02 -0000 Delivered-To: apmail-hadoop-hbase-commits-archive@hadoop.apache.org Received: (qmail 71709 invoked by uid 500); 29 Sep 2009 21:07:02 -0000 Mailing-List: contact hbase-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-commits@hadoop.apache.org Received: (qmail 71700 invoked by uid 99); 29 Sep 2009 21:07:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2009 21:07:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2009 21:07:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C83C923888BB; Tue, 29 Sep 2009 21:06:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r820089 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/client/MetaScanner.java Date: Tue, 29 Sep 2009 21:06:40 -0000 To: hbase-commits@hadoop.apache.org From: stack@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090929210640.C83C923888BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stack Date: Tue Sep 29 21:06:40 2009 New Revision: 820089 URL: http://svn.apache.org/viewvc?rev=820089&view=rev Log: HBASE-1874 Client Scanner mechanism that is used for HbaseAdmin methods (listTables, tableExists), is very slow if the client is far away from the HBase cluster Modified: hadoop/hbase/trunk/CHANGES.txt hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/MetaScanner.java Modified: hadoop/hbase/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=820089&r1=820088&r2=820089&view=diff ============================================================================== --- hadoop/hbase/trunk/CHANGES.txt (original) +++ hadoop/hbase/trunk/CHANGES.txt Tue Sep 29 21:06:40 2009 @@ -87,6 +87,9 @@ HBASE-1855 HMaster web application doesn't show the region end key in the table detail page (Andrei Dragomir via Stack) HBASE-1870 Bytes.toFloat(byte[], int) is marked private + HBASE-1874 Client Scanner mechanism that is used for HbaseAdmin methods + (listTables, tableExists), is very slow if the client is far + away from the HBase cluster (Andrei Dragomir via Stack) OPTIMIZATIONS Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/MetaScanner.java URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/MetaScanner.java?rev=820089&r1=820088&r2=820089&view=diff ============================================================================== --- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/MetaScanner.java (original) +++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/MetaScanner.java Tue Sep 29 21:06:40 2009 @@ -47,20 +47,26 @@ // Scan over each meta region ScannerCallable callable = null; + int rows = configuration.getInt("hbase.meta.scanner.caching", 100); do { Scan scan = new Scan(startRow).addFamily(CATALOG_FAMILY); callable = new ScannerCallable(connection, META_TABLE_NAME, scan); // Open scanner connection.getRegionServerWithRetries(callable); try { - Result r = null; - do { + callable.setCaching(rows); + done: do { + //we have all the rows here Result [] rrs = connection.getRegionServerWithRetries(callable); if (rrs == null || rrs.length == 0 || rrs[0].size() == 0) { - break; + break done; //exit completely } - r = rrs[0]; - } while(visitor.processRow(r)); + for (int i = 0; i < rrs.length; i++) { + if (!visitor.processRow(rrs[i])) + break done; //exit completely + } + //here, we didn't break anywhere. Check if we have more rows + } while(true); // Advance the startRow to the end key of the current region startRow = callable.getHRegionInfo().getEndKey(); } finally {