Skip to content

Commit e967f9c

Browse files
rahulKQLigorbernstein2
authored andcommitted
---
yaml --- r: 29693 b: refs/heads/autosynth-pubsub c: 2313bb5 h: refs/heads/master i: 29691: aa9d783
1 parent 91bfb34 commit e967f9c

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

  • branches/autosynth-pubsub/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ refs/tags/v0.67.0: 30b56f02092efc6f3c3667650ea8b8825003e0b7
114114
refs/heads/autosynth-compute: c0ad4e5b54b2b167d47e508ca215c039404837d3
115115
refs/heads/autosynth-container: e9a9a8564756e20770320ed54eafa867040a7690
116116
refs/heads/autosynth-monitoring: f3b29d97f847cecd186ec14aeee04a232aaf0e1b
117-
refs/heads/autosynth-pubsub: 06d6685b4c3eedcc4d513b47e6531859a08e07b2
117+
refs/heads/autosynth-pubsub: 2313bb545e4bb4ab74868033e5a11729f3cd00f7
118118
refs/heads/autosynth-video-intelligence: 82b145665822830c46d47eb8925edb2d842d6815
119119
refs/heads/autosynth-vision: 01ef61bcef344ceee0198f56f18bc1db20201261
120120
refs/heads/spanner: b01127f885b4611bf1852abb0ce481eeb7fcc131

branches/autosynth-pubsub/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)