Package net.snowflake.client.jdbc
Class SnowflakeChunkDownloader
- java.lang.Object
-
- net.snowflake.client.jdbc.SnowflakeChunkDownloader
-
- All Implemented Interfaces:
ChunkDownloader
public class SnowflakeChunkDownloader extends Object implements ChunkDownloader
Class for managing async download of offline result chunksCreated by jhuang on 11/12/14.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SnowflakeChunkDownloader.NoOpChunkDownloader
This is a No Operation chunk downloader to avoid potential null pointer exception
-
Constructor Summary
Constructors Constructor Description SnowflakeChunkDownloader(SnowflakeResultSetSerializableV1 resultSetSerializable)
Constructor to initialize downloader, which uses the default stream provider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpClientSettingsKey
getHttpClientSettingsKey()
SnowflakeResultChunk
getNextChunkToConsume()
The method does the following:OCSPMode
getOCSPMode()
ResultStreamProvider
getResultStreamProvider()
DownloaderMetrics
terminate()
terminate the downloader
-
-
-
Constructor Detail
-
SnowflakeChunkDownloader
public SnowflakeChunkDownloader(SnowflakeResultSetSerializableV1 resultSetSerializable) throws SnowflakeSQLException
Constructor to initialize downloader, which uses the default stream provider- Parameters:
resultSetSerializable
- the result set serializable object which includes required metadata to start chunk downloader- Throws:
SnowflakeSQLException
-
-
Method Detail
-
getOCSPMode
public OCSPMode getOCSPMode()
-
getHttpClientSettingsKey
public HttpClientSettingsKey getHttpClientSettingsKey()
-
getResultStreamProvider
public ResultStreamProvider getResultStreamProvider()
-
getNextChunkToConsume
public SnowflakeResultChunk getNextChunkToConsume() throws InterruptedException, SnowflakeSQLException
The method does the following:1. free the previous chunk data and submit a new chunk to be downloaded
2. get next chunk to consume, if it is not ready for consumption, it waits until it is ready
- Specified by:
getNextChunkToConsume
in interfaceChunkDownloader
- Returns:
- next SnowflakeResultChunk to be consumed
- Throws:
InterruptedException
- if downloading thread was interruptedSnowflakeSQLException
- if downloader encountered an error
-
terminate
public DownloaderMetrics terminate() throws InterruptedException
terminate the downloader- Specified by:
terminate
in interfaceChunkDownloader
- Returns:
- chunk downloader metrics collected over instance lifetime
- Throws:
InterruptedException
-
-