hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r820088 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/client/MetaScanner.java
Date Tue, 29 Sep 2009 21:05:30 GMT
Author: stack
Date: Tue Sep 29 21:05:29 2009
New Revision: 820088

URL: http://svn.apache.org/viewvc?rev=820088&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/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/MetaScanner.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=820088&r1=820087&r2=820088&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Tue Sep 29 21:05:29 2009
@@ -57,6 +57,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(bytes[],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)
 
 Release 0.20.0 - Tue Sep  8 12:48:41 PDT 2009
 

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/MetaScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/MetaScanner.java?rev=820088&r1=820087&r2=820088&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/MetaScanner.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/MetaScanner.java Tue
Sep 29 21:05:29 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 {



Mime
View raw message