public abstract class ValuesReader extends Object
A ValuesReader is provided with a page (byte-buffer) and is responsible for deserializing the primitive values stored in that page.
Given that pages are homogeneous (store only a single type), typical subclasses will only override one of the read*() methods.
| Constructor and Description |
|---|
ValuesReader() |
| Modifier and Type | Method and Description |
|---|---|
int |
getNextOffset()
Deprecated.
Will be removed in 2.0.0
|
void |
initFromPage(int valueCount,
byte[] page,
int offset)
Deprecated.
|
void |
initFromPage(int valueCount,
ByteBufferInputStream in)
Called to initialize the column reader from a part of a page.
|
void |
initFromPage(int valueCount,
ByteBuffer page,
int offset)
Deprecated.
Will be removed in 2.0.0
|
boolean |
readBoolean() |
Binary |
readBytes() |
double |
readDouble() |
float |
readFloat() |
int |
readInteger() |
long |
readLong() |
int |
readValueDictionaryId()
usable when the encoding is dictionary based
|
abstract void |
skip()
Skips the next value in the page
|
void |
skip(int n)
Skips the next n values in the page
|
protected void |
updateNextOffset(int bytesRead) |
@Deprecated public void initFromPage(int valueCount, ByteBuffer page, int offset) throws IOException
The underlying implementation knows how much data to read, so a length is not provided.
Each page may contain several sections:
This function is called with 'offset' pointing to the beginning of one of these sections, and should return the offset to the section following it.
valueCount - count of values in this pagepage - the array to read from containing the page data (repetition levels, definition levels, data)offset - where to start reading from in the pageIOException@Deprecated public void initFromPage(int valueCount, byte[] page, int offset) throws IOException
This method is only provided for backward compatibility and will be removed in a future release. Please update any code using it as soon as possible.
IOExceptioninitFromPage(int, ByteBuffer, int)public void initFromPage(int valueCount,
ByteBufferInputStream in)
throws IOException
Implementations must consume all bytes from the input stream, leaving the stream ready to read the next section of data. The underlying implementation knows how much data to read, so a length is not provided.
Each page may contain several sections:
valueCount - count of values in this pagein - an input stream containing the page data at the correct offsetIOException - if there is an exception while reading from the input stream@Deprecated public int getNextOffset()
protected void updateNextOffset(int bytesRead)
public int readValueDictionaryId()
public boolean readBoolean()
public Binary readBytes()
public float readFloat()
public double readDouble()
public int readInteger()
public long readLong()
public abstract void skip()
public void skip(int n)
n - the number of values to be skippedCopyright © 2023 The Apache Software Foundation. All rights reserved.