GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add a query paginator by mutianf · Pull Request #1530 · googleapis/java-bigtable

This repository was archived by the owner on Aug 30, 2026. It is now read-only.

Conversation

@mutianf

@mutianf mutianf commented Nov 22, 2022

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mutianf
feat: add a query paginator
a59bbb8
@mutianf
mutianf requested a review from a team November 22, 2022 18:36
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: bigtable Issues related to the googleapis/java-bigtable API. labels Nov 22, 2022
mutianf added 2 commits November 22, 2022 20:29
@mutianf
add some comments
c182089
@mutianf
add a test for full table scan
60a73ad
@product-auto-label product-auto-label Bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Nov 23, 2022
@mutianf
fix format
72dde6f
igorbernstein2
igorbernstein2 reviewed Nov 29, 2022
View reviewed changes
Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Outdated
this.query = query;
this.chunkSize = chunkSize;
this.prevSplitPoint = ByteString.EMPTY;
this.firstRun = true;

@igorbernstein2 igorbernstein2 Nov 29, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to set the limit on the query here? otherwise gtNextQuery will return the wrong thing

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mutianf mutianf Nov 29, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm this should be handled by advnace and getNextQuery needs to be called after advance:

Query query = Query.create(...).range("a", "z");
Query.QueryPaginator paginator = query.createQueryPaginator(100);
ByteString lastSeenRowKey = ByteString.EMPTY;
while (paginator.advance(lastSeenRowKey)) {
    List<Row> rows = client.readRowsCallable().all().call(paginator.getNextQuery());
      for (Row row : rows) {
      // do some processing
     lastSeenRow = row;
    }
 }

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

mutianf added 3 commits November 29, 2022 12:41
@mutianf
address comments
5b6dd8e
@mutianf
update
279f58a
@mutianf
fix test
ff7ed8b
igorbernstein2
igorbernstein2 reviewed Nov 29, 2022
View reviewed changes
Comment thread google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java Outdated
private ByteString prevSplitPoint;

QueryPaginator(@Nonnull Query query, int pageSize) {
this.hasOverallLimit = query.builder.getRowsLimit() == 0 ? false : true;

@igorbernstein2 igorbernstein2 Nov 29, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.hasOverallLimit = query.builder.getRowsLimit() > 0;

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mutianf mutianf Nov 29, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♀️

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
igorbernstein2
igorbernstein2 approved these changes Nov 29, 2022
View reviewed changes

@igorbernstein2 igorbernstein2 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm after nit

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mutianf
fix nit
d115655
@mutianf mutianf added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 29, 2022
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 29, 2022
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
0860a38
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@gcf-owl-bot
gcf-owl-bot Bot requested a review from a team November 29, 2022 21:20
@mutianf
mutianf merged commit 5c8e1f6 into googleapis:main Nov 29, 2022
@mutianf
mutianf deleted the paginator branch November 29, 2022 22:21
@mutianf
mutianf restored the paginator branch November 29, 2022 22:21
@mutianf
mutianf deleted the paginator branch November 29, 2022 22:21
@mutianf
mutianf restored the paginator branch November 29, 2022 22:21
@release-please release-please Bot mentioned this pull request Nov 29, 2022
chore(main): release 2.17.0 #1516
Merged
gcf-merge-on-green Bot pushed a commit that referenced this pull request Dec 7, 2022
@release-please
chore(main): release 2.17.0 (#1516)
2f0825e
🤖 I have created a release *beep* *boop*
---


## [2.17.0](https://togithub.com/googleapis/java-bigtable/compare/v2.16.0...v2.17.0) (2022-12-07)


### Features

* Add a query paginator ([#1530](https://togithub.com/googleapis/java-bigtable/issues/1530)) ([5c8e1f6](https://togithub.com/googleapis/java-bigtable/commit/5c8e1f656b15177ecef4709b9e502cef58cca479))
* Add test proxy to java-bigtable client ([#1498](https://togithub.com/googleapis/java-bigtable/issues/1498)) ([132b4e4](https://togithub.com/googleapis/java-bigtable/commit/132b4e4fe340ca316de8eef2e2133b6dabd9dec3))
* Implement cross-project table restore ([#1536](https://togithub.com/googleapis/java-bigtable/issues/1536)) ([335977c](https://togithub.com/googleapis/java-bigtable/commit/335977c499b1776c8fa861d13195ffc49e468e0a))
* Next release from main branch is 2.17.0 ([#1514](https://togithub.com/googleapis/java-bigtable/issues/1514)) ([4fc6a93](https://togithub.com/googleapis/java-bigtable/commit/4fc6a93a25362df7bc107d48f94e1c00b6bd608d))


### Dependencies

* Update dependency com.google.cloud:google-cloud-monitoring-bom … ([#1531](https://togithub.com/googleapis/java-bigtable/issues/1531)) ([ee98338](https://togithub.com/googleapis/java-bigtable/commit/ee9833835a84cee202b142950b28704db682ac0c))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#1539](https://togithub.com/googleapis/java-bigtable/issues/1539)) ([3244cef](https://togithub.com/googleapis/java-bigtable/commit/3244cefd4d77a44bab6ccaa8f5c03e3d31575625))
* Update dependency kr.motd.maven:os-maven-plugin to v1.7.1 ([#1518](https://togithub.com/googleapis/java-bigtable/issues/1518)) ([8309681](https://togithub.com/googleapis/java-bigtable/commit/830968109a3754a12bd0bc92674fe42ae529b924))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#1537](https://togithub.com/googleapis/java-bigtable/issues/1537)) ([7f7c478](https://togithub.com/googleapis/java-bigtable/commit/7f7c478a2163c46d10ed39ea3c1b046f971d4569))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#1538](https://togithub.com/googleapis/java-bigtable/issues/1538)) ([9d3df57](https://togithub.com/googleapis/java-bigtable/commit/9d3df57d7bfeafd9cbcf56ecd58b52cc1b14ba7b))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@igorbernstein2 igorbernstein2 igorbernstein2 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigtable Issues related to the googleapis/java-bigtable API. size: l Pull request size is large.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mutianf @igorbernstein2
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.