Author: stack
Date: Fri Feb 1 16:51:38 2008
New Revision: 617724
URL: http://svn.apache.org/viewvc?rev=617724&view=rev
Log:
HADOOP-2693 NPE in getClosestRowBefore
Modified:
hadoop/core/trunk/src/contrib/hbase/CHANGES.txt
hadoop/core/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HStore.java
Modified: hadoop/core/trunk/src/contrib/hbase/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/hbase/CHANGES.txt?rev=617724&r1=617723&r2=617724&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/hbase/CHANGES.txt (original)
+++ hadoop/core/trunk/src/contrib/hbase/CHANGES.txt Fri Feb 1 16:51:38 2008
@@ -15,6 +15,7 @@
BUG FIXES
HADOOP-2731 Under load, regions become extremely large and eventually cause
region servers to become unresponsive
+ HADOOP-2693 NPE in getClosestRowBefore (Bryan Duxbury & Stack)
IMPROVEMENTS
HADOOP-2555 Refactor the HTable#get and HTable#getRow methods to avoid
Modified:
hadoop/core/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HStore.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HStore.java?rev=617724&r1=617723&r2=617724&view=diff
==============================================================================
---
hadoop/core/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HStore.java
(original)
+++
hadoop/core/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HStore.java
Fri Feb 1 16:51:38 2008
@@ -1830,20 +1830,13 @@
for(int i = maparray.length - 1; i >= 0; i--) {
Text row_from_mapfile =
rowAtOrBeforeFromMapFile(maparray[i], row, timestamp);
-
- // for when we have MapFile.Reader#getClosest before functionality
-/* Text row_from_mapfile = null;
- WritableComparable value = null;
-
- HStoreKey hskResult =
- (HStoreKey)maparray[i].getClosest(rowKey, value, true);
-
- if (hskResult != null) {
- row_from_mapfile = hskResult.getRow();
- }*/
-
-/* LOG.debug("Best from this mapfile was " + row_from_mapfile);*/
+ // if the result from the mapfile is null, then we know that
+ // the mapfile was empty and can move on to the next one.
+ if (row_from_mapfile == null) {
+ continue;
+ }
+
// short circuit on an exact match
if (row.equals(row_from_mapfile)) {
return row;
@@ -1855,7 +1848,6 @@
}
}
-/* LOG.debug("Went searching for " + row + ", found " + bestSoFar);*/
return bestSoFar;
} finally {
this.lock.readLock().unlock();