public abstract class BaseFixedWidthVector extends BaseValueVector implements FixedWidthVector, FieldVector, VectorDefinitionSetter
修飾子とタイプ | フィールドと説明 |
---|---|
protected Field |
field |
protected int |
validityAllocationSizeInBytes |
protected ArrowBuf |
validityBuffer |
protected int |
valueAllocationSizeInBytes |
protected ArrowBuf |
valueBuffer |
protected int |
valueCount |
allocator, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTY, name
コンストラクタと説明 |
---|
BaseFixedWidthVector(String name,
BufferAllocator allocator,
FieldType fieldType,
int typeWidth) |
修飾子とタイプ | メソッドと説明 |
---|---|
void |
allocateNew()
Same as
allocateNewSafe() . |
void |
allocateNew(int valueCount)
Allocate memory for the vector to support storing at least the provided number of
elements in the vector.
|
boolean |
allocateNewSafe()
Allocate memory for the vector.
|
void |
clear()
Same as
close() |
void |
close()
Close the vector and release the associated buffers.
|
protected void |
decrementAllocationMonitor() |
ArrowBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize()
Get the size (number of bytes) of underlying buffers used by this
vector
|
int |
getBufferSizeFor(int count)
Get the potential buffer size for a particular number of records.
|
List<FieldVector> |
getChildrenFromFields()
Get the inner child vectors.
|
ArrowBuf |
getDataBuffer()
Get the buffer that stores the data for elements in the vector.
|
long |
getDataBufferAddress()
Get the memory address of buffer that stores the data for elements
in the vector.
|
Field |
getField()
Get information about how this field is materialized.
|
List<ArrowBuf> |
getFieldBuffers()
Get the buffers belonging to this vector
|
List<BufferBacked> |
getFieldInnerVectors()
非推奨です。
|
int |
getNullCount()
Get the number of elements that are null in the vector
|
ArrowBuf |
getOffsetBuffer()
buffer that stores the offsets for elements
in the vector.
|
long |
getOffsetBufferAddress()
Get the memory address of buffer that stores the offsets for elements
in the vector.
|
TransferPair |
getTransferPair(BufferAllocator allocator)
Construct a transfer pair of this vector and another vector of same type.
|
abstract TransferPair |
getTransferPair(String ref,
BufferAllocator allocator)
Construct a transfer pair of this vector and another vector of same type.
|
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator,
CallBack callBack)
Construct a transfer pair of this vector and another vector of same type.
|
ArrowBuf |
getValidityBuffer()
Get buffer that manages the validity (NULL or NON-NULL nature) of
elements in the vector.
|
long |
getValidityBufferAddress()
Get the memory address of buffer that manages the validity
(NULL or NON-NULL nature) of elements in the vector.
|
int |
getValueCapacity()
Get the current value capacity for the vector
|
int |
getValueCount()
Get the value count of vector.
|
protected void |
handleSafe(int index)
*
helper methods for setters *
*
|
protected void |
incrementAllocationMonitor() |
void |
initializeChildrenFromFields(List<Field> children)
Initialize the children in schema for this Field.
|
boolean |
isNull(int index)
Check if element at given index is null.
|
boolean |
isSafe(int index)
Check if the given index is within the current value capacity
of the vector
|
int |
isSet(int index)
Same as
isNull(int) . |
void |
loadFieldBuffers(ArrowFieldNode fieldNode,
List<ArrowBuf> ownBuffers)
Load the buffers of this vector with provided source buffers.
|
void |
reAlloc()
Resize the vector to increase the capacity.
|
void |
reset()
Reset the vector to initial state.
|
void |
set(int index,
byte[] value,
int start,
int length) |
void |
set(int index,
ByteBuffer value,
int start,
int length) |
void |
setIndexDefined(int index)
Mark the particular position in the vector as non-null.
|
void |
setInitialCapacity(int valueCount)
Sets the desired value capacity for the vector.
|
void |
setSafe(int index,
byte[] value,
int start,
int length) |
void |
setSafe(int index,
ByteBuffer value,
int start,
int length) |
void |
setValueCount(int valueCount)
Set value count for the vector.
|
void |
splitAndTransferTo(int startIndex,
int length,
BaseFixedWidthVector target)
Slice this vector at desired index and length and transfer the
corresponding data to the target vector.
|
void |
transferTo(BaseFixedWidthVector target)
Transfer this vector'data to another vector.
|
void |
zeroVector()
zero out the vector and the data in associated buffers.
|
checkBufRefs, compareTypes, getAllocator, getValidityBufferSizeFromCount, iterator, releaseBuffer, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAllocator, getMinorType, getObject, getReader, makeTransferPair
forEach, iterator, spliterator
protected int valueAllocationSizeInBytes
protected int validityAllocationSizeInBytes
protected final Field field
protected ArrowBuf validityBuffer
protected ArrowBuf valueBuffer
protected int valueCount
public BaseFixedWidthVector(String name, BufferAllocator allocator, FieldType fieldType, int typeWidth)
public long getValidityBufferAddress()
getValidityBufferAddress
インタフェース内 FieldVector
public long getDataBufferAddress()
getDataBufferAddress
インタフェース内 FieldVector
public long getOffsetBufferAddress()
getOffsetBufferAddress
インタフェース内 FieldVector
UnsupportedOperationException
- for fixed width vectorspublic ArrowBuf getValidityBuffer()
getValidityBuffer
インタフェース内 ValueVector
public ArrowBuf getDataBuffer()
getDataBuffer
インタフェース内 ValueVector
public ArrowBuf getOffsetBuffer()
getOffsetBuffer
インタフェース内 ValueVector
UnsupportedOperationException
- for fixed width vectorspublic void setInitialCapacity(int valueCount)
setInitialCapacity
インタフェース内 ValueVector
valueCount
- desired number of elements in the vectorpublic int getValueCapacity()
getValueCapacity
インタフェース内 ValueVector
public void zeroVector()
zeroVector
インタフェース内 FixedWidthVector
public void reset()
zeroVector()
.
Note that this method doesn't release any memory.reset
インタフェース内 ValueVector
public void close()
close
インタフェース内 Closeable
close
インタフェース内 AutoCloseable
close
インタフェース内 ValueVector
close
クラス内 BaseValueVector
public void clear()
close()
clear
インタフェース内 ValueVector
clear
クラス内 BaseValueVector
protected void incrementAllocationMonitor()
protected void decrementAllocationMonitor()
public void allocateNew()
allocateNewSafe()
.allocateNew
インタフェース内 ValueVector
public boolean allocateNewSafe()
allocateNew(int)
for allocating memory for specific
number of elements in the vector.allocateNewSafe
インタフェース内 ValueVector
public void allocateNew(int valueCount)
allocateNew
インタフェース内 FixedWidthVector
valueCount
- the desired number of elements in the vectorOutOfMemoryException
public int getBufferSizeFor(int count)
getBufferSizeFor
インタフェース内 ValueVector
count
- desired number of elements in the vectorpublic int getBufferSize()
getBufferSize
インタフェース内 ValueVector
public Field getField()
getField
インタフェース内 ValueVector
public ArrowBuf[] getBuffers(boolean clear)
getBuffers
インタフェース内 ValueVector
clear
- Whether to clear vector before returning; the buffers will still be refcounted
but the returned array will be the only reference to thembuffers
that is used by this
vector instance.public void reAlloc()
reAlloc
インタフェース内 ValueVector
@Deprecated public List<BufferBacked> getFieldInnerVectors()
getFieldInnerVectors
インタフェース内 FieldVector
public void initializeChildrenFromFields(List<Field> children)
initializeChildrenFromFields
インタフェース内 FieldVector
children
- the schemaIllegalArgumentException
- if children is a non-empty list for scalar types.public List<FieldVector> getChildrenFromFields()
getChildrenFromFields
インタフェース内 FieldVector
public void loadFieldBuffers(ArrowFieldNode fieldNode, List<ArrowBuf> ownBuffers)
loadFieldBuffers
インタフェース内 FieldVector
fieldNode
- the fieldNode indicating the value countownBuffers
- the buffers for this Field (own buffers only, children not included)public List<ArrowBuf> getFieldBuffers()
getFieldBuffers
インタフェース内 FieldVector
public TransferPair getTransferPair(String ref, BufferAllocator allocator, CallBack callBack)
getTransferPair
インタフェース内 ValueVector
ref
- name of the target vectorallocator
- allocator for the target vectorcallBack
- public TransferPair getTransferPair(BufferAllocator allocator)
getTransferPair
インタフェース内 ValueVector
getTransferPair
クラス内 BaseValueVector
allocator
- allocator for the target vectorpublic abstract TransferPair getTransferPair(String ref, BufferAllocator allocator)
getTransferPair
インタフェース内 ValueVector
ref
- name of the target vectorallocator
- allocator for the target vectorpublic void transferTo(BaseFixedWidthVector target)
target
- destination vector for transferpublic void splitAndTransferTo(int startIndex, int length, BaseFixedWidthVector target)
startIndex
- start position of the split in source vector.length
- length of the split.target
- destination vectorpublic int getNullCount()
getNullCount
インタフェース内 ValueVector
public int getValueCount()
setValueCount(int)
has been called prior to calling this.getValueCount
インタフェース内 ValueVector
public void setValueCount(int valueCount)
setValueCount
インタフェース内 ValueVector
valueCount
- value count to setpublic boolean isSafe(int index)
index
- position to checkpublic boolean isNull(int index)
isNull
インタフェース内 ValueVector
index
- position of elementpublic int isSet(int index)
isNull(int)
.index
- position of elementpublic void setIndexDefined(int index)
setIndexDefined
インタフェース内 VectorDefinitionSetter
index
- position of the element.public void set(int index, byte[] value, int start, int length)
public void setSafe(int index, byte[] value, int start, int length)
public void set(int index, ByteBuffer value, int start, int length)
public void setSafe(int index, ByteBuffer value, int start, int length)
protected void handleSafe(int index)
Copyright © 2018 The Apache Software Foundation. All rights reserved.