# 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
Constructor
Description
`ArrowResultChunkStateMachine(ChunkStatus initialStatus, long chunkIndex, StatementId statementId)`

## Method Summary

Modifier and Type
Method
Description
`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 Details

### ArrowResultChunkStateMachine

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

## Method Details

### 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