hbase git commit: HBASE-20019 Document the ColumnValueFilter
Repository: hbase Updated Branches: refs/heads/master a8471bd98 -> a34f129af HBASE-20019 Document the ColumnValueFilter Signed-off-by: Chia-Ping Tsai Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a34f129a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a34f129a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a34f129a Branch: refs/heads/master Commit: a34f129a9b5e1098f1c9e86b1b8e7202bb97 Parents: a8471bd Author: Reid Chan Authored: Mon Feb 26 11:31:08 2018 +0800 Committer: Chia-Ping Tsai Committed: Mon Feb 26 14:59:42 2018 +0800 -- src/main/asciidoc/_chapters/architecture.adoc | 35 ++ 1 file changed, 35 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/a34f129a/src/main/asciidoc/_chapters/architecture.adoc -- diff --git a/src/main/asciidoc/_chapters/architecture.adoc b/src/main/asciidoc/_chapters/architecture.adoc index 9091d5e..6fb5891 100644 --- a/src/main/asciidoc/_chapters/architecture.adoc +++ b/src/main/asciidoc/_chapters/architecture.adoc @@ -321,6 +321,41 @@ SingleColumnValueFilter filter = new SingleColumnValueFilter( scan.setFilter(filter); +[[client.filter.cv.cvf]] + ColumnValueFilter + +Introduced in HBase-2.0.0 version as a complementation of SingleColumnValueFilter, ColumnValueFilter +gets matched cell only, while SingleColumnValueFilter gets the entire row +(has other columns and values) to which the matched cell belongs. Parameters of constructor of +ColumnValueFilter are the same as SingleColumnValueFilter. +[source,java] + +ColumnValueFilter filter = new ColumnValueFilter( + cf, + column, + CompareOperaor.EQUAL, + Bytes.toBytes("my value") + ); +scan.setFilter(filter); + + +Note. For simple query like "equals to a family:qualifier:value", we highly recommend to use the +following way instead of using SingleColumnValueFilter or ColumnValueFilter: +[source,java] + +Scan scan = new Scan(); +scan.addColumn(Bytes.toBytes("family"), Bytes.toBytes("qualifier")); +ValueFilter vf = new ValueFilter(CompareOperator.EQUAL, + new BinaryComparator(Bytes.toBytes("value"))); +scan.setFilter(vf); +... + +This scan will restrict to the specified column 'family:qualifier', avoiding scan unrelated +families and columns, which has better performance, and `ValueFilter` is the condition used to do +the value filtering. + +But if query is much more complicated beyond this book, then please make your good choice case by case. + [[client.filter.cvp]] === Column Value Comparators
hbase git commit: HBASE-20019 Document the ColumnValueFilter
Repository: hbase Updated Branches: refs/heads/branch-2 10270e36c -> 309f3360b HBASE-20019 Document the ColumnValueFilter Signed-off-by: Chia-Ping Tsai Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/309f3360 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/309f3360 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/309f3360 Branch: refs/heads/branch-2 Commit: 309f3360bf3f45c7ea572a09eddada02cf6b93b3 Parents: 10270e3 Author: Reid Chan Authored: Mon Feb 26 11:31:08 2018 +0800 Committer: Chia-Ping Tsai Committed: Mon Feb 26 15:11:01 2018 +0800 -- src/main/asciidoc/_chapters/architecture.adoc | 35 ++ 1 file changed, 35 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/309f3360/src/main/asciidoc/_chapters/architecture.adoc -- diff --git a/src/main/asciidoc/_chapters/architecture.adoc b/src/main/asciidoc/_chapters/architecture.adoc index 5ba81c1..b29244c 100644 --- a/src/main/asciidoc/_chapters/architecture.adoc +++ b/src/main/asciidoc/_chapters/architecture.adoc @@ -321,6 +321,41 @@ SingleColumnValueFilter filter = new SingleColumnValueFilter( scan.setFilter(filter); +[[client.filter.cv.cvf]] + ColumnValueFilter + +Introduced in HBase-2.0.0 version as a complementation of SingleColumnValueFilter, ColumnValueFilter +gets matched cell only, while SingleColumnValueFilter gets the entire row +(has other columns and values) to which the matched cell belongs. Parameters of constructor of +ColumnValueFilter are the same as SingleColumnValueFilter. +[source,java] + +ColumnValueFilter filter = new ColumnValueFilter( + cf, + column, + CompareOperaor.EQUAL, + Bytes.toBytes("my value") + ); +scan.setFilter(filter); + + +Note. For simple query like "equals to a family:qualifier:value", we highly recommend to use the +following way instead of using SingleColumnValueFilter or ColumnValueFilter: +[source,java] + +Scan scan = new Scan(); +scan.addColumn(Bytes.toBytes("family"), Bytes.toBytes("qualifier")); +ValueFilter vf = new ValueFilter(CompareOperator.EQUAL, + new BinaryComparator(Bytes.toBytes("value"))); +scan.setFilter(vf); +... + +This scan will restrict to the specified column 'family:qualifier', avoiding scan unrelated +families and columns, which has better performance, and `ValueFilter` is the condition used to do +the value filtering. + +But if query is much more complicated beyond this book, then please make your good choice case by case. + [[client.filter.cvp]] === Column Value Comparators
hbase git commit: HBASE-20065 Addendum remove wrong comment
Repository: hbase Updated Branches: refs/heads/master 549a6d93d -> a8471bd98 HBASE-20065 Addendum remove wrong comment Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a8471bd9 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a8471bd9 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a8471bd9 Branch: refs/heads/master Commit: a8471bd98736c7ee387e268415bfd3ff96d8655d Parents: 549a6d9 Author: zhangduo Authored: Mon Feb 26 09:48:41 2018 +0800 Committer: zhangduo Committed: Mon Feb 26 09:48:41 2018 +0800 -- .../src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java| 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/a8471bd9/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java index 803f183..e779054 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java @@ -1535,7 +1535,6 @@ public class MetaTableAccessor { RegionInfo regionA, RegionInfo regionB, ServerName sn, int regionReplication) throws IOException { try (Table meta = getMetaHTable(connection)) { - // use the maximum of what master passed us vs local time. long time = EnvironmentEdgeManager.currentTime(); // Put for parent
hbase git commit: HBASE-20065 Addendum remove wrong comment
Repository: hbase Updated Branches: refs/heads/branch-2 8b3ae58e1 -> 10270e36c HBASE-20065 Addendum remove wrong comment Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/10270e36 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/10270e36 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/10270e36 Branch: refs/heads/branch-2 Commit: 10270e36c9bd8571135ca7c8692a9e1ece0a6a45 Parents: 8b3ae58 Author: zhangduo Authored: Mon Feb 26 09:48:41 2018 +0800 Committer: zhangduo Committed: Mon Feb 26 09:48:55 2018 +0800 -- .../src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java| 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/10270e36/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java -- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java index 803f183..e779054 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java @@ -1535,7 +1535,6 @@ public class MetaTableAccessor { RegionInfo regionA, RegionInfo regionB, ServerName sn, int regionReplication) throws IOException { try (Table meta = getMetaHTable(connection)) { - // use the maximum of what master passed us vs local time. long time = EnvironmentEdgeManager.currentTime(); // Put for parent
[2/3] hbase git commit: HBASE-18467 temporarily mute posting to jira
HBASE-18467 temporarily mute posting to jira Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a2bd9a72 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a2bd9a72 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a2bd9a72 Branch: refs/heads/HBASE-15151 Commit: a2bd9a724648ec598a52fb0b0deada5f861e3e1a Parents: 061c013 Author: Sean Busbey Authored: Sun Feb 25 00:59:52 2018 -0600 Committer: Sean Busbey Committed: Sun Feb 25 09:45:21 2018 -0600 -- dev-support/Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/a2bd9a72/dev-support/Jenkinsfile -- diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile index 31416dd..22f3f21 100644 --- a/dev-support/Jenkinsfile +++ b/dev-support/Jenkinsfile @@ -460,7 +460,8 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" echo "" echo "[INFO] There are ${currentBuild.changeSets.size()} change sets." getJirasToComment(currentBuild).each { currentIssue -> - jiraComment issueKey: currentIssue, body: comment +// jiraComment issueKey: currentIssue, body: comment + echo "jiraComment issueKey: ${currentIssue}, body: ${comment}" } } catch (Exception exception) { echo "Got exception: ${exception}"
[3/3] hbase git commit: HBASE-15151 ensure findbugs check runs on all branches.
HBASE-15151 ensure findbugs check runs on all branches. Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/97a3a9a3 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/97a3a9a3 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/97a3a9a3 Branch: refs/heads/HBASE-15151 Commit: 97a3a9a311e93cf973bc7590f09daa1d7d6fbd06 Parents: a2bd9a7 Author: Sean Busbey Authored: Sun Feb 25 00:35:45 2018 -0600 Committer: Sean Busbey Committed: Sun Feb 25 09:45:21 2018 -0600 -- dev-support/Jenkinsfile | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/97a3a9a3/dev-support/Jenkinsfile -- diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile index 22f3f21..6e37c70 100644 --- a/dev-support/Jenkinsfile +++ b/dev-support/Jenkinsfile @@ -239,7 +239,7 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" } } environment { -TESTS = 'mvninstall,compile,javac,unit,htmlout' +TESTS = 'mvninstall,compile,javac,unit,findbugs,htmlout' OUTPUT_DIR_RELATIVE = "${env.OUTPUT_DIR_RELATIVE_HADOOP2}" OUTPUT_DIR = "${env.WORKSPACE}/${env.OUTPUT_DIR_RELATIVE_HADOOP2}" // This isn't strictly needed on branches that only support jdk8, but doesn't hurt @@ -305,10 +305,7 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" } } environment { -// Failure in any stage fails the build and consecutive stages are not built. -// Findbugs is part of this last yetus stage to prevent findbugs precluding hadoop3 -// tests. -TESTS = 'mvninstall,compile,javac,unit,findbugs,htmlout' +TESTS = 'mvninstall,compile,javac,unit,htmlout' OUTPUT_DIR_RELATIVE = "${env.OUTPUT_DIR_RELATIVE_HADOOP3}" OUTPUT_DIR = "${env.WORKSPACE}/${env.OUTPUT_DIR_RELATIVE_HADOOP3}" // This isn't strictly needed on branches that only support jdk8, but doesn't hurt
[1/3] hbase git commit: HBASE-18467 report nightly results to devs via jira [Forced Update!]
Repository: hbase Updated Branches: refs/heads/HBASE-15151 4d6a00c6b -> 97a3a9a31 (forced update) HBASE-18467 report nightly results to devs via jira Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/061c0138 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/061c0138 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/061c0138 Branch: refs/heads/HBASE-15151 Commit: 061c01389703f0a92901624e4dd36e4ac71f2386 Parents: 549a6d9 Author: Sean Busbey Authored: Wed Aug 9 00:48:46 2017 -0500 Committer: Sean Busbey Committed: Sun Feb 25 09:45:20 2018 -0600 -- dev-support/Jenkinsfile | 165 +++ 1 file changed, 150 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/061c0138/dev-support/Jenkinsfile -- diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile index 201783b..31416dd 100644 --- a/dev-support/Jenkinsfile +++ b/dev-support/Jenkinsfile @@ -34,6 +34,12 @@ pipeline { // where we check out to across stages BASEDIR = "${env.WORKSPACE}/component" YETUS_RELEASE = '0.7.0' +// where we'll write everything from different steps. Need a copy here so the final step can check for success/failure. +OUTPUT_DIR_RELATIVE_GENERAL = 'output-general' +OUTPUT_DIR_RELATIVE_JDK7 = 'output-jdk7' +OUTPUT_DIR_RELATIVE_HADOOP2 = 'output-jdk8-hadoop2' +OUTPUT_DIR_RELATIVE_HADOOP3 = 'output-jdk8-hadoop3' + PROJECT = 'hbase' PROJECT_PERSONALITY = 'https://raw.githubusercontent.com/apache/hbase/master/dev-support/hbase-personality.sh' // This section of the docs tells folks not to use the javadoc tag. older branches have our old version of the check for said tag. @@ -119,8 +125,8 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" // on branches that don't support jdk7, this will already be JAVA_HOME, so we'll end up not // doing multijdk there. MULTIJDK = '/usr/lib/jvm/java-8-openjdk-amd64' -OUTPUT_DIR_RELATIVE = "output-general" -OUTPUT_DIR = "${env.WORKSPACE}/${env.OUTPUT_DIR_RELATIVE}" +OUTPUT_DIR_RELATIVE = "${env.OUTPUT_DIR_RELATIVE_GENERAL}" +OUTPUT_DIR = "${env.WORKSPACE}/${env.OUTPUT_DIR_RELATIVE_GENERAL}" } steps { unstash 'yetus' @@ -130,7 +136,18 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" "${BASEDIR}/dev-support/gather_machine_environment.sh" "${OUTPUT_DIR_RELATIVE}/machine" ''' // TODO should this be a download from master, similar to how the personality is? -sh "${env.BASEDIR}/dev-support/hbase_nightly_yetus.sh" +sh '''#!/usr/bin/env bash + declare commentfile + rm -rf "${OUTPUT_DIR}/success}" "${OUTPUT_DIR}/failure" + if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then +commentfile="${OUTPUT_DIR}/success" +echo '(/) {color:green}+1 general checks{color}' >> "${commentfile}" + else +commentfile="${OUTPUT_DIR}/failure" +echo '(x) {color:red}-1 general checks{color}' >> "${commentfile}" + fi + echo "-- For more information [see general report|${BUILD_URL}/General_Nightly_Build_Report/]" >> "${commentfile}" +''' } post { always { @@ -155,8 +172,8 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" } environment { TESTS = 'mvninstall,compile,javac,unit,htmlout' -OUTPUT_DIR_RELATIVE = "output-jdk7" -OUTPUT_DIR = "${env.WORKSPACE}/${env.OUTPUT_DIR_RELATIVE}" +OUTPUT_DIR_RELATIVE = "${env.OUTPUT_DIR_RELATIVE_JDK7}" +OUTPUT_DIR = "${env.WORKSPACE}/${env.OUTPUT_DIR_RELATIVE_JDK7}" // On branches where we do jdk7 checks, jdk7 will be JAVA_HOME already. } steps { @@ -166,13 +183,22 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" rm -rf "${OUTPUT_DIR}/machine" && mkdir "${OUTPUT_DIR}/machine" "${BASEDIR}/dev-support/gather_machine_environment.sh" "${OUTPUT_DIR_RELATIVE}/machine" ''' -sh """#!/usr/bin/env bash +sh '''#!/usr/bin/env bash # for branch-1.1 we don't do jdk8 findbugs, so do it here - if [ "${env.BRANCH_NAME}" == "branch-1.1" ]; then + if [ "${BRANCH_NAME}" == "branch-1.1" ]; then TESTS+=",findbugs" fi - "${env.BASEDIR}/dev-support/hbase_nightly_yetus.sh" -""" + declare commentfile + rm -rf "${OUTPUT_DIR}/success}" "${OUTPUT_DIR}/failure" + if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then +commentfile="${OUTPUT_DIR}/success" +echo '(/) {color:green}+1 jdk7 checks{color
[hbase] Git Push Summary
Repository: hbase Updated Branches: refs/heads/temporary-2 [deleted] edcb812be