[03/50] [abbrv] hbase git commit: HBASE-20019 Document the ColumnValueFilter

2018-03-01 Thread zhangduo
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/HBASE-19064
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
 



[02/20] hbase git commit: HBASE-20019 Document the ColumnValueFilter

2018-02-27 Thread busbey
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/HBASE-15151
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
 



[10/50] [abbrv] hbase git commit: HBASE-20019 Document the ColumnValueFilter

2018-02-26 Thread zhangduo
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/HBASE-19397-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-20019 Document the ColumnValueFilter

2018-02-25 Thread chia7712
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

2018-02-25 Thread chia7712
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