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