diff --git a/CHANGES.txt b/CHANGES.txt index cad655208a9..714d49ad892 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -198,6 +198,7 @@ Release 0.20.0 - Unreleased HBASE-1206 Scanner spins when there are concurrent inserts to column family HBASE-1536 Controlled crash of regionserver not hosting meta/root leaves master in spinning state, regions not reassigned + HBASE-1543 Unnecessary toString during scanning costs us some CPU IMPROVEMENTS HBASE-1089 Add count of regions on filesystem to master UI; add percentage diff --git a/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java b/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java index b92a42174ae..d604e87dc9d 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java @@ -20,15 +20,14 @@ package org.apache.hadoop.hbase.regionserver; +import java.util.NavigableSet; + import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.filter.RowFilterInterface; -import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.filter.Filter.ReturnCode; - -import java.io.IOException; -import java.util.NavigableSet; +import org.apache.hadoop.hbase.util.Bytes; /** * A query matcher that is specifically designed for the scan case. @@ -94,11 +93,9 @@ public class ScanQueryMatcher extends QueryMatcher { return MatchCode.DONE_SCAN; } - String kvStr = kv.toString(); byte [] bytes = kv.getBuffer(); int offset = kv.getOffset(); int initialOffset = offset; - int kvLength = kv.getLength(); int keyLength = Bytes.toInt(bytes, offset, Bytes.SIZEOF_INT); offset += KeyValue.ROW_OFFSET; @@ -171,13 +168,11 @@ public class ScanQueryMatcher extends QueryMatcher { return MatchCode.SKIP; } - if (deletes.isDeleted(bytes, offset, - qualLength, timestamp)) { + if (deletes.isDeleted(bytes, offset, qualLength, timestamp)) { return MatchCode.SKIP; } - - MatchCode colChecker = - columns.checkColumn(bytes, offset, qualLength); + + MatchCode colChecker = columns.checkColumn(bytes, offset, qualLength); // if SKIP -> SEEK_NEXT_COL // if (NEXT,DONE) -> SEEK_NEXT_ROW @@ -202,8 +197,7 @@ public class ScanQueryMatcher extends QueryMatcher { if (filterResponse == ReturnCode.SKIP) return MatchCode.SKIP; - // else - //if (filterResponse == ReturnCode.NEXT_ROW) + // else if (filterResponse == ReturnCode.NEXT_ROW) stickyNextRow = true; return MatchCode.SEEK_NEXT_ROW; } @@ -215,9 +209,7 @@ public class ScanQueryMatcher extends QueryMatcher { * @return true if the row should be filtered. */ public boolean filterEntireRow() { - if (filter == null) - return false; - return filter.filterRow(); + return filter == null? false: filter.filterRow(); } /** @@ -229,13 +221,12 @@ public class ScanQueryMatcher extends QueryMatcher { this.row = row; reset(); } - + @Override public void reset() { super.reset(); - stickyNextRow = false; if (filter != null) filter.reset(); } -} +} \ No newline at end of file