hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r731904 - /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Tue, 06 Jan 2009 10:20:24 GMT
Author: apurtell
Date: Tue Jan  6 02:20:22 2009
New Revision: 731904

URL: http://svn.apache.org/viewvc?rev=731904&view=rev
Log:
HBASE-1101 NPE in HConnectionManager.processBatchOfRows; restore original (and correct) reload
behavior

Modified:
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=731904&r1=731903&r2=731904&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java Tue
Jan  6 02:20:22 2009
@@ -874,13 +874,12 @@
     }
 
     private HRegionLocation
-    getRegionLocationForRowWithRetries(byte[] tableName, byte[] rowKey)
-        throws IOException {
+    getRegionLocationForRowWithRetries(byte[] tableName, byte[] rowKey, 
+        boolean reload) throws IOException {
       getMaster();
       List<Throwable> exceptions = new ArrayList<Throwable>();
       HRegionLocation location = null;
       int tries = 0;
-      boolean reload = false;
       while (tries < numRetries) {
         try {
           location = getRegionLocation(tableName, rowKey, reload);
@@ -915,7 +914,8 @@
       Collections.sort(list);
       List<BatchUpdate> tempUpdates = new ArrayList<BatchUpdate>();
       HRegionLocation location =
-        getRegionLocationForRowWithRetries(tableName, list.get(0).getRow());
+        getRegionLocationForRowWithRetries(tableName, list.get(0).getRow(),
+            false);
       byte [] currentRegion = location.getRegionInfo().getRegionName();
       byte [] region = currentRegion;
       boolean isLastRow = false;
@@ -925,7 +925,7 @@
         isLastRow = (i + 1) == list.size();
         if (!isLastRow) {
           location = getRegionLocationForRowWithRetries(tableName,
-            list.get(i+1).getRow());
+            list.get(i+1).getRow(), false);
           region = location.getRegionInfo().getRegionName();
         }
         if (!Bytes.equals(currentRegion, region) || isLastRow || retryOnlyOne) {
@@ -960,7 +960,7 @@
             i = i - updates.length + index;
             retryOnlyOne = true;
             location = getRegionLocationForRowWithRetries(tableName, 
-              list.get(i + 1).getRow());
+              list.get(i + 1).getRow(), true);
             region = location.getRegionInfo().getRegionName();
           }
           else {



Mime
View raw message