Refactor: Move fetchNextRows() to Action Pattern
Summary
Refactor the fetchNextRows() method in StatementServiceImpl to follow the Action pattern, extracting the logic into a dedicated FetchNextRowsAction class.
Context
As part of the ongoing refactoring of StatementServiceImpl (a 2,528-line "God class"), we are extracting each public method into focused Action classes.
- Reference: The
connect() method has already been implemented as a pattern reference (see PR #XXX).
Task
Extract the fetchNextRows() method logic into FetchNextRowsAction.
- Current Location:
StatementServiceImpl.fetchNextRows() (line ~948)
- Target Package:
org.openjproxy.grpc.server.action.statement.FetchNextRowsAction
Implementation Steps
- Create
FetchNextRowsAction class implementing Action<ResultSetFetchRequest, OpResult>.
- Extract logic from
StatementServiceImpl.fetchNextRows() into the action.
- Handle ResultSet continuation logic within the new class.
- Update method to use
context.getSessionManager() and other shared state.
- Delegate the call in
StatementServiceImpl:
public void fetchNextRows(ResultSetFetchRequest request, StreamObserver<OpResult> responseObserver) {
new FetchNextRowsAction(actionContext).execute(request, responseObserver);
}
- Compile and test to ensure no regressions.
Technical Details
| Attribute |
Details |
| Complexity |
Medium (Estimated 80-100 lines) |
| Focus |
ResultSet fetching and pagination logic |
| Package |
org.openjproxy.grpc.server.action.statement |
References
Acceptance Criteria
Refactor: Move
fetchNextRows()to Action PatternSummary
Refactor the
fetchNextRows()method inStatementServiceImplto follow the Action pattern, extracting the logic into a dedicatedFetchNextRowsActionclass.Context
As part of the ongoing refactoring of
StatementServiceImpl(a 2,528-line "God class"), we are extracting each public method into focused Action classes.connect()method has already been implemented as a pattern reference (see PR #XXX).Task
Extract the
fetchNextRows()method logic intoFetchNextRowsAction.StatementServiceImpl.fetchNextRows()(line ~948)org.openjproxy.grpc.server.action.statement.FetchNextRowsActionImplementation Steps
FetchNextRowsActionclass implementingAction<ResultSetFetchRequest, OpResult>.StatementServiceImpl.fetchNextRows()into the action.context.getSessionManager()and other shared state.StatementServiceImpl:Technical Details
org.openjproxy.grpc.server.action.statementReferences
STATEMENTSERVICE_ACTION_PATTERN_MIGRATION.mdAcceptance Criteria
FetchNextRowsActionclass created.StatementServiceImpl.StatementServiceImpl.fetchNextRows()delegates to the new action.