net.snowflake.client.jdbc

## Class SnowflakeChunkDownloader

- java.lang.Object
- - net.snowflake.client.jdbc.SnowflakeChunkDownloader

    public class SnowflakeChunkDownloader
    extends Object

Class for managing async download of offline result chunks Created by jhuang on 11/12/14.

### Constructor Summary

Constructors
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 useJsonParser, long memoryLimit, boolean efficientChunkStorage)` Constructor to initialize downloader

### Method Summary

All Methods Instance Methods Concrete Methods
`SnowflakeResultChunk` `getNextChunkToConsume()` The method does the following: 1.
`void` `terminate()` terminate the downloader

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

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

### Constructor Detail

#### SnowflakeChunkDownloader

    public SnowflakeChunkDownloader(int colCount,
                                    com.fasterxml.jackson.databind.JsonNode chunksData,
                                    int prefetchThreads,
                                    String qrmk,
                                    com.fasterxml.jackson.databind.JsonNode chunkHeaders,
                                    int networkTimeoutInMilli,
                                    boolean useJsonParser,
                                    long memoryLimit,
                                    boolean efficientChunkStorage)

Constructor to initialize downloader

Parameters:
  `colCount` - number of columns to expect
  `chunksData` - JSON object contains all the chunk information
  `prefetchThreads` - number of prefetch threads
  `qrmk` - Query Result Master Key
  `chunkHeaders` - JSON object contains information about chunk headers
  `networkTimeoutInMilli` - network timeout
  `useJsonParser` - should JsonParser be used instead of object
  `efficientChunkStorage` - use new efficient storage format

### Method Detail

#### 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

Returns:
  next SnowflakeResultChunk to be consumed
Throws:
  `InterruptedException` - if downloading thread was interrupted
  `SnowflakeSQLException` - if downloader encountered an error

#### terminate

    public void terminate()

terminate the downloader