[03/10] hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/47d8549c Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/47d8549c Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/47d8549c Branch: refs/heads/branch-2 Commit: 47d8549cec0e869fec5e2a8dea20aadcae2759a7 Parents: 50c9a41 Author: tedyuAuthored: Thu Sep 7 04:07:09 2017 -0700 Committer: zhangduo Committed: Wed Oct 25 20:41:24 2017 +0800 -- .../main/java/org/apache/hadoop/hbase/filter/FilterList.java| 5 +++-- .../java/org/apache/hadoop/hbase/filter/TestFilterList.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/47d8549c/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 83db1f2..3ff978d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -28,12 +28,13 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; -import org.apache.yetus.audience.InterfaceAudience; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.yetus.audience.InterfaceAudience; + +import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos; -import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; /** * Implementation of {@link Filter} that represents an ordered List of Filters http://git-wip-us.apache.org/repos/asf/hbase/blob/47d8549c/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index 46d44de..e414729 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -502,8 +502,8 @@ public class TestFilterList { // Should take the min if given two hints FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); -assertEquals(0, - CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); +assertEquals(0, CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), + minKeyValue)); // Should have no hint if any filter has no hint filterList = new FilterList(Operator.MUST_PASS_ONE,
[03/10] hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/10612254 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/10612254 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/10612254 Branch: refs/heads/master Commit: 10612254a163d39e0ad70af683fe1890125c41ed Parents: 5716e8d Author: tedyuAuthored: Thu Sep 7 04:07:09 2017 -0700 Committer: zhangduo Committed: Wed Oct 25 20:36:19 2017 +0800 -- .../main/java/org/apache/hadoop/hbase/filter/FilterList.java| 5 +++-- .../java/org/apache/hadoop/hbase/filter/TestFilterList.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/10612254/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 83db1f2..3ff978d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -28,12 +28,13 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; -import org.apache.yetus.audience.InterfaceAudience; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.yetus.audience.InterfaceAudience; + +import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos; -import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; /** * Implementation of {@link Filter} that represents an ordered List of Filters http://git-wip-us.apache.org/repos/asf/hbase/blob/10612254/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index 46d44de..e414729 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -502,8 +502,8 @@ public class TestFilterList { // Should take the min if given two hints FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); -assertEquals(0, - CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); +assertEquals(0, CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), + minKeyValue)); // Should have no hint if any filter has no hint filterList = new FilterList(Operator.MUST_PASS_ONE,
[14/23] hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/10612254 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/10612254 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/10612254 Branch: refs/heads/HBASE-18410 Commit: 10612254a163d39e0ad70af683fe1890125c41ed Parents: 5716e8d Author: tedyuAuthored: Thu Sep 7 04:07:09 2017 -0700 Committer: zhangduo Committed: Wed Oct 25 20:36:19 2017 +0800 -- .../main/java/org/apache/hadoop/hbase/filter/FilterList.java| 5 +++-- .../java/org/apache/hadoop/hbase/filter/TestFilterList.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/10612254/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 83db1f2..3ff978d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -28,12 +28,13 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; -import org.apache.yetus.audience.InterfaceAudience; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.yetus.audience.InterfaceAudience; + +import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos; -import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; /** * Implementation of {@link Filter} that represents an ordered List of Filters http://git-wip-us.apache.org/repos/asf/hbase/blob/10612254/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index 46d44de..e414729 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -502,8 +502,8 @@ public class TestFilterList { // Should take the min if given two hints FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); -assertEquals(0, - CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); +assertEquals(0, CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), + minKeyValue)); // Should have no hint if any filter has no hint filterList = new FilterList(Operator.MUST_PASS_ONE,
[12/21] hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/57c1a844 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/57c1a844 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/57c1a844 Branch: refs/heads/HBASE-18410 Commit: 57c1a84449c160f5f3de7e3acb32a708aa5a32d9 Parents: 772f672 Author: tedyuAuthored: Thu Sep 7 04:07:09 2017 -0700 Committer: zhangduo Committed: Wed Oct 25 20:27:16 2017 +0800 -- .../main/java/org/apache/hadoop/hbase/filter/FilterList.java| 5 +++-- .../java/org/apache/hadoop/hbase/filter/TestFilterList.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/57c1a844/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 83db1f2..3ff978d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -28,12 +28,13 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; -import org.apache.yetus.audience.InterfaceAudience; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.yetus.audience.InterfaceAudience; + +import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos; -import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; /** * Implementation of {@link Filter} that represents an ordered List of Filters http://git-wip-us.apache.org/repos/asf/hbase/blob/57c1a844/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index 46d44de..e414729 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -502,8 +502,8 @@ public class TestFilterList { // Should take the min if given two hints FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); -assertEquals(0, - CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); +assertEquals(0, CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), + minKeyValue)); // Should have no hint if any filter has no hint filterList = new FilterList(Operator.MUST_PASS_ONE,
[45/50] [abbrv] hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5c9523b7 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5c9523b7 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5c9523b7 Branch: refs/heads/HBASE-18410 Commit: 5c9523b757e5b0f6b8d5ef1829f9b199fc2f73ef Parents: 3f5f2a5 Author: tedyuAuthored: Thu Sep 7 04:07:09 2017 -0700 Committer: zhangduo Committed: Tue Oct 24 11:35:24 2017 +0800 -- .../main/java/org/apache/hadoop/hbase/filter/FilterList.java| 5 +++-- .../java/org/apache/hadoop/hbase/filter/TestFilterList.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/5c9523b7/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 83db1f2..3ff978d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -28,12 +28,13 @@ import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparatorImpl; import org.apache.hadoop.hbase.CellUtil; -import org.apache.yetus.audience.InterfaceAudience; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.yetus.audience.InterfaceAudience; + +import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos; -import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; /** * Implementation of {@link Filter} that represents an ordered List of Filters http://git-wip-us.apache.org/repos/asf/hbase/blob/5c9523b7/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index 46d44de..e414729 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -502,8 +502,8 @@ public class TestFilterList { // Should take the min if given two hints FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); -assertEquals(0, - CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), minKeyValue)); +assertEquals(0, CellComparatorImpl.COMPARATOR.compare(filterList.getNextCellHint(null), + minKeyValue)); // Should have no hint if any filter has no hint filterList = new FilterList(Operator.MUST_PASS_ONE,
hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
Repository: hbase Updated Branches: refs/heads/branch-2 a4bc3c6db -> 77bfe0550 HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/77bfe055 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/77bfe055 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/77bfe055 Branch: refs/heads/branch-2 Commit: 77bfe05503850a47a6c4e9cdedbf73bb74e9daae Parents: a4bc3c6 Author: tedyuAuthored: Fri Oct 13 15:15:12 2017 -0700 Committer: tedyu Committed: Fri Oct 13 15:15:12 2017 -0700 -- .../apache/hadoop/hbase/filter/FilterList.java | 30 .../hadoop/hbase/filter/TestFilterList.java | 6 ++-- 2 files changed, 27 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/77bfe055/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 9c4da41..e6791ab 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.filter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.List; @@ -64,7 +65,7 @@ final public class FilterList extends FilterBase { private static final int MAX_LOG_FILTERS = 5; private Operator operator = Operator.MUST_PASS_ALL; private final List filters; - private Filter seekHintFilter = null; + private Collection seekHintFilters = new ArrayList(); /** Reference Cell used by {@link #transformCell(Cell)} for validation purpose. */ private Cell referenceCell = null; @@ -201,7 +202,7 @@ final public class FilterList extends FilterBase { for (int i = 0; i < listize; i++) { filters.get(i).reset(); } -seekHintFilter = null; +seekHintFilters.clear(); } @Override @@ -290,6 +291,7 @@ final public class FilterList extends FilterBase { return ReturnCode.INCLUDE; } this.referenceCell = c; +seekHintFilters.clear(); // Accumulates successive transformation of every filter that includes the Cell: Cell transformed = c; @@ -321,10 +323,12 @@ final public class FilterList extends FilterBase { transformed = filter.transformCell(transformed); continue; case SEEK_NEXT_USING_HINT: - seekHintFilter = filter; - return code; + seekHintFilters.add(filter); + continue; default: - return code; + if (seekHintFilters.isEmpty()) { +return code; + } } } else if (operator == Operator.MUST_PASS_ONE) { if (filter.filterAllRemaining()) { @@ -362,6 +366,10 @@ final public class FilterList extends FilterBase { } } +if (!seekHintFilters.isEmpty()) { + return ReturnCode.SEEK_NEXT_USING_HINT; +} + // Save the transformed Cell for transform(): this.transformedCell = transformed; @@ -485,7 +493,17 @@ final public class FilterList extends FilterBase { } Cell keyHint = null; if (operator == Operator.MUST_PASS_ALL) { - keyHint = seekHintFilter.getNextCellHint(currentCell); + for (Filter filter : seekHintFilters) { +if (filter.filterAllRemaining()) continue; +Cell curKeyHint = filter.getNextCellHint(currentCell); +if (keyHint == null) { + keyHint = curKeyHint; + continue; +} +if (CellComparator.COMPARATOR.compare(keyHint, curKeyHint) < 0) { + keyHint = curKeyHint; +} + } return keyHint; } http://git-wip-us.apache.org/repos/asf/hbase/blob/77bfe055/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index 885c01e..6b5ffe1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -501,7 +501,7 @@ public class TestFilterList { FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint
hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
Repository: hbase Updated Branches: refs/heads/master f6a8a76b5 -> ffdc0e685 HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ffdc0e68 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ffdc0e68 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ffdc0e68 Branch: refs/heads/master Commit: ffdc0e6851e7172bfd3a31a0d78a92fa712ece0e Parents: f6a8a76 Author: tedyuAuthored: Fri Oct 13 13:21:20 2017 -0700 Committer: tedyu Committed: Fri Oct 13 13:21:20 2017 -0700 -- .../apache/hadoop/hbase/filter/FilterList.java | 30 .../hadoop/hbase/filter/TestFilterList.java | 6 ++-- 2 files changed, 27 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/ffdc0e68/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 9c4da41..e6791ab 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.filter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.List; @@ -64,7 +65,7 @@ final public class FilterList extends FilterBase { private static final int MAX_LOG_FILTERS = 5; private Operator operator = Operator.MUST_PASS_ALL; private final List filters; - private Filter seekHintFilter = null; + private Collection seekHintFilters = new ArrayList(); /** Reference Cell used by {@link #transformCell(Cell)} for validation purpose. */ private Cell referenceCell = null; @@ -201,7 +202,7 @@ final public class FilterList extends FilterBase { for (int i = 0; i < listize; i++) { filters.get(i).reset(); } -seekHintFilter = null; +seekHintFilters.clear(); } @Override @@ -290,6 +291,7 @@ final public class FilterList extends FilterBase { return ReturnCode.INCLUDE; } this.referenceCell = c; +seekHintFilters.clear(); // Accumulates successive transformation of every filter that includes the Cell: Cell transformed = c; @@ -321,10 +323,12 @@ final public class FilterList extends FilterBase { transformed = filter.transformCell(transformed); continue; case SEEK_NEXT_USING_HINT: - seekHintFilter = filter; - return code; + seekHintFilters.add(filter); + continue; default: - return code; + if (seekHintFilters.isEmpty()) { +return code; + } } } else if (operator == Operator.MUST_PASS_ONE) { if (filter.filterAllRemaining()) { @@ -362,6 +366,10 @@ final public class FilterList extends FilterBase { } } +if (!seekHintFilters.isEmpty()) { + return ReturnCode.SEEK_NEXT_USING_HINT; +} + // Save the transformed Cell for transform(): this.transformedCell = transformed; @@ -485,7 +493,17 @@ final public class FilterList extends FilterBase { } Cell keyHint = null; if (operator == Operator.MUST_PASS_ALL) { - keyHint = seekHintFilter.getNextCellHint(currentCell); + for (Filter filter : seekHintFilters) { +if (filter.filterAllRemaining()) continue; +Cell curKeyHint = filter.getNextCellHint(currentCell); +if (keyHint == null) { + keyHint = curKeyHint; + continue; +} +if (CellComparator.COMPARATOR.compare(keyHint, curKeyHint) < 0) { + keyHint = curKeyHint; +} + } return keyHint; } http://git-wip-us.apache.org/repos/asf/hbase/blob/ffdc0e68/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index 885c01e..6b5ffe1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -501,7 +501,7 @@ public class TestFilterList { FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint }
[4/6] hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5119d607 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5119d607 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5119d607 Branch: refs/heads/HBASE-18410 Commit: 5119d607613d531c395a5b9059951e208649c85f Parents: c3ac4e4 Author: tedyuAuthored: Thu Sep 7 04:07:09 2017 -0700 Committer: Sean Busbey Committed: Mon Oct 9 23:03:22 2017 -0500 -- .../apache/hadoop/hbase/filter/FilterList.java | 31 .../hadoop/hbase/filter/TestFilterList.java | 6 ++-- 2 files changed, 28 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/5119d607/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 7969db7..cd51648 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -22,7 +22,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; @@ -65,7 +67,7 @@ final public class FilterList extends FilterBase { private static final int MAX_LOG_FILTERS = 5; private Operator operator = Operator.MUST_PASS_ALL; private final List filters; - private Filter seekHintFilter = null; + private Set seekHintFilter = new HashSet<>(); /** * Save previous return code and previous cell for every filter in filter list. For MUST_PASS_ONE, @@ -234,7 +236,7 @@ final public class FilterList extends FilterBase { prevCellList.set(i, null); } } -seekHintFilter = null; +seekHintFilter.clear(); } @Override @@ -358,6 +360,7 @@ final public class FilterList extends FilterBase { return ReturnCode.INCLUDE; } this.referenceCell = c; +seekHintFilter.clear(); // Accumulates successive transformation of every filter that includes the Cell: Cell transformed = c; @@ -389,10 +392,12 @@ final public class FilterList extends FilterBase { transformed = filter.transformCell(transformed); continue; case SEEK_NEXT_USING_HINT: - seekHintFilter = filter; - return code; + seekHintFilter.add(filter); + continue; default: - return code; + if (seekHintFilter.isEmpty()) { +return code; + } } } else if (operator == Operator.MUST_PASS_ONE) { Cell prevCell = this.prevCellList.get(i); @@ -442,6 +447,10 @@ final public class FilterList extends FilterBase { } } +if (!seekHintFilter.isEmpty()) { + return ReturnCode.SEEK_NEXT_USING_HINT; +} + // Save the transformed Cell for transform(): this.transformedCell = transformed; @@ -565,7 +574,17 @@ final public class FilterList extends FilterBase { } Cell keyHint = null; if (operator == Operator.MUST_PASS_ALL) { - if (seekHintFilter != null) keyHint = seekHintFilter.getNextCellHint(currentCell); + for (Filter filter : seekHintFilter) { +if (filter.filterAllRemaining()) continue; +Cell curKeyHint = filter.getNextCellHint(currentCell); +if (keyHint == null) { + keyHint = curKeyHint; + continue; +} +if (CellComparator.COMPARATOR.compare(keyHint, curKeyHint) < 0) { + keyHint = curKeyHint; +} + } return keyHint; } http://git-wip-us.apache.org/repos/asf/hbase/blob/5119d607/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index 90f95a5..f20a9ba 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -502,7 +502,7 @@ public class TestFilterList { FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); assertEquals(0,
hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
Repository: hbase Updated Branches: refs/heads/branch-1 bd0f6551f -> ead106324 HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ead10632 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ead10632 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ead10632 Branch: refs/heads/branch-1 Commit: ead106324474d2faff11b4e1779e575aec67b59c Parents: bd0f655 Author: tedyuAuthored: Mon Sep 18 14:31:21 2017 -0700 Committer: tedyu Committed: Mon Sep 18 14:31:21 2017 -0700 -- .../apache/hadoop/hbase/filter/FilterList.java | 32 .../hadoop/hbase/filter/TestFilterList.java | 4 +-- 2 files changed, 28 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/ead10632/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index ddbd4a7..74736db 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -22,12 +22,15 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.exceptions.DeserializationException; @@ -69,7 +72,7 @@ final public class FilterList extends Filter { private static final int MAX_LOG_FILTERS = 5; private Operator operator = Operator.MUST_PASS_ALL; private List filters = new ArrayList(); - private Filter seekHintFilter = null; + private Set seekHintFilter = new HashSet<>(); /** * Save previous return code and previous cell for every filter in filter list. For MUST_PASS_ONE, @@ -207,7 +210,7 @@ final public class FilterList extends Filter { prevCellList.set(i, null); } } -seekHintFilter = null; +seekHintFilter.clear(); } @Override @@ -314,6 +317,7 @@ final public class FilterList extends Filter { justification="Intentional") public ReturnCode filterKeyValue(Cell v) throws IOException { this.referenceKV = v; +seekHintFilter.clear(); // Accumulates successive transformation of every filter that includes the Cell: Cell transformed = v; @@ -345,10 +349,12 @@ final public class FilterList extends Filter { transformed = filter.transformCell(transformed); continue; case SEEK_NEXT_USING_HINT: - seekHintFilter = filter; - return code; + seekHintFilter.add(filter); + continue; default: - return code; + if (seekHintFilter.isEmpty()) { +return code; + } } } else if (operator == Operator.MUST_PASS_ONE) { Cell prevCell = this.prevCellList.get(i); @@ -398,6 +404,10 @@ final public class FilterList extends Filter { } } +if (!seekHintFilter.isEmpty()) { + return ReturnCode.SEEK_NEXT_USING_HINT; +} + // Save the transformed Cell for transform(): this.transformedKV = transformed; @@ -522,7 +532,17 @@ final public class FilterList extends Filter { public Cell getNextCellHint(Cell currentKV) throws IOException { Cell keyHint = null; if (operator == Operator.MUST_PASS_ALL) { - if (seekHintFilter != null) keyHint = seekHintFilter.getNextCellHint(currentKV); + for (Filter filter : seekHintFilter) { +if (filter.filterAllRemaining()) continue; +Cell curKeyHint = filter.getNextCellHint(currentKV); +if (keyHint == null) { + keyHint = curKeyHint; + continue; +} +if (KeyValue.COMPARATOR.compare(keyHint, curKeyHint) < 0) { + keyHint = curKeyHint; +} + } return keyHint; } http://git-wip-us.apache.org/repos/asf/hbase/blob/ead10632/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git
[10/50] [abbrv] hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/df34300c Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/df34300c Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/df34300c Branch: refs/heads/HBASE-18467 Commit: df34300cd3f89c1efdea43b0b2ecb64c317e1a34 Parents: 3a9dc8f Author: tedyuAuthored: Thu Sep 7 04:07:09 2017 -0700 Committer: tedyu Committed: Thu Sep 7 04:07:09 2017 -0700 -- .../apache/hadoop/hbase/filter/FilterList.java | 31 .../hadoop/hbase/filter/TestFilterList.java | 6 ++-- 2 files changed, 28 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/df34300c/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 7433cca..0ce2ee6 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -22,7 +22,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; @@ -65,7 +67,7 @@ final public class FilterList extends FilterBase { private static final int MAX_LOG_FILTERS = 5; private Operator operator = Operator.MUST_PASS_ALL; private final List filters; - private Filter seekHintFilter = null; + private Set seekHintFilter = new HashSet<>(); /** * Save previous return code and previous cell for every filter in filter list. For MUST_PASS_ONE, @@ -234,7 +236,7 @@ final public class FilterList extends FilterBase { prevCellList.set(i, null); } } -seekHintFilter = null; +seekHintFilter.clear(); } @Override @@ -358,6 +360,7 @@ final public class FilterList extends FilterBase { return ReturnCode.INCLUDE; } this.referenceCell = c; +seekHintFilter.clear(); // Accumulates successive transformation of every filter that includes the Cell: Cell transformed = c; @@ -389,10 +392,12 @@ final public class FilterList extends FilterBase { transformed = filter.transformCell(transformed); continue; case SEEK_NEXT_USING_HINT: - seekHintFilter = filter; - return code; + seekHintFilter.add(filter); + continue; default: - return code; + if (seekHintFilter.isEmpty()) { +return code; + } } } else if (operator == Operator.MUST_PASS_ONE) { Cell prevCell = this.prevCellList.get(i); @@ -442,6 +447,10 @@ final public class FilterList extends FilterBase { } } +if (!seekHintFilter.isEmpty()) { + return ReturnCode.SEEK_NEXT_USING_HINT; +} + // Save the transformed Cell for transform(): this.transformedCell = transformed; @@ -565,7 +574,17 @@ final public class FilterList extends FilterBase { } Cell keyHint = null; if (operator == Operator.MUST_PASS_ALL) { - if (seekHintFilter != null) keyHint = seekHintFilter.getNextCellHint(currentCell); + for (Filter filter : seekHintFilter) { +if (filter.filterAllRemaining()) continue; +Cell curKeyHint = filter.getNextCellHint(currentCell); +if (keyHint == null) { + keyHint = curKeyHint; + continue; +} +if (CellComparator.COMPARATOR.compare(keyHint, curKeyHint) < 0) { + keyHint = curKeyHint; +} + } return keyHint; } http://git-wip-us.apache.org/repos/asf/hbase/blob/df34300c/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index bcb6617..f7c1b20 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -501,7 +501,7 @@ public class TestFilterList { FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new Filter [] { filterMinHint, filterMaxHint } )); assertEquals(0,
hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
Repository: hbase Updated Branches: refs/heads/branch-2 7592cb8d3 -> 743f3ae22 HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/743f3ae2 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/743f3ae2 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/743f3ae2 Branch: refs/heads/branch-2 Commit: 743f3ae221531f553dba84de7fc0adfde70cd04b Parents: 7592cb8 Author: tedyuAuthored: Thu Sep 7 08:15:29 2017 -0700 Committer: tedyu Committed: Thu Sep 7 08:15:29 2017 -0700 -- .../apache/hadoop/hbase/filter/FilterList.java | 31 .../hadoop/hbase/filter/TestFilterList.java | 6 ++-- 2 files changed, 28 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/743f3ae2/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 7433cca..0ce2ee6 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -22,7 +22,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; @@ -65,7 +67,7 @@ final public class FilterList extends FilterBase { private static final int MAX_LOG_FILTERS = 5; private Operator operator = Operator.MUST_PASS_ALL; private final List filters; - private Filter seekHintFilter = null; + private Set seekHintFilter = new HashSet<>(); /** * Save previous return code and previous cell for every filter in filter list. For MUST_PASS_ONE, @@ -234,7 +236,7 @@ final public class FilterList extends FilterBase { prevCellList.set(i, null); } } -seekHintFilter = null; +seekHintFilter.clear(); } @Override @@ -358,6 +360,7 @@ final public class FilterList extends FilterBase { return ReturnCode.INCLUDE; } this.referenceCell = c; +seekHintFilter.clear(); // Accumulates successive transformation of every filter that includes the Cell: Cell transformed = c; @@ -389,10 +392,12 @@ final public class FilterList extends FilterBase { transformed = filter.transformCell(transformed); continue; case SEEK_NEXT_USING_HINT: - seekHintFilter = filter; - return code; + seekHintFilter.add(filter); + continue; default: - return code; + if (seekHintFilter.isEmpty()) { +return code; + } } } else if (operator == Operator.MUST_PASS_ONE) { Cell prevCell = this.prevCellList.get(i); @@ -442,6 +447,10 @@ final public class FilterList extends FilterBase { } } +if (!seekHintFilter.isEmpty()) { + return ReturnCode.SEEK_NEXT_USING_HINT; +} + // Save the transformed Cell for transform(): this.transformedCell = transformed; @@ -565,7 +574,17 @@ final public class FilterList extends FilterBase { } Cell keyHint = null; if (operator == Operator.MUST_PASS_ALL) { - if (seekHintFilter != null) keyHint = seekHintFilter.getNextCellHint(currentCell); + for (Filter filter : seekHintFilter) { +if (filter.filterAllRemaining()) continue; +Cell curKeyHint = filter.getNextCellHint(currentCell); +if (keyHint == null) { + keyHint = curKeyHint; + continue; +} +if (CellComparator.COMPARATOR.compare(keyHint, curKeyHint) < 0) { + keyHint = curKeyHint; +} + } return keyHint; } http://git-wip-us.apache.org/repos/asf/hbase/blob/743f3ae2/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index bcb6617..f7c1b20 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -501,7 +501,7 @@ public class TestFilterList { FilterList filterList = new FilterList(Operator.MUST_PASS_ONE,
hbase git commit: HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT
Repository: hbase Updated Branches: refs/heads/master 3a9dc8fbd -> df34300cd HBASE-15410 Utilize the max seek value when all Filters in MUST_PASS_ALL FilterList return SEEK_NEXT_USING_HINT Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/df34300c Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/df34300c Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/df34300c Branch: refs/heads/master Commit: df34300cd3f89c1efdea43b0b2ecb64c317e1a34 Parents: 3a9dc8f Author: tedyuAuthored: Thu Sep 7 04:07:09 2017 -0700 Committer: tedyu Committed: Thu Sep 7 04:07:09 2017 -0700 -- .../apache/hadoop/hbase/filter/FilterList.java | 31 .../hadoop/hbase/filter/TestFilterList.java | 6 ++-- 2 files changed, 28 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/df34300c/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 7433cca..0ce2ee6 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -22,7 +22,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; @@ -65,7 +67,7 @@ final public class FilterList extends FilterBase { private static final int MAX_LOG_FILTERS = 5; private Operator operator = Operator.MUST_PASS_ALL; private final List filters; - private Filter seekHintFilter = null; + private Set seekHintFilter = new HashSet<>(); /** * Save previous return code and previous cell for every filter in filter list. For MUST_PASS_ONE, @@ -234,7 +236,7 @@ final public class FilterList extends FilterBase { prevCellList.set(i, null); } } -seekHintFilter = null; +seekHintFilter.clear(); } @Override @@ -358,6 +360,7 @@ final public class FilterList extends FilterBase { return ReturnCode.INCLUDE; } this.referenceCell = c; +seekHintFilter.clear(); // Accumulates successive transformation of every filter that includes the Cell: Cell transformed = c; @@ -389,10 +392,12 @@ final public class FilterList extends FilterBase { transformed = filter.transformCell(transformed); continue; case SEEK_NEXT_USING_HINT: - seekHintFilter = filter; - return code; + seekHintFilter.add(filter); + continue; default: - return code; + if (seekHintFilter.isEmpty()) { +return code; + } } } else if (operator == Operator.MUST_PASS_ONE) { Cell prevCell = this.prevCellList.get(i); @@ -442,6 +447,10 @@ final public class FilterList extends FilterBase { } } +if (!seekHintFilter.isEmpty()) { + return ReturnCode.SEEK_NEXT_USING_HINT; +} + // Save the transformed Cell for transform(): this.transformedCell = transformed; @@ -565,7 +574,17 @@ final public class FilterList extends FilterBase { } Cell keyHint = null; if (operator == Operator.MUST_PASS_ALL) { - if (seekHintFilter != null) keyHint = seekHintFilter.getNextCellHint(currentCell); + for (Filter filter : seekHintFilter) { +if (filter.filterAllRemaining()) continue; +Cell curKeyHint = filter.getNextCellHint(currentCell); +if (keyHint == null) { + keyHint = curKeyHint; + continue; +} +if (CellComparator.COMPARATOR.compare(keyHint, curKeyHint) < 0) { + keyHint = curKeyHint; +} + } return keyHint; } http://git-wip-us.apache.org/repos/asf/hbase/blob/df34300c/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java -- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java index bcb6617..f7c1b20 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterList.java @@ -501,7 +501,7 @@ public class TestFilterList { FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, Arrays.asList(new