Class ArrowResultChunkStateMachine
java.lang.Object
com.databricks.jdbc.api.impl.arrow.ArrowResultChunkStateMachine
Manages state transitions for ArrowResultChunk. Enforces valid state transitions and provides
clear error messages for invalid transitions.
-
Constructor Summary
ConstructorsConstructorDescriptionArrowResultChunkStateMachine(ChunkStatus initialStatus, long chunkIndex, StatementId statementId) -
Method Summary
Modifier and TypeMethodDescriptionReturns the current state of the chunk.Returns a set of valid target states from the current state.booleanisValidTransition(ChunkStatus targetStatus) Checks if a transition to the target state is valid from the current state.voidtransition(ChunkStatus targetStatus) Attempts to transition to the target state.
-
Constructor Details
-
ArrowResultChunkStateMachine
public ArrowResultChunkStateMachine(ChunkStatus initialStatus, long chunkIndex, StatementId statementId)
-
-
Method Details
-
transition
Attempts to transition to the target state.- Parameters:
targetStatus- The desired target state- Throws:
DatabricksParsingException- if the transition is invalid
-
isValidTransition
Checks if a transition to the target state is valid from the current state.- Parameters:
targetStatus- The target state to check- Returns:
- true if the transition is valid, false otherwise
-
getValidTargetStates
Returns a set of valid target states from the current state.- Returns:
- Set of valid target states
-
getCurrentStatus
Returns the current state of the chunk.- Returns:
- current ChunkStatus
-