Skip to content

Commit 6fdd838

Browse files
rahulKQLigorbernstein2
authored andcommitted
---
yaml --- r: 31575 b: refs/heads/autosynth-containeranalysis c: 2313bb5 h: refs/heads/master i: 31573: 684128c 31571: d097ef1 31567: 446bd04
1 parent 9f29f60 commit 6fdd838

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

  • branches/autosynth-containeranalysis/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
@@ -126,7 +126,7 @@ refs/heads/autosynth-bigquerydatatransfer: 71b6b6d2a992d05999b53e6e130c4fc1c8c8b
126126
refs/heads/autosynth-bigquerystorage: a345f72d7a6358e9fea9dcdae94ec85a27da3088
127127
refs/heads/autosynth-bigtable: 2a6af7e2959fd79c99b8ca5d773f29a6434b546d
128128
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
129-
refs/heads/autosynth-containeranalysis: 06d6685b4c3eedcc4d513b47e6531859a08e07b2
129+
refs/heads/autosynth-containeranalysis: 2313bb545e4bb4ab74868033e5a11729f3cd00f7
130130
refs/heads/autosynth-datastore: d0fc1187000c7a50d8bddd89c3b7cdf1187ecb96
131131
refs/heads/autosynth-dialogflow: 841930a680ebe370c9fc6ae824465f6bc51a5a46
132132
refs/heads/autosynth-errorreporting: 3f176c20b55dfaaa8fc32f28d82b31784b93e636

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