Interface VectorState
- All Known Implementing Classes:
ListState.ListVectorState,NullableVectorState,NullVectorState,NullVectorState.UnmanagedVectorState,RepeatedListState.RepeatedListVectorState,RepeatedVectorState,SingleVectorState,SingleVectorState.FixedWidthVectorState,SingleVectorState.IsSetVectorState,SingleVectorState.OffsetVectorState,SingleVectorState.SimpleVectorState,SingleVectorState.VariableWidthVectorState,TupleState.DictArrayVectorState,TupleState.DictVectorState,TupleState.MapVectorState,TupleState.SingleDictVectorState,UnionState.UnionVectorState
public interface VectorState
Handles batch and overflow operation for a (possibly compound) vector.
The data model is the following:
- Column model
- Value vector itself
- Column writer
- Column schema
- Column coordinator (this class)
Result Set Vector
Loader invalid input: '<'--> State invalid input: '<'--> Vectors
Events from the row set loader deal with allocation, roll-over,
harvesting completed batches and so on. Events from the writer,
via the tuple model deal with adding columns and column
overflow.-
Method Summary
Modifier and TypeMethodDescriptionintallocate(int cardinality) Allocate a new vector with the number of elements given.voidclose()Clear the vector(s) associated with this state.voiddump(HierarchicalFormatter format) voidA batch is being harvested after an overflow.booleanReport whether this column is projected (has materialized vectors), or is unprojected (has no materialized backing.)voidrollover(int cardinality) A vector has overflowed.voidA new batch is starting while an look-ahead vector exists.<T extends ValueVector>
Tvector()Underlying vector: the one presented to the consumer of the result set loader.
-
Method Details
-
allocate
int allocate(int cardinality) Allocate a new vector with the number of elements given. If the vector is an array, then the cardinality given is the number of arrays.- Parameters:
cardinality- number of elements desired in the allocated vector- Returns:
- the number of bytes allocated
-
rollover
void rollover(int cardinality) A vector has overflowed. Create a new look-ahead vector of the given cardinality, then copy the overflow values from the main vector to the look-ahead vector.- Parameters:
cardinality- the number of elements in the new vector. If this vector is an array, then this is the number of arrays
-
harvestWithLookAhead
void harvestWithLookAhead()A batch is being harvested after an overflow. Put the full batch back into the main vector so it can be harvested. -
startBatchWithLookAhead
void startBatchWithLookAhead()A new batch is starting while an look-ahead vector exists. Move the look-ahead buffers into the main vector to prepare for writing the rest of the batch. -
close
void close()Clear the vector(s) associated with this state. -
vector
Underlying vector: the one presented to the consumer of the result set loader. -
isProjected
boolean isProjected()Report whether this column is projected (has materialized vectors), or is unprojected (has no materialized backing.)- Returns:
- true if the column is projected to the output, false if not
-
dump
-