This is an automated email from the ASF dual-hosted git repository.
stack pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new e46dc61 HBASE-21918 the use cases in doc should use Cell instead of
KeyValue
e46dc61 is described below
commit e46dc615693793bd0e6be412a04e2a94fce5b704
Author: Zheng Wang <[email protected]>
AuthorDate: Wed Feb 20 00:13:18 2019 +0800
HBASE-21918 the use cases in doc should use Cell instead of KeyValue
Signed-off-by: Xu Cang <[email protected]>
Signed-off-by: stack <[email protected]>
---
src/main/asciidoc/_chapters/architecture.adoc | 12 ++++++------
src/main/asciidoc/_chapters/datamodel.adoc | 2 +-
src/main/asciidoc/_chapters/mapreduce.adoc | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/main/asciidoc/_chapters/architecture.adoc
b/src/main/asciidoc/_chapters/architecture.adoc
index 9a5eba9..9bdf179 100644
--- a/src/main/asciidoc/_chapters/architecture.adoc
+++ b/src/main/asciidoc/_chapters/architecture.adoc
@@ -452,8 +452,8 @@ scan.setFilter(f);
scan.setBatch(10); // set this if there could be many columns returned
ResultScanner rs = t.getScanner(scan);
for (Result r = rs.next(); r != null; r = rs.next()) {
- for (KeyValue kv : r.raw()) {
- // each kv represents a column
+ for (Cell cell : result.listCells()) {
+ // each cell represents a column
}
}
rs.close();
@@ -482,8 +482,8 @@ scan.setFilter(f);
scan.setBatch(10); // set this if there could be many columns returned
ResultScanner rs = t.getScanner(scan);
for (Result r = rs.next(); r != null; r = rs.next()) {
- for (KeyValue kv : r.raw()) {
- // each kv represents a column
+ for (Cell cell : result.listCells()) {
+ // each cell represents a column
}
}
rs.close();
@@ -518,8 +518,8 @@ scan.setFilter(f);
scan.setBatch(10); // set this if there could be many columns returned
ResultScanner rs = t.getScanner(scan);
for (Result r = rs.next(); r != null; r = rs.next()) {
- for (KeyValue kv : r.raw()) {
- // each kv represents a column
+ for (Cell cell : result.listCells()) {
+ // each cell represents a column
}
}
rs.close();
diff --git a/src/main/asciidoc/_chapters/datamodel.adoc
b/src/main/asciidoc/_chapters/datamodel.adoc
index ba4961a..7d1aece 100644
--- a/src/main/asciidoc/_chapters/datamodel.adoc
+++ b/src/main/asciidoc/_chapters/datamodel.adoc
@@ -425,7 +425,7 @@ Get get = new Get(Bytes.toBytes("row1"));
get.setMaxVersions(3); // will return last 3 versions of row
Result r = table.get(get);
byte[] b = r.getValue(CF, ATTR); // returns current version of value
-List<KeyValue> kv = r.getColumn(CF, ATTR); // returns all versions of this
column
+List<Cell> cells = r.getColumnCells(CF, ATTR); // returns all versions of
this column
----
==== Put
diff --git a/src/main/asciidoc/_chapters/mapreduce.adoc
b/src/main/asciidoc/_chapters/mapreduce.adoc
index 61cff86..bba8cc9 100644
--- a/src/main/asciidoc/_chapters/mapreduce.adoc
+++ b/src/main/asciidoc/_chapters/mapreduce.adoc
@@ -417,8 +417,8 @@ public static class MyMapper extends
TableMapper<ImmutableBytesWritable, Put> {
private static Put resultToPut(ImmutableBytesWritable key, Result result)
throws IOException {
Put put = new Put(key.get());
- for (KeyValue kv : result.raw()) {
- put.add(kv);
+ for (Cell cell : result.listCells()) {
+ put.add(cell);
}
return put;
}