HBASE-1934 NullPointerException in ClientScanner

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@829703 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-10-26 05:23:53 +00:00
parent a4c81cdd30
commit e5f6c67f0d
2 changed files with 8 additions and 35 deletions

View File

@ -82,6 +82,7 @@ Release 0.21.0 - Unreleased
HBASE-1925 IllegalAccessError: Has not been initialized (getMaxSequenceId)
HBASE-1929 If hbase-default.xml is not in CP, zk session timeout is 10 secs!
HBASE-1927 Scanners not closed properly in certain circumstances
HBASE-1934 NullPointerException in ClientScanner (Daniel Ploeg via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -834,36 +834,6 @@ public class HTable implements HTableInterface {
return s;
}
/**
* @param endKey
* @return Returns true if the passed region endkey is judged beyond
* filter.
*/
private boolean filterSaysStop(final byte [] endKey) {
if (scan.getStopRow().length > 0) {
// there is a stop row, check to see if we are past it.
byte [] stopRow = scan.getStopRow();
int cmp = Bytes.compareTo(stopRow, 0, stopRow.length,
endKey, 0, endKey.length);
if (cmp <= 0) {
// stopRow <= endKey (endKey is equals to or larger than stopRow)
// This is a stop.
return true;
}
}
if(!scan.hasFilter()) {
return false;
}
if (scan.getFilter() != null) {
// Let the filter see current row.
scan.getFilter().filterRowKey(endKey, 0, endKey.length);
return scan.getFilter().filterAllRemaining();
}
return false; //unlikely.
}
public Result next() throws IOException {
// If the scanner is closed but there is some rows left in the cache,
// it will first empty it before returning null
@ -897,12 +867,14 @@ public class HTable implements HTableInterface {
}
// Else, its signal from depths of ScannerCallable that we got an
// NSRE on a next and that we need to reset the scanner.
this.scan.setStartRow(this.lastResult.getRow());
// Clear region as flag to nextScanner to use this.scan.startRow.
if (this.lastResult != null) {
this.scan.setStartRow(this.lastResult.getRow());
// Skip first row returned. We already let it out on previous
// invocation.
skipFirst = true;
}
// Clear region
this.currentRegion = null;
// Skip first row returned. We already let it out on previous
// invocation.
skipFirst = true;
continue;
} catch (IOException e) {
if (e instanceof UnknownScannerException &&