From 8e047c5801fd44a2aaebcd7968e248955c4a20d4 Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Tue, 6 Jan 2009 10:20:22 +0000 Subject: [PATCH] HBASE-1101 NPE in HConnectionManager.processBatchOfRows; restore original (and correct) reload behavior git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@731904 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/hbase/client/HConnectionManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 6c684bb9f7c..3caf4dc8d02 100644 --- a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -874,13 +874,12 @@ public class HConnectionManager implements HConstants { } private HRegionLocation - getRegionLocationForRowWithRetries(byte[] tableName, byte[] rowKey) - throws IOException { + getRegionLocationForRowWithRetries(byte[] tableName, byte[] rowKey, + boolean reload) throws IOException { getMaster(); List exceptions = new ArrayList(); HRegionLocation location = null; int tries = 0; - boolean reload = false; while (tries < numRetries) { try { location = getRegionLocation(tableName, rowKey, reload); @@ -915,7 +914,8 @@ public class HConnectionManager implements HConstants { Collections.sort(list); List tempUpdates = new ArrayList(); 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 @@ public class HConnectionManager implements HConstants { 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 @@ public class HConnectionManager implements HConstants { 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 {