| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
This PR sets the stage for ReadRows by implementing the row merging in a RowMergingCallable. In a future commit, this callable will be part of a chain that will implement the ReadRowsCallable chain. For now its disconnected. The implementation relies on ReframingResponseObserver to handle flow control and integrates with it by implementing the Reframer interface in RowMerger. The RowMerger, simply glues the Reframer api to the StateMachine. The StateMachine contains all of the logic of merging rows.
There was a problem hiding this comment.
Some comments, more to come.
Sorry, something went wrong.
| if (byteA == byteB) { | ||
| continue; | ||
| } | ||
| return byteA < byteB ? -1 : 1; |
| if (sizeA == sizeB) { | ||
| return 0; | ||
| } | ||
| return sizeA < sizeB ? -1 : 1; |
| buffer = response; | ||
| nextChunk = 0; | ||
|
|
||
| // If the server sends a scan heartbeat, wrap it in a synthetic row that will be be filtered out |
| nextChunk = 0; | ||
|
|
||
| // If the server sends a scan heartbeat, wrap it in a synthetic row that will be be filtered out | ||
| // after the resume logic. |
|
|
||
| @Override | ||
| public boolean hasFullFrame() { | ||
| return nextRow != null || readNextRow(); |
| * <p>Package-private for internal use. | ||
| */ | ||
| @InternalApi | ||
| class RowMerger<RowT> implements Reframer<RowT, ReadRowsResponse> { |
|
|
||
| @Override | ||
| public boolean hasPartialFrame() { | ||
| return hasFullFrame() || stateMachine.isRowInProgress(); |
|
|
||
| @Override | ||
| public RowT pop() { | ||
| RowT row = nextRow; |
|
Ok, I think I addressed all of Kevin's feedback. @pongad @garrettjonesgoogle, this should be ready for you |
Sorry, something went wrong.
|
LGTM, please ask Gary to take a look as well. |
Sorry, something went wrong.
|
@garye can you take a look as well? |
Sorry, something went wrong.
| * | ||
| * <ul> | ||
| * <li>Logical rows that were constructed using the {@link RowBuilder} | ||
| * <li>Special marker rows that represent resumption points that were sent by Last scanned row |
| /** | ||
| * Feeds the last scanned serverside key into the state machine. The adapter will wrap this key in | ||
| * a special marker row that can be used downstream for efficient resume. It is the callers | ||
| * responsibility to eventually filter out this row. |
|
|
||
| /** | ||
| * Feeds the last scanned serverside key into the state machine. The adapter will wrap this key in | ||
| * a special marker row that can be used downstream for efficient resume. It is the callers |
| * <dt>Valid states: | ||
| * <dd>{@link StateMachine#AWAITING_NEW_ROW} | ||
| * <dt>Resulting states: | ||
| * <dd>{@link StateMachine#AWAITING_ROW_CONSUME} |
|
|
||
| /** | ||
| * Returns the last completed row and transitions to awaiting a new row. | ||
| * |
|
|
||
| @Override | ||
| State handleChunk(CellChunk chunk) { | ||
| validate(!chunk.getResetRow(), "AWAITING_NEW_ROW: can't reset"); |
| rowKey = chunk.getRowKey(); | ||
| adapter.startRow(rowKey); | ||
|
|
||
| // auto transition |
| } | ||
| adapter.finishCell(); | ||
|
|
||
| if (!chunk.getCommitRow()) { |
| } | ||
| }; | ||
|
|
||
| private static final State AWAITING_ROW_CONSUME = |
|
@garye Thanks for reviewing, I think addressed all feedback. PTAL |
Sorry, something went wrong.
There was a problem hiding this comment.
A few nits but looks good as far as I can tell otherwise. I'm not qualified to fully review the state machine though :(
Sorry, something went wrong.
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package com.google.cloud.bigtable.data.v2.stub.read_rows; |
|
|
||
| /** | ||
| * Feeds a new chunk into the sate machine. If the chunk is invalid, the state machine will throw | ||
| * an exception and should be used for further input. |
|
Please merge when ready. |
Sorry, something went wrong.
#2914) * chore: Update generation configuration at Tue Mar 18 16:57:20 UTC 2025 * chore: Update generation configuration at Tue Mar 18 17:05:10 UTC 2025 * chore: Update generation configuration at Tue Mar 18 18:42:23 UTC 2025
… to v2.27.3 (#2914) * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.27.3 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
#2914) * chore: Update generation configuration at Tue Mar 18 16:57:20 UTC 2025 * chore: Update generation configuration at Tue Mar 18 17:05:10 UTC 2025 * chore: Update generation configuration at Tue Mar 18 18:42:23 UTC 2025
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
| Back | FazBrowse Home | New Git URL |
This PR sets the stage for ReadRows by implementing the row merging in a RowMergingCallable. In a future commit, this callable will be part of a chain that will implement the ReadRowsCallable chain. For now its disconnected.
The implementation relies on ReframingResponseObserver to handle flow control and integrates with it by implementing the Reframer interface in RowMerger.
The RowMerger, simply glues the Reframer api to the StateMachine.
The StateMachine contains all of the logic of merging rows.
This has not been reviewed yet by anyone on the Bigtable team.
@kevinsi4508 can you take a look at this when you have a (very long) moment?
For reference the reframing logic was merged in this PR:
#2907