This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/fluo-website.git
The following commit(s) were added to refs/heads/gh-pages by this push:
new 769a4e3 update tour to use new scanner APIs (#154)
769a4e3 is described below
commit 769a4e34de57352832dd0fa6e9d92348aca04e3a
Author: Keith Turner <[email protected]>
AuthorDate: Fri Mar 23 17:36:10 2018 -0400
update tour to use new scanner APIs (#154)
---
tour/application-configuration.md | 4 +---
tour/scanning-code.md | 11 +++++------
tour/weak-code.md | 2 +-
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/tour/application-configuration.md
b/tour/application-configuration.md
index 529ca77..a5839a9 100644
--- a/tour/application-configuration.md
+++ b/tour/application-configuration.md
@@ -67,7 +67,7 @@ configuration.
Column exportNtfyCol = new Column("ET", exportId);
Observer exportObserver = (tx, row, col) -> {
- CellScanner scanner = tx.scanner().over(Span.exact(row)).build();
+ CellScanner scanner = tx.scanner().over(row).build();
for (RowColumnValue rcv : scanner) {
System.out.printf("Exporting val=%s from row=%s to db=%s
table=%s\n", rcv.getsValue(),
@@ -136,5 +136,3 @@ Exporting val=555 from row=e:99 to db=db1 table=bigtable
[lcgac]: {{ site.fluo_api_static }}/{{ site.latest_fluo_release
}}/org/apache/fluo/api/client/Loader.Context.html#getAppConfiguration--
[ospec]: {{ site.fluo_api_static }}/{{
site.latest_fluo_release}}/org/apache/fluo/api/config/ObserverSpecification.html
[ocgp]: {{ site.fluo_api_static }}/{{ site.latest_fluo_release
}}/org/apache/fluo/api/observer/Observer.Context.html#getObserverConfiguration--
-
-
diff --git a/tour/scanning-code.md b/tour/scanning-code.md
index 9bf797c..6b71c4f 100644
--- a/tour/scanning-code.md
+++ b/tour/scanning-code.md
@@ -31,21 +31,20 @@ title: Scanning Code
try(Snapshot s1 = client.newSnapshot()) {
//scan over an entire row
- CellScanner cellScanner =
s1.scanner().over(Span.exact("kerbalnaut0002")).build();
+ CellScanner cellScanner = s1.scanner().over("kerbalnaut0002").build();
System.out.println("Scan 1 :");
for (RowColumnValue rcv : cellScanner) {
System.out.println("\t"+rcv);
}
//scan over a row and column family
- cellScanner = s1.scanner().over(Span.exact("kerbalnaut0002", new
Column("name"))).build();
+ cellScanner = s1.scanner().over("kerbalnaut0002", new
Column("name")).build();
System.out.println("\nScan 2 :");
- for (RowColumnValue rcv : cellScanner) {
- System.out.println("\t"+rcv);
- }
+ //use Java 8 stream to print instead of foreach loop
+ cellScanner.stream().map(rcv -> "\t"+rcv).forEach(System.out::println);
//scan over two columns
- cellScanner = s1.scanner().over(Span.prefix("kerbalnaut")).fetch(fName,
bravery).build();
+ cellScanner = s1.scanner().overPrefix("kerbalnaut").fetch(fName,
bravery).build();
System.out.println("\nScan 3 :");
//use Java lambda's to print instead of foreach loop
cellScanner.forEach(rcv -> System.out.println("\t"+rcv));
diff --git a/tour/weak-code.md b/tour/weak-code.md
index 8752ff2..ac34953 100644
--- a/tour/weak-code.md
+++ b/tour/weak-code.md
@@ -15,7 +15,7 @@ title: Weak Notification Code
StringObserver summingObs = (tx, row, col) -> {
int sum = Integer.parseInt(tx.gets(row, TOTAL_COL, "0"));
- CellScanner scanner = tx.scanner().over(Span.prefix(row +
"/")).build();
+ CellScanner scanner = tx.scanner().overPrefix(row + "/").build();
for (RowColumnValue rcv : scanner) {
sum += Integer.parseInt(rcv.getsValue());
tx.delete(rcv.getRow(), rcv.getColumn());
--
To stop receiving notification emails like this one, please contact
[email protected].