HBASE-600 Filters have excessive DEBUG logging
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@654229 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b3f4ddc1bc
commit
eaa03f245b
|
@ -44,6 +44,7 @@ Hbase Change Log
|
||||||
the exception with a RetriesExhaustedException
|
the exception with a RetriesExhaustedException
|
||||||
HBASE-47 Option to set TTL for columns in hbase
|
HBASE-47 Option to set TTL for columns in hbase
|
||||||
(Andrew Purtell via Bryan Duxbury and Stack)
|
(Andrew Purtell via Bryan Duxbury and Stack)
|
||||||
|
HBASE-600 Filters have excessive DEBUG logging
|
||||||
|
|
||||||
Release 0.1.1 - 04/11/2008
|
Release 0.1.1 - 04/11/2008
|
||||||
|
|
||||||
|
|
|
@ -50,12 +50,7 @@ public class InclusiveStopRowFilter extends StopRowFilter{
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean result = this.stopRowKey.compareTo(rowKey) < 0;
|
return this.stopRowKey.compareTo(rowKey) < 0;
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Filter result for rowKey: " + rowKey + ". Result: " +
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,6 @@ import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.apache.hadoop.io.Text;
|
import org.apache.hadoop.io.Text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,8 +44,6 @@ public class PageRowFilter implements RowFilterInterface {
|
||||||
private long pageSize = Long.MAX_VALUE;
|
private long pageSize = Long.MAX_VALUE;
|
||||||
private int rowsAccepted = 0;
|
private int rowsAccepted = 0;
|
||||||
|
|
||||||
static final Log LOG = LogFactory.getLog(PageRowFilter.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor, filters nothing. Required though for RPC
|
* Default constructor, filters nothing. Required though for RPC
|
||||||
* deserialization.
|
* deserialization.
|
||||||
|
@ -86,10 +82,6 @@ public class PageRowFilter implements RowFilterInterface {
|
||||||
@SuppressWarnings("unused") Text rowKey) {
|
@SuppressWarnings("unused") Text rowKey) {
|
||||||
if (!filtered) {
|
if (!filtered) {
|
||||||
this.rowsAccepted++;
|
this.rowsAccepted++;
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("rowProcessed incremented rowsAccepted to " +
|
|
||||||
this.rowsAccepted);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,12 +98,7 @@ public class PageRowFilter implements RowFilterInterface {
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public boolean filterAllRemaining() {
|
public boolean filterAllRemaining() {
|
||||||
boolean result = this.rowsAccepted > this.pageSize;
|
return this.rowsAccepted > this.pageSize;
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filtering decision is " + result + " with rowsAccepted: " +
|
|
||||||
this.rowsAccepted);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,8 +31,6 @@ import java.util.SortedMap;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.apache.hadoop.io.Text;
|
import org.apache.hadoop.io.Text;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.regionserver.HLogEdit;
|
import org.apache.hadoop.hbase.regionserver.HLogEdit;
|
||||||
|
@ -50,8 +48,6 @@ public class RegExpRowFilter implements RowFilterInterface {
|
||||||
private Map<Text, byte[]> equalsMap = new HashMap<Text, byte[]>();
|
private Map<Text, byte[]> equalsMap = new HashMap<Text, byte[]>();
|
||||||
private Set<Text> nullColumns = new HashSet<Text>();
|
private Set<Text> nullColumns = new HashSet<Text>();
|
||||||
|
|
||||||
static final Log LOG = LogFactory.getLog(RegExpRowFilter.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor, filters nothing. Required though for RPC
|
* Default constructor, filters nothing. Required though for RPC
|
||||||
* deserialization.
|
* deserialization.
|
||||||
|
@ -147,11 +143,7 @@ public class RegExpRowFilter implements RowFilterInterface {
|
||||||
*/
|
*/
|
||||||
public boolean filterRowKey(final Text rowKey) {
|
public boolean filterRowKey(final Text rowKey) {
|
||||||
if (filtersByRowKey() && rowKey != null) {
|
if (filtersByRowKey() && rowKey != null) {
|
||||||
boolean result = !getRowKeyPattern().matcher(rowKey.toString()).matches();
|
return !getRowKeyPattern().matcher(rowKey.toString()).matches();
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filter returning " + result + " for rowKey: " + rowKey);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -168,27 +160,14 @@ public class RegExpRowFilter implements RowFilterInterface {
|
||||||
if (filtersByColumnValue()) {
|
if (filtersByColumnValue()) {
|
||||||
byte[] filterValue = equalsMap.get(colKey);
|
byte[] filterValue = equalsMap.get(colKey);
|
||||||
if (null != filterValue) {
|
if (null != filterValue) {
|
||||||
boolean result = !Arrays.equals(filterValue, data);
|
return !Arrays.equals(filterValue, data);
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filter returning " + result + " for rowKey: " + rowKey +
|
|
||||||
" colKey: " + colKey);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nullColumns.contains(colKey)) {
|
if (nullColumns.contains(colKey)) {
|
||||||
if (data != null && !HLogEdit.isDeleted(data)) {
|
if (data != null && !HLogEdit.isDeleted(data)) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filter returning true for rowKey: " + rowKey +
|
|
||||||
" colKey: " + colKey);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filter returning false for rowKey: " + rowKey + " colKey: " +
|
|
||||||
colKey);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,25 +179,14 @@ public class RegExpRowFilter implements RowFilterInterface {
|
||||||
for (Entry<Text, byte[]> col : columns.entrySet()) {
|
for (Entry<Text, byte[]> col : columns.entrySet()) {
|
||||||
if (nullColumns.contains(col.getKey())
|
if (nullColumns.contains(col.getKey())
|
||||||
&& !HLogEdit.isDeleted(col.getValue())) {
|
&& !HLogEdit.isDeleted(col.getValue())) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filterNotNull returning true for colKey: " + col.getKey()
|
|
||||||
+ ", column should be null.");
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Text col : equalsMap.keySet()) {
|
for (Text col : equalsMap.keySet()) {
|
||||||
if (!columns.containsKey(col)) {
|
if (!columns.containsKey(col)) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filterNotNull returning true for colKey: " + col +
|
|
||||||
", column not found in given SortedMap<Text, byte[]>.");
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filterNotNull returning false.");
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@ import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.HBaseConfiguration;
|
import org.apache.hadoop.hbase.HBaseConfiguration;
|
||||||
import org.apache.hadoop.io.ObjectWritable;
|
import org.apache.hadoop.io.ObjectWritable;
|
||||||
|
@ -52,8 +50,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
private Operator operator = Operator.MUST_PASS_ALL;
|
private Operator operator = Operator.MUST_PASS_ALL;
|
||||||
private Set<RowFilterInterface> filters = new HashSet<RowFilterInterface>();
|
private Set<RowFilterInterface> filters = new HashSet<RowFilterInterface>();
|
||||||
|
|
||||||
static final Log LOG = LogFactory.getLog(RowFilterSet.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor, filters nothing. Required though for RPC
|
* Default constructor, filters nothing. Required though for RPC
|
||||||
* deserialization.
|
* deserialization.
|
||||||
|
@ -88,10 +84,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
public void validate(final Text[] columns) {
|
public void validate(final Text[] columns) {
|
||||||
for (RowFilterInterface filter : filters) {
|
for (RowFilterInterface filter : filters) {
|
||||||
filter.validate(columns);
|
filter.validate(columns);
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Validated subfilter of type " +
|
|
||||||
filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,10 +91,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
public void reset() {
|
public void reset() {
|
||||||
for (RowFilterInterface filter : filters) {
|
for (RowFilterInterface filter : filters) {
|
||||||
filter.reset();
|
filter.reset();
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Reset subfilter of type " +
|
|
||||||
filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,10 +98,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
public void rowProcessed(boolean filtered, Text rowKey) {
|
public void rowProcessed(boolean filtered, Text rowKey) {
|
||||||
for (RowFilterInterface filter : filters) {
|
for (RowFilterInterface filter : filters) {
|
||||||
filter.rowProcessed(filtered, rowKey);
|
filter.rowProcessed(filtered, rowKey);
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Called rowProcessed on subfilter of type " +
|
|
||||||
filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,10 +105,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
public boolean processAlways() {
|
public boolean processAlways() {
|
||||||
for (RowFilterInterface filter : filters) {
|
for (RowFilterInterface filter : filters) {
|
||||||
if (filter.processAlways()) {
|
if (filter.processAlways()) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("processAlways() is true due to subfilter of type " +
|
|
||||||
filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,25 +117,14 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
for (RowFilterInterface filter : filters) {
|
for (RowFilterInterface filter : filters) {
|
||||||
if (operator == Operator.MUST_PASS_ALL) {
|
if (operator == Operator.MUST_PASS_ALL) {
|
||||||
if (filter.filterAllRemaining()) {
|
if (filter.filterAllRemaining()) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("op.MPALL filterAllRemaining returning true due" +
|
|
||||||
" to subfilter of type " + filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (operator == Operator.MUST_PASS_ONE) {
|
} else if (operator == Operator.MUST_PASS_ONE) {
|
||||||
if (!filter.filterAllRemaining()) {
|
if (!filter.filterAllRemaining()) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("op.MPONE filterAllRemaining returning false due" +
|
|
||||||
" to subfilter of type " + filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filterAllRemaining default returning " + result);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,19 +136,11 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
if (!resultFound) {
|
if (!resultFound) {
|
||||||
if (operator == Operator.MUST_PASS_ALL) {
|
if (operator == Operator.MUST_PASS_ALL) {
|
||||||
if (filter.filterAllRemaining() || filter.filterRowKey(rowKey)) {
|
if (filter.filterAllRemaining() || filter.filterRowKey(rowKey)) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("op.MPALL filter(Text) will return true due" +
|
|
||||||
" to subfilter of type " + filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
result = true;
|
result = true;
|
||||||
resultFound = true;
|
resultFound = true;
|
||||||
}
|
}
|
||||||
} else if (operator == Operator.MUST_PASS_ONE) {
|
} else if (operator == Operator.MUST_PASS_ONE) {
|
||||||
if (!filter.filterAllRemaining() && !filter.filterRowKey(rowKey)) {
|
if (!filter.filterAllRemaining() && !filter.filterRowKey(rowKey)) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("op.MPONE filter(Text) will return false due" +
|
|
||||||
" to subfilter of type " + filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
result = false;
|
result = false;
|
||||||
resultFound = true;
|
resultFound = true;
|
||||||
}
|
}
|
||||||
|
@ -188,9 +149,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
filter.filterRowKey(rowKey);
|
filter.filterRowKey(rowKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filter(Text) returning " + result);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,22 +162,12 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
if (operator == Operator.MUST_PASS_ALL) {
|
if (operator == Operator.MUST_PASS_ALL) {
|
||||||
if (filter.filterAllRemaining() ||
|
if (filter.filterAllRemaining() ||
|
||||||
filter.filterColumn(rowKey, colKey, data)) {
|
filter.filterColumn(rowKey, colKey, data)) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("op.MPALL filter(Text, Text, byte[]) will" +
|
|
||||||
" return true due to subfilter of type " +
|
|
||||||
filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
result = true;
|
result = true;
|
||||||
resultFound = true;
|
resultFound = true;
|
||||||
}
|
}
|
||||||
} else if (operator == Operator.MUST_PASS_ONE) {
|
} else if (operator == Operator.MUST_PASS_ONE) {
|
||||||
if (!filter.filterAllRemaining() &&
|
if (!filter.filterAllRemaining() &&
|
||||||
!filter.filterColumn(rowKey, colKey, data)) {
|
!filter.filterColumn(rowKey, colKey, data)) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("op.MPONE filter(Text, Text, byte[]) will" +
|
|
||||||
" return false due to subfilter of type " +
|
|
||||||
filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
result = false;
|
result = false;
|
||||||
resultFound = true;
|
resultFound = true;
|
||||||
}
|
}
|
||||||
|
@ -228,9 +176,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
filter.filterColumn(rowKey, colKey, data);
|
filter.filterColumn(rowKey, colKey, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filter(Text, Text, byte[]) returning " + result);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,19 +187,11 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
if (!resultFound) {
|
if (!resultFound) {
|
||||||
if (operator == Operator.MUST_PASS_ALL) {
|
if (operator == Operator.MUST_PASS_ALL) {
|
||||||
if (filter.filterAllRemaining() || filter.filterRow(columns)) {
|
if (filter.filterAllRemaining() || filter.filterRow(columns)) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("op.MPALL filterNotNull will return true due" +
|
|
||||||
" to subfilter of type " + filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
result = true;
|
result = true;
|
||||||
resultFound = true;
|
resultFound = true;
|
||||||
}
|
}
|
||||||
} else if (operator == Operator.MUST_PASS_ONE) {
|
} else if (operator == Operator.MUST_PASS_ONE) {
|
||||||
if (!filter.filterAllRemaining() && !filter.filterRow(columns)) {
|
if (!filter.filterAllRemaining() && !filter.filterRow(columns)) {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("op.MPONE filterNotNull will return false due" +
|
|
||||||
" to subfilter of type " + filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
result = false;
|
result = false;
|
||||||
resultFound = true;
|
resultFound = true;
|
||||||
}
|
}
|
||||||
|
@ -263,9 +200,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
filter.filterRow(columns);
|
filter.filterRow(columns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("filterNotNull returning " + result);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,10 +215,6 @@ public class RowFilterSet implements RowFilterInterface {
|
||||||
RowFilterInterface filter = (RowFilterInterface) ObjectWritable
|
RowFilterInterface filter = (RowFilterInterface) ObjectWritable
|
||||||
.readObject(in, conf);
|
.readObject(in, conf);
|
||||||
filters.add(filter);
|
filters.add(filter);
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Successfully read in subfilter of type "
|
|
||||||
+ filter.getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,6 @@ import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.apache.hadoop.io.Text;
|
import org.apache.hadoop.io.Text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,8 +34,6 @@ public class StopRowFilter implements RowFilterInterface {
|
||||||
|
|
||||||
protected Text stopRowKey;
|
protected Text stopRowKey;
|
||||||
|
|
||||||
static final Log LOG = LogFactory.getLog(StopRowFilter.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor, filters nothing. Required though for RPC
|
* Default constructor, filters nothing. Required though for RPC
|
||||||
* deserialization.
|
* deserialization.
|
||||||
|
@ -104,12 +100,7 @@ public class StopRowFilter implements RowFilterInterface {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean result = this.stopRowKey.compareTo(rowKey) <= 0;
|
return this.stopRowKey.compareTo(rowKey) <= 0;
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Filter result for rowKey: " + rowKey + ". Result: " +
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,8 +24,6 @@ import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.apache.hadoop.io.Text;
|
import org.apache.hadoop.io.Text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,8 +38,6 @@ public class WhileMatchRowFilter implements RowFilterInterface {
|
||||||
private boolean filterAllRemaining = false;
|
private boolean filterAllRemaining = false;
|
||||||
private RowFilterInterface filter;
|
private RowFilterInterface filter;
|
||||||
|
|
||||||
static final Log LOG = LogFactory.getLog(WhileMatchRowFilter.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor, filters nothing. Required though for RPC
|
* Default constructor, filters nothing. Required though for RPC
|
||||||
* deserialization.
|
* deserialization.
|
||||||
|
@ -69,9 +65,6 @@ public class WhileMatchRowFilter implements RowFilterInterface {
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public void reset() {
|
public void reset() {
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Resetting.");
|
|
||||||
}
|
|
||||||
this.filterAllRemaining = false;
|
this.filterAllRemaining = false;
|
||||||
this.filter.reset();
|
this.filter.reset();
|
||||||
}
|
}
|
||||||
|
@ -95,34 +88,20 @@ public class WhileMatchRowFilter implements RowFilterInterface {
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public boolean filterRowKey(final Text rowKey) {
|
public boolean filterRowKey(final Text rowKey) {
|
||||||
changeFAR(this.filter.filterRowKey(rowKey));
|
changeFAR(this.filter.filterRowKey(rowKey));
|
||||||
boolean result = filterAllRemaining();
|
return filterAllRemaining();
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Filter on rowKey:" + rowKey + ". Result = " + result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public boolean filterColumn(final Text rowKey, final Text colKey,
|
public boolean filterColumn(final Text rowKey, final Text colKey,
|
||||||
final byte[] data) {
|
final byte[] data) {
|
||||||
changeFAR(this.filter.filterColumn(rowKey, colKey, data));
|
changeFAR(this.filter.filterColumn(rowKey, colKey, data));
|
||||||
boolean result = filterAllRemaining();
|
return filterAllRemaining();
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Filter on rowKey:" + rowKey + ", colKey: " + colKey +
|
|
||||||
", data: " + data + ". Result = " + result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public boolean filterRow(final SortedMap<Text, byte[]> columns) {
|
public boolean filterRow(final SortedMap<Text, byte[]> columns) {
|
||||||
changeFAR(this.filter.filterRow(columns));
|
changeFAR(this.filter.filterRow(columns));
|
||||||
boolean result = filterAllRemaining();
|
return filterAllRemaining();
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("FilterNotNull on cols:" + columns + ". Result = " +
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -133,10 +112,6 @@ public class WhileMatchRowFilter implements RowFilterInterface {
|
||||||
*/
|
*/
|
||||||
private void changeFAR(boolean value) {
|
private void changeFAR(boolean value) {
|
||||||
this.filterAllRemaining = this.filterAllRemaining || value;
|
this.filterAllRemaining = this.filterAllRemaining || value;
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("this.filterAllRemaining is now: " +
|
|
||||||
this.filterAllRemaining);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
@ -157,10 +132,6 @@ public class WhileMatchRowFilter implements RowFilterInterface {
|
||||||
this.filter = (RowFilterInterface)(Class.forName(className).
|
this.filter = (RowFilterInterface)(Class.forName(className).
|
||||||
newInstance());
|
newInstance());
|
||||||
this.filter.readFields(in);
|
this.filter.readFields(in);
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Successfully read a sub-filter of type: " +
|
|
||||||
className);
|
|
||||||
}
|
|
||||||
} catch (InstantiationException e) {
|
} catch (InstantiationException e) {
|
||||||
throw new RuntimeException("Failed to deserialize WhileMatchRowFilter.",
|
throw new RuntimeException("Failed to deserialize WhileMatchRowFilter.",
|
||||||
e);
|
e);
|
||||||
|
|
Loading…
Reference in New Issue