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 Constructor Description SeaChunkLinkFetcher(IDatabricksSession session, StatementId statementId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes any resources held by the fetcher.ChunkLinkFetchResultfetchLinks(long startChunkIndex, long startRowOffset)Fetches the next batch of chunk links starting from the given position.ExternalLinkrefetchLink(long chunkIndex, long rowOffset)Refetches a specific chunk link that may have expired.
-
-
-
Constructor Detail
-
SeaChunkLinkFetcher
public SeaChunkLinkFetcher(IDatabricksSession session, StatementId statementId)
-
-
Method Detail
-
fetchLinks
public ChunkLinkFetchResult fetchLinks(long startChunkIndex, long startRowOffset) throws SQLException
Description copied from interface:ChunkLinkFetcherFetches 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
ChunkLinkFetchResultindicates 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:
fetchLinksin interfaceChunkLinkFetcher- 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:
SQLException- if the fetch operation fails
-
refetchLink
public ExternalLink refetchLink(long chunkIndex, long rowOffset) throws SQLException
Description copied from interface:ChunkLinkFetcherRefetches 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:
refetchLinkin interfaceChunkLinkFetcher- 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:
SQLException- if the refetch operation fails
-
close
public void close()
Description copied from interface:ChunkLinkFetcherCloses any resources held by the fetcher.- Specified by:
closein interfaceChunkLinkFetcher
-
-