Package net.snowflake.client.jdbc
Class JsonResultChunk
- java.lang.Object
-
- net.snowflake.client.jdbc.SnowflakeResultChunk
-
- net.snowflake.client.jdbc.JsonResultChunk
-
public class JsonResultChunk extends SnowflakeResultChunk
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.snowflake.client.jdbc.SnowflakeResultChunk
SnowflakeResultChunk.DownloadState
-
-
Constructor Summary
Constructors Constructor Description JsonResultChunk(String url, int rowCount, int colCount, int uncompressedSize, SFBaseSession session)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddByte(byte b, int pos)voidaddBytes(byte[] src, int offset, int pos, int length)voidaddOffset(int offset)voidaddRow(Object[] row)intcomputeCharactersNeeded()longcomputeNeededChunkMemory()Compute the memory necessary to store the data of this chunkvoidensureRowsComplete()Checks that all data has been added after parsing.static ObjectextractCell(com.fasterxml.jackson.databind.JsonNode resultData, int rowIdx, int colIdx)voidfreeData()byteget(int offset)ObjectgetCell(int rowIdx, int colIdx)Creates a String object for the given cellvoidnextIndex()voidreset()voidsetIsNull()voidsetLastLength(int len)voidtryReuse(net.snowflake.client.jdbc.JsonResultChunk.ResultChunkDataCache cache)-
Methods inherited from class net.snowflake.client.jdbc.SnowflakeResultChunk
getColCount, getDownloadCondition, getDownloadError, getDownloadState, getDownloadTime, getLock, getParseTime, getRowCount, getScrubbedUrl, getUncompressedSize, getUrl, isReleased, setDownloadError, setDownloadState, setDownloadTime, setParseTime, setReleased
-
-
-
-
Constructor Detail
-
JsonResultChunk
public JsonResultChunk(String url, int rowCount, int colCount, int uncompressedSize, SFBaseSession session)
-
-
Method Detail
-
extractCell
public static Object extractCell(com.fasterxml.jackson.databind.JsonNode resultData, int rowIdx, int colIdx)
-
tryReuse
public void tryReuse(net.snowflake.client.jdbc.JsonResultChunk.ResultChunkDataCache cache)
-
getCell
public final Object getCell(int rowIdx, int colIdx)
Creates a String object for the given cell- Parameters:
rowIdx- zero based rowcolIdx- zero based column- Returns:
- String
-
addRow
public final void addRow(Object[] row) throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
ensureRowsComplete
public final void ensureRowsComplete() throws SnowflakeSQLExceptionChecks that all data has been added after parsing.- Throws:
SnowflakeSQLException- when rows are not all downloaded
-
reset
public void reset()
-
computeNeededChunkMemory
public final long computeNeededChunkMemory()
Compute the memory necessary to store the data of this chunk- Returns:
- necessary memory in bytes
-
freeData
public final void freeData()
-
computeCharactersNeeded
public int computeCharactersNeeded()
-
addOffset
public void addOffset(int offset) throws SnowflakeSQLException- Throws:
SnowflakeSQLException
-
setIsNull
public void setIsNull() throws SnowflakeSQLException- Throws:
SnowflakeSQLException
-
setLastLength
public void setLastLength(int len) throws SnowflakeSQLException- Throws:
SnowflakeSQLException
-
nextIndex
public void nextIndex() throws SnowflakeSQLException- Throws:
SnowflakeSQLException
-
get
public byte get(int offset) throws SnowflakeSQLException- Throws:
SnowflakeSQLException
-
addByte
public void addByte(byte b, int pos) throws SnowflakeSQLException- Throws:
SnowflakeSQLException
-
addBytes
public void addBytes(byte[] src, int offset, int pos, int length) throws SnowflakeSQLException- Throws:
SnowflakeSQLException
-
-