feat: make executeQuery ResultSet streaming block size configurable via ojp.resultset.rowsPerBlock#509
Merged
Conversation
…ia ojp.resultset.rowsPerBlock Agent-Logs-Url: https://github.com/Open-J-Proxy/ojp/sessions/15b7519d-cf95-4640-ba65-9152519356d8 Co-authored-by: rrobetti <7221783+rrobetti@users.noreply.github.com>
…impler next() mock, better assertions Agent-Logs-Url: https://github.com/Open-J-Proxy/ojp/sessions/15b7519d-cf95-4640-ba65-9152519356d8 Co-authored-by: rrobetti <7221783+rrobetti@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
rrobetti
May 14, 2026 07:26
View session
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces the hardcoded
ROWS_PER_RESULT_SET_DATA_BLOCK = 100constant in the server-side query streaming path with a configurable server propertyojp.resultset.rowsPerBlock, while preserving existing behaviour by defaulting to 100.Fixes #[link to issue if applicable]
Changes
New property
ojp.resultset.rowsPerBlockOJP_RESULTSET_ROWSPERBLOCKValues outside 1–10000 are rejected and the default is used instead.
Files changed
ojp-grpc-commonsCommonConstants.java– addedDEFAULT_RESULTSET_ROWS_PER_BLOCKalias andRESULTSET_ROWS_PER_BLOCK_PROPERTYkey constant.ojp-serverServerConfiguration.java– newresultsetRowsPerBlockfield initialised via the newgetBoundedIntPropertyhelper (validates min=1, max=10000), getter, and startup log line.ResultSetHelper.java–handleResultSetnow readscontext.getServerConfiguration().getResultsetRowsPerBlock()instead of the constant. Javadoc updated.ojp-jdbc-driverResultSet.java–getRow()fixed to accumulatecompletedBlocksRowCountas blocks are received instead of multiplyingblockCount × ROWS_PER_RESULT_SET_DATA_BLOCK. This makesgetRow()return correct absolute row numbers for any block size.Tests
ServerConfigurationTest.java– 8 new tests: default value (100), custom value, min boundary (1), max boundary (10000), below-min (0→default), above-max (10001→default), negative (−1→default), invalid string (→default).ResultSetHelperBlockSizeTest.java– 7 new unit tests: default block size, block < result size, block == result size, block > result size, non-multiple block size, empty result set, block size 1 (one row per message), and labels-only-in-first-block.Documentation
ojp-server-configuration.md– new "ResultSet Streaming Settings" section with property table and tuning guidance.ojp-server-example.properties–ojp.resultset.rowsPerBlock=100entry with comment.Acceptance criteria met
ROWS_PER_RESULT_SET_DATA_BLOCKis kept as the default source-of-truth value only).