Repository navigation
Commit 7e21009
committed
refactor(spanner): decompose AbstractReadContext and deduplicate stream creation
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 f1db2bb commit 7e21009
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