Package com.databricks.jdbc.api.impl.arrow

## Class ArrowResultChunkStateMachine

- java.lang.Object
- - com.databricks.jdbc.api.impl.arrow.ArrowResultChunkStateMachine

    public class ArrowResultChunkStateMachine
    extends Object

Manages state transitions for ArrowResultChunk. Enforces valid state transitions and provides clear error messages for invalid transitions.

### Constructor Summary

Constructors
`ArrowResultChunkStateMachine​(ChunkStatus initialStatus, long chunkIndex, StatementId statementId)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ChunkStatus` `getCurrentStatus()` Returns the current state of the chunk.
`Set<ChunkStatus>` `getValidTargetStates()` Returns a set of valid target states from the current state.
`boolean` `isValidTransition​(ChunkStatus targetStatus)` Checks if a transition to the target state is valid from the current state.
`void` `transition​(ChunkStatus targetStatus)` Attempts to transition to the target state.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ArrowResultChunkStateMachine

    public ArrowResultChunkStateMachine​(ChunkStatus initialStatus,
                                        long chunkIndex,
                                        StatementId statementId)

### Method Detail

#### transition

    public void transition​(ChunkStatus targetStatus)
                    throws DatabricksParsingException

Attempts to transition to the target state.

Parameters:
  `targetStatus` - The desired target state
Throws:
  `DatabricksParsingException` - if the transition is invalid

#### isValidTransition

    public boolean isValidTransition​(ChunkStatus targetStatus)

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

    public Set<ChunkStatus> getValidTargetStates()

Returns a set of valid target states from the current state.

Returns:
  Set of valid target states

#### getCurrentStatus

    public ChunkStatus getCurrentStatus()

Returns the current state of the chunk.

Returns:
  current ChunkStatus