keith-turner closed pull request #154: update tour to use new scanner APIs
URL: https://github.com/apache/fluo-website/pull/154
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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());


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to