Class 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 ExternalLink contains chunkIndex, rowCount, rowOffset, and the download URL.

    • 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 available
        nextFetchIndex - The next chunk index to fetch from, or -1 if no more
        nextRowOffset - 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