public abstract class LazyTreeReader extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
columnId |
protected long |
previousPresentRow |
protected long |
previousRow |
protected int |
previousRowIndexEntry |
protected long |
rowBaseInStripe |
protected long |
rowIndexStride |
protected boolean |
valuePresent |
| Constructor and Description |
|---|
LazyTreeReader(int columnId,
long rowIndexStride) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected int |
computeRowIndexEntry(long row)
Computes the number of the row index entry that immediately precedes row
|
protected long |
countNonNulls(long rows)
in the next rows values, returns the number of values which are not null
|
Object |
createWritableFromLatest(Object previous)
When a client asks for a writable object after materializing a
primitive, create a writable from previous value read from stream.
|
Object |
get(long currentRow,
Object previous)
Returns the value corresponding to currentRow, suitable for calling from outside
|
boolean |
getBoolean(long currentRow) |
double |
getDouble(long currentRow) |
float |
getFloat(long currentRow) |
Object |
getInComplexType(Object previous,
long row)
Should be called only from containers (lists, maps, structs, unions) since for these tree
readers the number of rows does not correspond to the number of values (e.g.
|
int |
getInt(long currentRow) |
long |
getLong(long currentRow) |
short |
getShort(long currentRow) |
int |
loadIndeces(List<OrcProto.RowIndexEntry> rowIndexEntries,
int startIndex)
Read any indeces that will be needed and return a startIndex after the values that have been
read.
|
protected abstract Object |
next(Object previous)
Should only be called from within the tree reader once it's been checked that the next
object isn't null
|
boolean |
nextBoolean(boolean readStream) |
double |
nextDouble(boolean readStream) |
float |
nextFloat(boolean readStream) |
int |
nextInt(boolean readStream) |
boolean |
nextIsNull(long currentRow)
Returns whether or not the value corresponding to currentRow is null, suitable for calling
from outside
|
boolean |
nextIsNullInComplexType()
Should be called only from containers (lists, maps, structs, unions) since for these tree
readers the number of rows does not correspond to the number of values (e.g.
|
long |
nextLong(boolean readStream) |
short |
nextShort(boolean readStream) |
protected abstract void |
seek(int index) |
protected void |
seek(int rowIndexEntry,
boolean backwards)
Adjust all streams to the beginning of the row index entry specified, backwards means that
a previous value is being read and forces the index entry to be restarted, otherwise, has
no effect if we're already in the current index entry
|
protected void |
seekToPresentRow(long currentRow)
Shifts only the present stream so that next will return the value for currentRow
|
protected boolean |
seekToRow(long currentRow)
Adjusts all streams so that the next value returned corresponds to the value for currentRow,
suitable for calling from outside
|
protected abstract void |
skipRows(long numNonNullValues)
Should only be called from within the tree reader once numNonNulls has been set correctly
|
void |
skipRowsInComplexType(long numRows)
Should be called only from containers (lists, maps, structs, unions) since for these tree
readers the number of rows does not correspond to the number of values (e.g.
|
void |
startStripe(Map<StreamName,InStream> streams,
List<OrcProto.ColumnEncoding> encodings,
OrcProto.RowIndex[] indexes,
long rowBaseInStripe) |
protected long rowIndexStride
protected long previousRow
protected final int columnId
protected long rowBaseInStripe
protected boolean valuePresent
protected long previousPresentRow
protected int previousRowIndexEntry
protected abstract void seek(int index)
throws IOException
IOExceptionprotected long countNonNulls(long rows)
throws IOException
rows - IOExceptionprotected abstract void skipRows(long numNonNullValues)
throws IOException
IOExceptionpublic void skipRowsInComplexType(long numRows)
throws IOException
numRows - IOExceptionprotected abstract Object next(Object previous) throws IOException
previous - IOExceptionpublic Object getInComplexType(Object previous, long row) throws IOException
previous - IOExceptionpublic boolean nextIsNull(long currentRow)
throws IOException
currentRow - IOExceptionpublic boolean nextIsNullInComplexType()
throws IOException
IOExceptionprotected int computeRowIndexEntry(long row)
row - protected void seekToPresentRow(long currentRow)
throws IOException
currentRow - IOExceptionpublic Object get(long currentRow, Object previous) throws IOException
currentRow - previous - IOExceptionpublic Object createWritableFromLatest(Object previous) throws IOException
IOExceptionpublic double getDouble(long currentRow)
throws IOException
IOExceptionpublic float getFloat(long currentRow)
throws IOException
IOExceptionpublic boolean getBoolean(long currentRow)
throws IOException
IOExceptionpublic long getLong(long currentRow)
throws IOException
IOExceptionpublic int getInt(long currentRow)
throws IOException
IOExceptionpublic short getShort(long currentRow)
throws IOException
IOExceptionpublic double nextDouble(boolean readStream)
throws IOException
IOExceptionpublic float nextFloat(boolean readStream)
throws IOException
IOExceptionpublic boolean nextBoolean(boolean readStream)
throws IOException
IOExceptionpublic long nextLong(boolean readStream)
throws IOException
IOExceptionpublic int nextInt(boolean readStream)
throws IOException
IOExceptionpublic short nextShort(boolean readStream)
throws IOException
IOExceptionprotected void seek(int rowIndexEntry,
boolean backwards)
throws IOException
rowIndexEntry - backwards - IOExceptionprotected boolean seekToRow(long currentRow)
throws IOException
currentRow - IOExceptionpublic int loadIndeces(List<OrcProto.RowIndexEntry> rowIndexEntries, int startIndex)
public void startStripe(Map<StreamName,InStream> streams, List<OrcProto.ColumnEncoding> encodings, OrcProto.RowIndex[] indexes, long rowBaseInStripe) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2013–2021. All rights reserved.