You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/05/12 20:47:59 UTC
svn commit: r1102418 - in /hbase/branches/0.90: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Author: stack
Date: Thu May 12 18:47:59 2011
New Revision: 1102418
URL: http://svn.apache.org/viewvc?rev=1102418&view=rev
Log:
HBASE-3878 Hbase client throws NoSuchElementException
Modified:
hbase/branches/0.90/CHANGES.txt
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1102418&r1=1102417&r2=1102418&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Thu May 12 18:47:59 2011
@@ -3,6 +3,7 @@ Release 0.90.4 - Unreleased
BUG FIXES
HBASE-3617 NoRouteToHostException during balancing will cause Master abort
(Ted Yu)
+ HBASE-3878 Hbase client throws NoSuchElementException (Ted Yu)
Release 0.90.3 - Unreleased
BUG FIXES
Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1102418&r1=1102417&r2=1102418&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java Thu May 12 18:47:59 2011
@@ -26,6 +26,7 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.NoSuchElementException;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;
@@ -833,8 +834,12 @@ public class HConnectionManager {
// we need to examine the cached location to verify that it is
// a match by end key as well.
if (!matchingRegions.isEmpty()) {
- HRegionLocation possibleRegion =
- matchingRegions.get(matchingRegions.lastKey());
+ HRegionLocation possibleRegion = null;
+ try {
+ possibleRegion = matchingRegions.get(matchingRegions.lastKey());
+ } catch (NoSuchElementException nsee) {
+ LOG.warn("checkReferences() might have removed the key", nsee);
+ }
// there is a possibility that the reference was garbage collected
// in the instant since we checked isEmpty().