Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
richardc-db committed Dec 2, 2024
1 parent 08fc7ed commit 9e453bf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public abstract class ColumnVector implements AutoCloseable {
public abstract void close();

/**
* Cleans up memory for this column vector if it's not writable. The column vector is not usable
* after this.
* Cleans up memory for this column vector if it's resources are freeable bewteen batches.
* The column vector is not usable after this.
*
* If this is a writable column vector, it is a no-op.
* If this is a writable column vector or constant column vector, it is a no-op.
*/
public void closeIfNotWritable() {
// By default, we just call close() for all column vectors. If a column vector is writable, it
// should override this method and do nothing.
public void closeIfFreeable() {
// By default, we just call close() for all column vectors. If a column vector is writable or
// constant, it should override this method and do nothing.
close();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public void close() {
}

/**
* Called to close all the columns if they are not writable. This is used to clean up memory
* allocated during columnar processing.
* Called to close all the columns if their resources are freeable between batches.
* This is used to clean up memory allocated during columnar processing.
*/
public void closeIfNotWritable() {
public void closeIfFreeable() {
for (ColumnVector c: columns) {
c.closeIfNotWritable();
c.closeIfFreeable();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void close() {
}

@Override
public void closeIfNotWritable() {
public void closeIfFreeable() {
// no-op
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ case class ColumnarToRowExec(child: SparkPlan) extends ColumnarToRowTransition w
| $shouldStop
| }
| $idx = $numRows;
| $batch.closeIfNotWritable();
| $batch.closeIfFreeable();
| $batch = null;
| $nextBatchFuncName();
|}
Expand Down

0 comments on commit 9e453bf

Please sign in to comment.