Package com.databricks.jdbc.model.core
Class ChunkLinkFetchResult
- java.lang.Object
-
- com.databricks.jdbc.model.core.ChunkLinkFetchResult
-
public class ChunkLinkFetchResult extends Object
Result of fetching chunk links from the server.Contains the fetched chunk links and continuation information for both SEA and Thrift protocols:
- SEA: Uses chunkIndex for continuation, hasMore derived from nextChunkIndex on last link
- Thrift: Uses rowOffset for continuation, hasMore from server's hasMoreRows flag
Each
ExternalLinkcontains chunkIndex, rowCount, rowOffset, and the download URL.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ChunkLinkFetchResultendOfStream()Creates a result indicating the end of the stream (no more chunks).List<ExternalLink>getChunkLinks()Returns the list of external links fetched in this batch.longgetNextFetchIndex()Returns the next chunk index to fetch from.longgetNextRowOffset()Returns the next row offset for Thrift FETCH_ABSOLUTE continuation.booleanhasMore()Returns whether more chunks are available after this batch.booleanisEndOfStream()Checks if this result represents the end of the chunk stream.static ChunkLinkFetchResultof(List<ExternalLink> links, boolean hasMore, long nextFetchIndex, long nextRowOffset)Creates a result with the given links and continuation info.
-
-
-
Method Detail
-
of
public static ChunkLinkFetchResult of(List<ExternalLink> links, boolean hasMore, long nextFetchIndex, long nextRowOffset)
Creates a result with the given links and continuation info.- Parameters:
links- The fetched external links (each contains chunkIndex, rowCount, rowOffset, URL)hasMore- Whether more chunks are availablenextFetchIndex- The next chunk index to fetch from, or -1 if no morenextRowOffset- The next row offset for Thrift FETCH_ABSOLUTE- Returns:
- A new ChunkLinkFetchResult
-
endOfStream
public static ChunkLinkFetchResult endOfStream()
Creates a result indicating the end of the stream (no more chunks).- Returns:
- A ChunkLinkFetchResult representing end of stream
-
getChunkLinks
public List<ExternalLink> getChunkLinks()
Returns the list of external links fetched in this batch.- Returns:
- List of ExternalLink, may be empty
-
hasMore
public boolean hasMore()
Returns whether more chunks are available after this batch.- Returns:
- true if more chunks can be fetched, false otherwise
-
getNextFetchIndex
public long getNextFetchIndex()
Returns the next chunk index to fetch from.- Returns:
- The next fetch index, or -1 if no more chunks
-
getNextRowOffset
public long getNextRowOffset()
Returns the next row offset for Thrift FETCH_ABSOLUTE continuation.- Returns:
- The next row offset, or 0 if not applicable
-
isEndOfStream
public boolean isEndOfStream()
Checks if this result represents the end of the chunk stream.- Returns:
- true if no more chunks are available
-
-