public class FixedSizeBinaryVector extends BaseFixedWidthVector
actualValueCapacity, field, lastValueCapacity, validityBuffer, valueBuffer, valueCount
allocator, fieldReader, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTY
Constructor and Description |
---|
FixedSizeBinaryVector(Field field,
BufferAllocator allocator)
Instantiate a FixedSizeBinaryVector.
|
FixedSizeBinaryVector(String name,
BufferAllocator allocator,
int byteWidth)
Instantiate a FixedSizeBinaryVector.
|
FixedSizeBinaryVector(String name,
FieldType fieldType,
BufferAllocator allocator)
Instantiate a FixedSizeBinaryVector.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
get(ArrowBuf buffer,
int index,
int byteWidth)
Given a data buffer, get the value stored at a particular position
in the vector.
|
byte[] |
get(int index)
Get the element at the given index from the vector.
|
void |
get(int index,
NullableFixedSizeBinaryHolder holder)
Get the element at the given index from the vector and
sets the state in holder.
|
int |
getByteWidth() |
Types.MinorType |
getMinorType()
Get minor type for this vector.
|
byte[] |
getObject(int index)
Same as
get(int) . |
protected FieldReader |
getReaderImpl()
Each vector has a different reader that implements the FieldReader interface.
|
TransferPair |
getTransferPair(Field field,
BufferAllocator allocator)
Construct a TransferPair comprising this and a target vector of
the same type.
|
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator)
Construct a TransferPair comprising this and a target vector of
the same type.
|
TransferPair |
makeTransferPair(ValueVector to)
Construct a TransferPair with a desired target vector of the same type.
|
void |
set(int index,
ArrowBuf buffer)
Set the element at the given index to the given value.
|
void |
set(int index,
byte[] value)
Sets the value at index to the provided one.
|
void |
set(int index,
FixedSizeBinaryHolder holder)
Set the variable length element at the specified index to the data
buffer supplied in the holder.
|
void |
set(int index,
int isSet,
ArrowBuf buffer)
Set the element at the given index to the given value.
|
void |
set(int index,
int isSet,
byte[] value)
Sets the value if isSet is positive, otherwise sets the index to null/invalid.
|
void |
set(int index,
NullableFixedSizeBinaryHolder holder)
Set the variable length element at the specified index to the data
buffer supplied in the holder.
|
void |
setSafe(int index,
ArrowBuf buffer)
Same as
set(int, ArrowBuf) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity() . |
void |
setSafe(int index,
byte[] value)
Same as
set(int, byte[]) but reallocates if index
is larger than capacity. |
void |
setSafe(int index,
FixedSizeBinaryHolder holder)
Same as
set(int, FixedSizeBinaryHolder) except that it handles the
case where index and length of new element are beyond the existing
capacity of the vector. |
void |
setSafe(int index,
int isSet,
ArrowBuf buffer)
Same as
set(int, ArrowBuf) except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity() . |
void |
setSafe(int index,
int isSet,
byte[] value) |
void |
setSafe(int index,
NullableFixedSizeBinaryHolder holder)
Same as
set(int, NullableFixedSizeBinaryHolder) except that it handles the
case where index and length of new element are beyond the existing
capacity of the vector. |
accept, allocateNew, allocateNew, allocateNewSafe, clear, close, copyFrom, copyFromSafe, decrementAllocationMonitor, getBuffers, getBufferSize, getBufferSizeFor, getChildrenFromFields, getDataBuffer, getDataBufferAddress, getDataPointer, getDataPointer, getField, getFieldBuffers, getFieldInnerVectors, getName, getNullCount, getOffsetBuffer, getOffsetBufferAddress, getTransferPair, getTransferPair, getTypeWidth, getValidityBuffer, getValidityBufferAddress, getValidityBufferValueCapacity, getValueBufferValueCapacity, getValueCapacity, getValueCount, handleSafe, hashCode, hashCode, incrementAllocationMonitor, initializeChildrenFromFields, isNull, isSafe, isSet, loadFieldBuffers, reAlloc, refreshValueCapacity, reset, set, set, setIndexDefined, setInitialCapacity, setNull, setSafe, setSafe, setValueCount, splitAndTransferTo, transferTo, zeroVector
checkBufRefs, getAllocator, getReader, getValidityBufferSizeFromCount, iterator, releaseBuffer, toString, transferBuffer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAllocator, getReader
forEach, iterator, spliterator
public FixedSizeBinaryVector(String name, BufferAllocator allocator, int byteWidth)
name
- name of the vectorallocator
- allocator for memory management.byteWidth
- byte width of the binary valuespublic FixedSizeBinaryVector(String name, FieldType fieldType, BufferAllocator allocator)
name
- name of the vectorfieldType
- type of Field materialized by this vectorallocator
- allocator for memory management.public FixedSizeBinaryVector(Field field, BufferAllocator allocator)
field
- field materialized by this vectorallocator
- allocator for memory management.protected FieldReader getReaderImpl()
BaseValueVector
getReaderImpl
in class BaseValueVector
public Types.MinorType getMinorType()
Types.MinorType
public byte[] get(int index)
index
- position of elementpublic void get(int index, NullableFixedSizeBinaryHolder holder)
index
- position of elementholder
- nullable holder to carry the bufferpublic byte[] getObject(int index)
get(int)
.index
- position of elementpublic int getByteWidth()
public void set(int index, byte[] value)
public void setSafe(int index, byte[] value)
set(int, byte[])
but reallocates if index
is larger than capacity.public void set(int index, int isSet, byte[] value)
public void setSafe(int index, int isSet, byte[] value)
public void set(int index, ArrowBuf buffer)
index
- position of elementbuffer
- ArrowBuf containing binary value.public void setSafe(int index, ArrowBuf buffer)
set(int, ArrowBuf)
except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity()
.index
- position of elementbuffer
- ArrowBuf containing binary value.public void set(int index, int isSet, ArrowBuf buffer)
index
- position of elementbuffer
- ArrowBuf containing binary value.public void setSafe(int index, int isSet, ArrowBuf buffer)
set(int, ArrowBuf)
except that it handles the
case when index is greater than or equal to existing
value capacity BaseFixedWidthVector.getValueCapacity()
.index
- position of elementbuffer
- ArrowBuf containing binary value.public void set(int index, FixedSizeBinaryHolder holder)
index
- position of the element to setholder
- holder that carries data buffer.public void setSafe(int index, FixedSizeBinaryHolder holder)
set(int, FixedSizeBinaryHolder)
except that it handles the
case where index and length of new element are beyond the existing
capacity of the vector.index
- position of the element to setholder
- holder that carries data buffer.public void set(int index, NullableFixedSizeBinaryHolder holder)
index
- position of the element to setholder
- holder that carries data buffer.public void setSafe(int index, NullableFixedSizeBinaryHolder holder)
set(int, NullableFixedSizeBinaryHolder)
except that it handles the
case where index and length of new element are beyond the existing
capacity of the vector.index
- position of the element to setholder
- holder that carries data buffer.public static byte[] get(ArrowBuf buffer, int index, int byteWidth)
This method should not be used externally.
buffer
- data bufferindex
- position of the element.public TransferPair getTransferPair(String ref, BufferAllocator allocator)
getTransferPair
in interface ValueVector
getTransferPair
in class BaseFixedWidthVector
ref
- name of the target vectorallocator
- allocator for the target vectorTransferPair
public TransferPair getTransferPair(Field field, BufferAllocator allocator)
getTransferPair
in class BaseFixedWidthVector
field
- Field object used by the target vectorallocator
- allocator for the target vectorTransferPair
public TransferPair makeTransferPair(ValueVector to)
to
- target vectorTransferPair
Copyright © 2023 The Apache Software Foundation. All rights reserved.