public class NonNullableStructVector extends AbstractStructVector
AbstractStructVector
.Modifier and Type | Class and Description |
---|---|
protected static class |
NonNullableStructVector.StructTransferPair
TransferPair for this this class. |
AbstractStructVector.ConflictPolicy
Modifier and Type | Field and Description |
---|---|
protected FieldType |
fieldType |
int |
valueCount |
allowConflictPolicyChanges
allocator, callBack, name
Constructor and Description |
---|
NonNullableStructVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack callBack)
Constructs a new instance.
|
NonNullableStructVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack callBack,
AbstractStructVector.ConflictPolicy conflictPolicy,
boolean allowConflictPolicyChanges)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
<OUT,IN> OUT |
accept(VectorVisitor<OUT,IN> visitor,
IN value)
Accept a generic
VectorVisitor and return the result. |
void |
clear()
Release any owned ArrowBuf and reset the ValueVector to the initial state.
|
void |
close()
Clears out all underlying child vectors.
|
void |
copyFrom(int fromIndex,
int thisIndex,
ValueVector from)
Copies the element at fromIndex in the provided vector to thisIndex.
|
void |
copyFromSafe(int fromIndex,
int thisIndex,
ValueVector from)
Same as
ValueVector.copyFrom(int, int, ValueVector) except that
it handles the case when the capacity of the vector needs to be expanded
before copy. |
static NonNullableStructVector |
empty(String name,
BufferAllocator allocator) |
static NonNullableStructVector |
emptyWithDuplicates(String name,
BufferAllocator allocator) |
Iterator<String> |
fieldNameIterator() |
void |
get(int index,
ComplexHolder holder) |
int |
getBufferSize()
Get the number of bytes used by this vector.
|
int |
getBufferSizeFor(int valueCount)
Returns the number of bytes that is used by this vector if it holds the given number
of values.
|
List<FieldVector> |
getChildrenFromFields() |
ArrowBuf |
getDataBuffer()
Gets the underlying buffer associated with data vector.
|
Field |
getField()
Get information about how this field is materialized.
|
Types.MinorType |
getMinorType() |
int |
getNullCount()
Returns number of null elements in the vector.
|
Object |
getObject(int index)
Get friendly type object from the vector.
|
ArrowBuf |
getOffsetBuffer()
Gets the underlying buffer associated with offset vector.
|
FieldReader |
getReader()
Get a reader for this vector.
|
TransferPair |
getTransferPair(BufferAllocator allocator)
To transfer quota responsibility.
|
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator) |
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator,
CallBack callBack) |
ArrowBuf |
getValidityBuffer()
Gets the underlying buffer associated with validity vector.
|
int |
getValueCapacity()
Returns the maximum number of values that can be stored in this vector instance.
|
int |
getValueCount()
Gets the number of values.
|
ValueVector |
getVectorById(int id) |
int |
hashCode(int index)
Returns hashCode of element in index with the default hasher.
|
int |
hashCode(int index,
ArrowBufHasher hasher)
Returns hashCode of element in index with the given hasher.
|
void |
initializeChildrenFromFields(List<Field> children)
Initializes the struct's members from the given Fields.
|
boolean |
isNull(int index)
Check whether an element in the vector is null.
|
TransferPair |
makeTransferPair(ValueVector to)
Makes a new transfer pair used to transfer underlying buffers.
|
void |
reset()
Reset the ValueVector to the initial state without releasing any owned ArrowBuf.
|
void |
setInitialCapacity(int numRecords)
Set the initial record capacity.
|
void |
setInitialCapacity(int valueCount,
double density)
Set value with density.
|
void |
setValueCount(int valueCount)
Set number of values in the vector.
|
protected boolean |
supportsDirectRead() |
add, addOrGet, allocateNewSafe, getBuffers, getChild, getChildByOrdinal, getChildFieldNames, getChildren, getChildVectorWithOrdinal, getConflictPolicy, getPrimitiveVectors, iterator, putChild, putVector, reAlloc, setConflictPolicy, size, toString
addOrGetFixedSizeList, addOrGetList, addOrGetMap, addOrGetStruct, addOrGetUnion, allocateNew, getAllocator, getChild, getName, typeify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected final FieldType fieldType
public int valueCount
public NonNullableStructVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack)
name
- The name of the instance.allocator
- The allocator to use to allocating/reallocating buffers.fieldType
- The type of this list.public NonNullableStructVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack, AbstractStructVector.ConflictPolicy conflictPolicy, boolean allowConflictPolicyChanges)
name
- The name of the instance.allocator
- The allocator to use to allocating/reallocating buffers.fieldType
- The type of this list.callBack
- A schema change callback.conflictPolicy
- How to handle duplicate field names in the struct.public static NonNullableStructVector empty(String name, BufferAllocator allocator)
public static NonNullableStructVector emptyWithDuplicates(String name, BufferAllocator allocator)
public FieldReader getReader()
ValueVector
field reader
that supports reading values
from this vector.public void copyFrom(int fromIndex, int thisIndex, ValueVector from)
copyFrom
in interface ValueVector
copyFrom
in class AbstractContainerVector
fromIndex
- position to copy from in source vectorthisIndex
- position to copy to in this vectorfrom
- source vectorpublic void copyFromSafe(int fromIndex, int thisIndex, ValueVector from)
ValueVector
ValueVector.copyFrom(int, int, ValueVector)
except that
it handles the case when the capacity of the vector needs to be expanded
before copy.copyFromSafe
in interface ValueVector
copyFromSafe
in class AbstractContainerVector
fromIndex
- position to copy from in source vectorthisIndex
- position to copy to in this vectorfrom
- source vectorprotected boolean supportsDirectRead()
supportsDirectRead
in class AbstractContainerVector
public void setInitialCapacity(int numRecords)
ValueVector
numRecords
- the initial record capacity.public void setInitialCapacity(int valueCount, double density)
DensityAwareVector
valueCount
- the number of values in this vectordensity
- the density of the vectorpublic int getBufferSize()
ValueVector
getBufferSize
in interface ValueVector
getBufferSize
in class AbstractStructVector
public int getBufferSizeFor(int valueCount)
ValueVector
valueCount
- the number of values to assume this vector containspublic ArrowBuf getValidityBuffer()
ValueVector
public ArrowBuf getDataBuffer()
ValueVector
public ArrowBuf getOffsetBuffer()
ValueVector
public TransferPair getTransferPair(BufferAllocator allocator)
ValueVector
allocator
- the target allocatortransfer pair
, creating a new target vector of
the same type.public TransferPair getTransferPair(String ref, BufferAllocator allocator, CallBack callBack)
public TransferPair makeTransferPair(ValueVector to)
ValueVector
to
- the target for the transfertransfer pair
that is used to transfer underlying
buffers into the target vector.public TransferPair getTransferPair(String ref, BufferAllocator allocator)
public int getValueCapacity()
ValueVector
public Object getObject(int index)
ValueVector
index
- index of object to getpublic int hashCode(int index)
ValueVector
public int hashCode(int index, ArrowBufHasher hasher)
ValueVector
public <OUT,IN> OUT accept(VectorVisitor<OUT,IN> visitor, IN value)
ValueVector
VectorVisitor
and return the result.OUT
- the output result type.IN
- the input data together with visitor.public boolean isNull(int index)
ValueVector
index
- index to check for nullpublic int getNullCount()
ValueVector
public void get(int index, ComplexHolder holder)
public int getValueCount()
ValueVector
public ValueVector getVectorById(int id)
public void setValueCount(int valueCount)
ValueVector
public void clear()
ValueVector
public void reset()
ValueVector
public Field getField()
ValueVector
public Types.MinorType getMinorType()
public void close()
AbstractContainerVector
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ValueVector
close
in class AbstractStructVector
public void initializeChildrenFromFields(List<Field> children)
public List<FieldVector> getChildrenFromFields()
Copyright © 2020 The Apache Software Foundation. All rights reserved.