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

## 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
`void` `close()` Closes the chunk provider and releases any resources associated with it.
`void` `downloadLinks​(long chunkIndexToDownloadLink)`
`void` `downloadProcessed​(long chunkIndex)`
`ArrowResultChunk` `getChunk()` Retrieves the current chunk of data after a successful call to `ChunkProvider.next()`.
`CompressionType` `getCompressionType()`
`boolean` `hasNextChunk()` Checks if there are more chunks available to iterate over.
`boolean` `next()` Advances to the next available chunk.

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

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

### 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 to `ChunkProvider.next()`.

Fetches the chunk for the given index. If chunk is not already downloaded, will download the chunk first

Specified by:
  `getChunk` in interface `ChunkProvider`
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:
  `hasNextChunk` in interface `ChunkProvider`
Returns:
  `true` if there are additional chunks to be retrieved; `false` otherwise.

#### next

    public boolean next()

Advances to the next available chunk. This method should be called before calling `ChunkProvider.getChunk()` to retrieve the data from the next chunk.

Specified by:
  `next` in interface `ChunkProvider`
Returns:
  `true` if the next chunk was successfully moved to; `false` if 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:
  `close` in interface `ChunkProvider`