public class SnowflakeChunkDownloader extends Object implements ChunkDownloader
Created by jhuang on 11/12/14.
| Constructor and Description |
|---|
SnowflakeChunkDownloader(int colCount,
com.fasterxml.jackson.databind.JsonNode chunksData,
int prefetchThreads,
String qrmk,
com.fasterxml.jackson.databind.JsonNode chunkHeaders,
int networkTimeoutInMilli,
boolean useJsonParserV2,
long memoryLimit,
QueryResultFormat queryResultFormat,
SFSession sfSession)
Constructor to initialize downloader
|
| Modifier and Type | Method and Description |
|---|---|
SnowflakeResultChunk |
getNextChunkToConsume()
The method does the following:
|
DownloaderMetrics |
terminate()
terminate the downloader
|
public SnowflakeChunkDownloader(int colCount,
com.fasterxml.jackson.databind.JsonNode chunksData,
int prefetchThreads,
String qrmk,
com.fasterxml.jackson.databind.JsonNode chunkHeaders,
int networkTimeoutInMilli,
boolean useJsonParserV2,
long memoryLimit,
QueryResultFormat queryResultFormat,
SFSession sfSession)
throws SnowflakeSQLException
colCount - number of columns to expectchunksData - JSON object contains all the chunk informationprefetchThreads - number of prefetch threadsqrmk - Query Result Master KeychunkHeaders - JSON object contains information about chunk headersnetworkTimeoutInMilli - network timeoutuseJsonParserV2 - should JsonParserV2 be used instead of objectmemoryLimit - memory limit for chunk buffersfSession - current sessionSnowflakeSQLExceptionpublic SnowflakeResultChunk getNextChunkToConsume() throws InterruptedException, SnowflakeSQLException
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
getNextChunkToConsume in interface ChunkDownloaderInterruptedException - if downloading thread was interruptedSnowflakeSQLException - if downloader encountered an errorpublic DownloaderMetrics terminate()
terminate in interface ChunkDownloaderCopyright © 2019. All rights reserved.