public class SnowflakeChunkDownloader extends Object
Created by jhuang on 11/12/14.
| Modifier and Type | Class and Description |
|---|---|
class |
SnowflakeChunkDownloader.Metrics |
| 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)
Constructor to initialize downloader
|
| Modifier and Type | Method and Description |
|---|---|
static long |
getCurrentMemoryUsage() |
SnowflakeResultChunk |
getNextChunkToConsume()
The method does the following:
|
void |
releaseAllChunkMemoryUsage()
release all existing chunk memory usage before close
|
SnowflakeChunkDownloader.Metrics |
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)
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 bufferSnowflakeSQLExceptionpublic static long getCurrentMemoryUsage()
public void releaseAllChunkMemoryUsage()
public 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
InterruptedException - if downloading thread was interruptedSnowflakeSQLException - if downloader encountered an errorpublic SnowflakeChunkDownloader.Metrics terminate()
Copyright © 2019. All rights reserved.