Class RemoteChunkProvider
- java.lang.Object
-
- com.databricks.jdbc.api.impl.arrow.RemoteChunkProvider
-
- All Implemented Interfaces:
ChunkProvider
public class RemoteChunkProvider extends Object implements ChunkProvider
Class to manage Arrow chunks and fetch them on proactive basis.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the chunk provider and releases any resources associated with it.voiddownloadLinks(long chunkIndexToDownloadLink)voiddownloadProcessed(long chunkIndex)ArrowResultChunkgetChunk()Retrieves the current chunk of data after a successful call toChunkProvider.next().CompressionTypegetCompressionType()booleanhasNextChunk()Checks if there are more chunks available to iterate over.booleannext()Advances to the next available chunk.
-
-
-
Method Detail
-
downloadProcessed
public void downloadProcessed(long chunkIndex)
-
downloadLinks
public void downloadLinks(long chunkIndexToDownloadLink) throws DatabricksSQLException- Throws:
DatabricksSQLException
-
getChunk
public ArrowResultChunk getChunk() throws DatabricksSQLException
Retrieves the current chunk of data after a successful call toChunkProvider.next().Fetches the chunk for the given index. If chunk is not already downloaded, will download the chunk first
- Specified by:
getChunkin interfaceChunkProvider- Returns:
- the chunk at given index
- Throws:
DatabricksSQLException- if an error occurs while fetching the chunk.
-
getCompressionType
public CompressionType getCompressionType()
-
hasNextChunk
public boolean hasNextChunk()
Checks if there are more chunks available to iterate over.- Specified by:
hasNextChunkin interfaceChunkProvider- Returns:
trueif there are additional chunks to be retrieved;falseotherwise.
-
next
public boolean next()
Advances to the next available chunk. This method should be called before callingChunkProvider.getChunk()to retrieve the data from the next chunk.- Specified by:
nextin interfaceChunkProvider- Returns:
trueif the next chunk was successfully moved to;falseif there are no more chunks.
-
close
public void close()
Closes the chunk provider and releases any resources associated with it. After calling this method, the chunk provider should not be used again.Release all chunks from memory. This would be called when result-set has been closed.
- Specified by:
closein interfaceChunkProvider
-
-