HADOOP-1941 StopRowFilter throws NPE when passed null row
git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@579410 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
87f305b608
commit
ccf42acf70
@ -61,6 +61,7 @@ Trunk (unreleased changes)
|
|||||||
HADOOP-1923, HADOOP-1924 a) tests fail sporadically because set up and tear
|
HADOOP-1923, HADOOP-1924 a) tests fail sporadically because set up and tear
|
||||||
down is inconsistent b) TestDFSAbort failed in nightly #242
|
down is inconsistent b) TestDFSAbort failed in nightly #242
|
||||||
HADOOP-1929 Add hbase-default.xml to hbase jar
|
HADOOP-1929 Add hbase-default.xml to hbase jar
|
||||||
|
HADOOP-1941 StopRowFilter throws NPE when passed null row
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HADOOP-1737 Make HColumnDescriptor data publically members settable
|
HADOOP-1737 Make HColumnDescriptor data publically members settable
|
||||||
|
@ -98,6 +98,12 @@ public class StopRowFilter implements RowFilterInterface {
|
|||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public boolean filter(final Text rowKey) {
|
public boolean filter(final Text rowKey) {
|
||||||
|
if (rowKey == null) {
|
||||||
|
if (this.stopRowKey == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
boolean result = this.stopRowKey.compareTo(rowKey) <= 0;
|
boolean result = this.stopRowKey.compareTo(rowKey) <= 0;
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("Filter result for rowKey: " + rowKey + ". Result: " +
|
LOG.debug("Filter result for rowKey: " + rowKey + ". Result: " +
|
||||||
|
@ -87,5 +87,7 @@ public class TestStopRowFilter extends TestCase {
|
|||||||
|
|
||||||
assertFalse("FilterAllRemaining", filter.filterAllRemaining());
|
assertFalse("FilterAllRemaining", filter.filterAllRemaining());
|
||||||
assertFalse("FilterNotNull", filter.filterNotNull(null));
|
assertFalse("FilterNotNull", filter.filterNotNull(null));
|
||||||
|
|
||||||
|
assertFalse("Filter a null", filter.filter(null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user