Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move inner classes to top level #2846

Merged
merged 6 commits into from
Feb 9, 2024
Merged

Conversation

olavloite
Copy link
Collaborator

@olavloite olavloite commented Jan 27, 2024

Moves the gRPC-related inner classes from AbstractResultSet to top-level classes, so they are easier to modify and maintain.

This change only contains modifications that are needed to move these inner classes. There are no functional changes.

Details

The inner classes that are moved from AbstractResultSet.java to the top level are:

  • GrpcResultSet
  • GrpcStreamIterator
  • GrpcStruct
  • GrpcValueIterator
  • ResumableStreamIterator

The above classes were previously all static inner classes defined in the AbstractResultSet class, which made that file extremely long and hard to maintain. The changes in this PR all come from moving these classes to individual files. The access modifiers of all these classes were either private or package private. They are now all package private, so they can be used within the same package. They are not accessible to outside users, meaning that this refactor does not have any impact on end users.

Move the gRPC-related inner classes from AbstractResultSet to
top-level classes, so they are easier to modify and maintain.

This change only contains modifications that are needed to move
these inner classes. There are no functional changes.
@olavloite olavloite requested a review from a team as a code owner January 27, 2024 09:11
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: spanner Issues related to the googleapis/java-spanner API. labels Jan 27, 2024
@olavloite olavloite added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 27, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 27, 2024
olavloite and others added 2 commits February 9, 2024 16:01
* feat: support lazy decoding of query results

Adds an option for lazy decoding of query results. Currently, all values
in a query result row are decoded from protobuf values to plain Java
objects at the moment that the result set is advanced to the next row.
This means that all values are decoded, regardless whether the
application actually fetches these or not.

Lazy decoding also enables the possibility for (internal) consumers
of a result set to access the protobuf value before it is converted
to a plain Java object. This for example allows ChecksumResultSet to
calculate the checksum based on the protobuf value, instead of a
Java object, which can be more efficient.

* fix: add null check

* perf: calculate checksum using protobuf values (#2848)

* perf: calculate checksum using protobuf values

* chore: cleanup

* test: remove unrelated test

* fix: undo change to public API

* chore: cleanup|
@olavloite olavloite requested a review from a team as a code owner February 9, 2024 15:03
@olavloite olavloite merged commit 0e96d1f into main Feb 9, 2024
26 of 27 checks passed
@olavloite olavloite deleted the refactor-grpc-result-set branch February 9, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants