Skip to content

Commit d87aa07

Browse files
rahulKQLigorbernstein2
authored andcommitted
---
yaml --- r: 32795 b: refs/heads/autosynth-iot c: 2313bb5 h: refs/heads/master i: 32793: 85be02b 32791: 6338997
1 parent 9b2a6df commit d87aa07

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ refs/heads/autosynth-datastore: f1efc3dc465174f41041acd56cf29badcec3e5bd
131131
refs/heads/autosynth-dialogflow: 73974cc32e5212aec0126472e0bc1442886fedaf
132132
refs/heads/autosynth-errorreporting: effe8001d110ad584187b30aafc473db0dd4a15f
133133
refs/heads/autosynth-firestore: e79eeb26930dfae4439424ad2fda5874eeca54c8
134-
refs/heads/autosynth-iot: 06d6685b4c3eedcc4d513b47e6531859a08e07b2
134+
refs/heads/autosynth-iot: 2313bb545e4bb4ab74868033e5a11729f3cd00f7
135135
refs/heads/autosynth-kms: 6b65b0f34c12d141031c7288cdc01e550212d0f6
136136
refs/heads/autosynth-language: e73905aa7672afa47240e65b25c087207f4594f9
137137
refs/heads/autosynth-os-login: 123ba209c5769d0ee067e0ce5848bec13b42a4f4

branches/autosynth-iot/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,16 @@ public <RowT> UnaryCallable<Query, RowT> readRowCallable(RowAdapter<RowT> rowAda
513513
* .range("[START KEY]", "[END KEY]")
514514
* .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
515515
*
516-
* // Iterator style
517516
* try {
518-
* for(Row row : bigtableDataClient.readRows(query)) {
517+
* ServerStream<Row> stream = bigtableDataClient.readRows(query);
518+
* int count = 0;
519+
*
520+
* // Iterator style
521+
* for (Row row : stream) {
522+
* if (++count > 10) {
523+
* stream.cancel();
524+
* break;
525+
* }
519526
* // Do something with row
520527
* }
521528
* } catch (NotFoundException e) {
@@ -548,8 +555,17 @@ public ServerStream<Row> readRows(Query query) {
548555
* .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
549556
*
550557
* bigtableDataClient.readRowsAsync(query, new ResponseObserver<Row>() {
551-
* public void onStart(StreamController controller) { }
558+
* StreamController controller;
559+
* int count = 0;
560+
*
561+
* public void onStart(StreamController controller) {
562+
* this.controller = controller;
563+
* }
552564
* public void onResponse(Row row) {
565+
* if (++count > 10) {
566+
* controller.cancel();
567+
* return;
568+
* }
553569
* // Do something with Row
554570
* }
555571
* public void onError(Throwable t) {

0 commit comments

Comments
 (0)