Repository navigation
Commit 4663c43
authored
refactor(spanner): decompose AbstractReadContext and deduplicate stream creation (#14667)
This is a pure refactoring with zero behavioral or public API changes:
1. Subclass Extraction:
- Extract `SingleReadContext`, `SingleUseReadOnlyTransaction`, and
`MultiUseReadOnlyTransaction` from inner classes in
`AbstractReadContext` into dedicated package-private top-level classes
in `com.google.cloud.spanner`.
- Add class-level Javadocs describing the lifecycle and purpose of each
read-only transaction type.
2. Stream Creation Deduplication:
- Deduplicate shared `ResumableStreamIterator` construction, stream
listener registration, transaction selector setup, and RPC execution
error handling between `executeQueryInternalWithOptions` and
`readInternalWithOptions` in `AbstractReadContext` using private helper
methods (`createStreamingResultSet`, `executeCall`,
`prepareTransactionSelector`).
3. Import & Reference Cleanup:
- Remove obsolete inner-class imports across `SessionImpl` and
`BatchClientImpl`.
- Remove redundant superclass static imports in the extracted classes.
- Update `AsyncReadOnlyTransactionTest` to reference the top-level
`MultiUseReadOnlyTransaction`.1 parent 013b49b commit 4663c43
7 files changed
Lines changed: 1038 additions & 914 deletions
File tree
- java-spanner/google-cloud-spanner/src
- main/java/com/google/cloud/spanner
- test/java/com/google/cloud/spanner
0 commit comments