Skip to content

Commit

Permalink
fixed for arrow-vector
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanCutler committed Nov 21, 2018
1 parent 1592fcf commit 00b58be
Show file tree
Hide file tree
Showing 74 changed files with 1,001 additions and 765 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ public void close() {
};

/**
* Get an AutoCloseable that does nothing.
*
* @return A do-nothing autocloseable
*/
public static AutoCloseable noop() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public void close() {
}

/**
* Same as {@link #close()}
* Same as {@link #close()}.
*/
@Override
public void clear() {
Expand Down Expand Up @@ -292,7 +292,7 @@ public boolean allocateNewSafe() {
* elements in the vector. This method must be called prior to using the ValueVector.
*
* @param valueCount the desired number of elements in the vector
* @throws org.apache.arrow.memory.OutOfMemoryException
* @throws org.apache.arrow.memory.OutOfMemoryException on error
*/
public void allocateNew(int valueCount) {
long valueBufferSize = valueCount * typeWidth;
Expand Down Expand Up @@ -365,7 +365,7 @@ public int getBufferSizeFor(final int count) {

/**
* Get the size (number of bytes) of underlying buffers used by this
* vector
* vector.
* @return size of underlying buffers.
*/
@Override
Expand Down Expand Up @@ -482,8 +482,7 @@ public void initializeChildrenFromFields(List<Field> children) {

/**
* Get the inner child vectors.
* @return list of child vectors for complex types, empty list for scalar vector
* types
* @return list of child vectors for complex types, empty list for scalar vector types
*/
@Override
public List<FieldVector> getChildrenFromFields() {
Expand Down Expand Up @@ -554,7 +553,7 @@ private void setReaderAndWriterIndex() {
* Construct a transfer pair of this vector and another vector of same type.
* @param ref name of the target vector
* @param allocator allocator for the target vector
* @param callBack
* @param callBack not used
* @return TransferPair
*/
@Override
Expand Down Expand Up @@ -685,15 +684,15 @@ private void splitAndTransferValidityBuffer(int startIndex, int length,
}


/******************************************************************
* *
* common getters and setters *
* *
******************************************************************/
/*----------------------------------------------------------------*
| |
| common getters and setters |
| |
*----------------------------------------------------------------*/


/**
* Get the number of elements that are null in the vector
* Get the number of elements that are null in the vector.
*
* @return the number of null elements.
*/
Expand Down Expand Up @@ -763,7 +762,7 @@ public void setValueCount(int valueCount) {

/**
* Check if the given index is within the current value capacity
* of the vector
* of the vector.
*
* @param index position to check
* @return true if index is within the current value capacity
Expand Down Expand Up @@ -824,11 +823,11 @@ public void setSafe(int index, ByteBuffer value, int start, int length) {
}


/******************************************************************
* *
* helper methods for setters *
* *
******************************************************************/
/*----------------------------------------------------------------*
| |
| helper methods for setters |
| |
*----------------------------------------------------------------*/


protected void handleSafe(int index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void setInitialCapacity(int valueCount, double density) {
}

/**
* Get the density of this ListVector
* Get the density of this ListVector.
* @return density
*/
public double getDensity() {
Expand All @@ -203,7 +203,7 @@ public double getDensity() {
}

/**
* Get the current value capacity for the vector
* Get the current value capacity for the vector.
* @return number of elements that vector can hold.
*/
@Override
Expand Down Expand Up @@ -258,7 +258,7 @@ public void close() {
}

/**
* Same as {@link #close()}
* Same as {@link #close()}.
*/
@Override
public void clear() {
Expand Down Expand Up @@ -291,8 +291,7 @@ public void initializeChildrenFromFields(List<Field> children) {

/**
* Get the inner child vectors.
* @return list of child vectors for complex types, empty list for scalar vector
* types
* @return list of child vectors for complex types, empty list for scalar vector types
*/
@Override
public List<FieldVector> getChildrenFromFields() {
Expand Down Expand Up @@ -325,7 +324,7 @@ public void loadFieldBuffers(ArrowFieldNode fieldNode, List<ArrowBuf> ownBuffers
}

/**
* Get the buffers belonging to this vector
* Get the buffers belonging to this vector.
* @return the inner buffers.
*/
public List<ArrowBuf> getFieldBuffers() {
Expand Down Expand Up @@ -405,7 +404,7 @@ public boolean allocateNewSafe() {
*
* @param totalBytes desired total memory capacity
* @param valueCount the desired number of elements in the vector
* @throws org.apache.arrow.memory.OutOfMemoryException
* @throws org.apache.arrow.memory.OutOfMemoryException if memory allocation fails
*/
@Override
public void allocateNew(int totalBytes, int valueCount) {
Expand Down Expand Up @@ -505,11 +504,11 @@ public void reallocDataBuffer() {
* the vector and offset buffer is used to store the lengths of variable
* width elements in the vector.
*
* Note that data buffer for variable length vectors moves independent
* <p>Note that data buffer for variable length vectors moves independent
* of the companion validity and offset buffers. This is in
* contrast to what we have for fixed width vectors.
*
* So even though we may have setup an initial capacity of 1024
* <p>So even though we may have setup an initial capacity of 1024
* elements in the vector, it is quite possible
* that we need to reAlloc() the data buffer when we are setting
* the 5th element in the vector simply because previous
Expand Down Expand Up @@ -561,7 +560,7 @@ private ArrowBuf reallocBufferHelper(ArrowBuf buffer, final boolean offsetBuffer

/**
* Get the size (number of bytes) of underlying data buffer.
* @return
* @return number of bytes in the data buffer
*/
@Override
public int getByteCapacity() {
Expand All @@ -576,7 +575,7 @@ public int getCurrentSizeInBytes() {

/**
* Get the size (number of bytes) of underlying buffers used by this
* vector
* vector.
* @return size of underlying buffers.
*/
@Override
Expand Down Expand Up @@ -648,7 +647,7 @@ public ArrowBuf[] getBuffers(boolean clear) {
* Construct a transfer pair of this vector and another vector of same type.
* @param ref name of the target vector
* @param allocator allocator for the target vector
* @param callBack
* @param callBack not used
* @return TransferPair
*/
@Override
Expand Down Expand Up @@ -712,7 +711,7 @@ public void splitAndTransferTo(int startIndex, int length,
}
}

/*
/**
* Transfer the offsets along with data. Unlike the data buffer, we cannot simply
* slice the offset buffer for split and transfer. The reason is that offsets
* in the target vector have to be adjusted and made relative to the staring
Expand Down Expand Up @@ -792,15 +791,15 @@ private void splitAndTransferValidityBuffer(int startIndex, int length,
}


/******************************************************************
* *
* common getters and setters *
* *
******************************************************************/
/*----------------------------------------------------------------*
| |
| common getters and setters |
| |
*----------------------------------------------------------------*/


/**
* Get the number of elements that are null in the vector
* Get the number of elements that are null in the vector.
*
* @return the number of null elements.
*/
Expand All @@ -810,7 +809,7 @@ public int getNullCount() {

/**
* Check if the given index is within the current value capacity
* of the vector
* of the vector.
*
* @param index position to check
* @return true if index is within the current value capacity
Expand Down Expand Up @@ -853,7 +852,7 @@ public int getValueCount() {
}

/**
* Sets the value count for the vector
* Sets the value count for the vector.
*
* @param valueCount value count
*/
Expand Down Expand Up @@ -1028,7 +1027,7 @@ public void setSafe(int index, byte[] value, int start, int length) {

/**
* Set the variable length element at the specified index to the
* content in supplied ByteBuffer
* content in supplied ByteBuffer.
*
* @param index position of the element to set
* @param value ByteBuffer with data
Expand Down Expand Up @@ -1165,11 +1164,11 @@ public void setSafe(int index, int start, int length, ArrowBuf buffer) {
}


/******************************************************************
* *
* helper methods for setters *
* *
******************************************************************/
/*----------------------------------------------------------------*
| |
| helper methods for setters |
| |
*----------------------------------------------------------------*/


protected final void fillHoles(int index) {
Expand Down Expand Up @@ -1228,7 +1227,7 @@ protected final void handleSafe(int index, int dataLength) {
* Method used by Json Writer to read a variable width element from
* the variable width vector and write to Json.
*
* This method should not be used externally.
* <p>This method should not be used externally.
*
* @param data buffer storing the variable width vector elements
* @param offset buffer storing the offsets of variable width vector elements
Expand All @@ -1249,7 +1248,7 @@ public static byte[] get(final ArrowBuf data, final ArrowBuf offset, int index)
* width vector data. The method takes care of allocating the memory for
* offsets if the caller hasn't done so.
*
* This method should not be used externally.
* <p>This method should not be used externally.
*
* @param buffer ArrowBuf to store offsets for variable width elements
* @param allocator memory allocator
Expand Down
Loading

0 comments on commit 00b58be

Please sign in to comment.