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

## Class SeaChunkLinkFetcher

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

All Implemented Interfaces:
  `ChunkLinkFetcher`

    public class SeaChunkLinkFetcher
    extends Object
    implements ChunkLinkFetcher

ChunkLinkFetcher implementation for the SQL Execution API (SEA) client.

SEA provides chunk links via the getResultChunks API, which returns links with nextChunkIndex to indicate continuation. When nextChunkIndex is null, it indicates no more chunks.

### Constructor Summary

Constructors
`SeaChunkLinkFetcher​(IDatabricksSession session, StatementId statementId)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Closes any resources held by the fetcher.
`ChunkLinkFetchResult` `fetchLinks​(long startChunkIndex, long startRowOffset)` Fetches the next batch of chunk links starting from the given position.
`ExternalLink` `refetchLink​(long chunkIndex, long rowOffset)` Refetches a specific chunk link that may have expired.

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

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

### Constructor Detail

#### SeaChunkLinkFetcher

    public SeaChunkLinkFetcher​(IDatabricksSession session,
                               StatementId statementId)

### Method Detail

#### fetchLinks

    public ChunkLinkFetchResult fetchLinks​(long startChunkIndex,
                                           long startRowOffset)
                                    throws DatabricksSQLException

Description copied from interface: `ChunkLinkFetcher`
Fetches the next batch of chunk links starting from the given position.

The implementation may return one or more links in a single call. The returned `ChunkLinkFetchResult` indicates whether more chunks are available.

SEA implementations use startChunkIndex while Thrift implementations use startRowOffset. Each implementation uses the parameter relevant to its protocol and ignores the other.

Specified by:
  `fetchLinks` in interface `ChunkLinkFetcher`
Parameters:
  `startChunkIndex` - The chunk index to start fetching from (used by SEA)
  `startRowOffset` - The row offset to start fetching from (used by Thrift with FETCH_ABSOLUTE)
Returns:
  ChunkLinkFetchResult containing the fetched links and continuation information
Throws:
  `DatabricksSQLException` - if the fetch operation fails

#### refetchLink

    public ExternalLink refetchLink​(long chunkIndex,
                                    long rowOffset)
                             throws DatabricksSQLException

Description copied from interface: `ChunkLinkFetcher`
Refetches a specific chunk link that may have expired.

This is used when a previously fetched link has expired before the chunk could be downloaded. Both SEA and Thrift clients support this via the getResultChunks API.

SEA uses chunkIndex while Thrift uses rowOffset to identify the chunk to refetch.

Specified by:
  `refetchLink` in interface `ChunkLinkFetcher`
Parameters:
  `chunkIndex` - The specific chunk index to refetch (used by SEA)
  `rowOffset` - The row offset of the chunk to refetch (used by Thrift)
Returns:
  The refreshed ExternalLink with a new expiration time
Throws:
  `DatabricksSQLException` - if the refetch operation fails

#### close

    public void close()

Description copied from interface: `ChunkLinkFetcher`
Closes any resources held by the fetcher.

Specified by:
  `close` in interface `ChunkLinkFetcher`