Skip to content

Commit

Permalink
fix: addressing reviews 12: adding comments regarding merging functio…
Browse files Browse the repository at this point in the history
…nality
  • Loading branch information
vibhatha committed May 16, 2024
1 parent f975552 commit 7cf56d7
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
* </ol>
* The latter three are managed by its superclass.
*/

/*
* TODO: consider merging the functionality in `BaseRepeatedValueVector` into this class.
*/
public class ListViewVector extends BaseRepeatedValueViewVector implements PromotableVector {

protected ArrowBuf validityBuffer;
Expand Down Expand Up @@ -259,7 +263,11 @@ public void allocateNew() throws OutOfMemoryException {
public boolean allocateNewSafe() {
boolean success = false;
try {
/* release the current buffers, hence this is a new allocation */
/* release the current buffers, hence this is a new allocation
* Note that, the `clear` method call below is releasing validityBuffer
* calling the superclass clear method which is releasing the associated buffers
* (sizeBuffer and offsetBuffer).
*/
clear();
/* allocate validity buffer */
allocateValidityBuffer(validityAllocationSizeInBytes);
Expand Down Expand Up @@ -519,6 +527,7 @@ public MinorType getMinorType() {
*/
@Override
public void clear() {
// calling superclass clear method which is releasing the sizeBufer and offsetBuffer
super.clear();
validityBuffer = releaseBuffer(validityBuffer);
}
Expand Down

0 comments on commit 7cf56d7

Please sign in to comment.