Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
[NSE-42] early release sort input (#43)
Browse files Browse the repository at this point in the history
* early close sort input to reduce memory footprint

Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>

* remove double close

Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
  • Loading branch information
zhouyuan authored Jan 18, 2021
1 parent 1c4a4e5 commit c907202
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class ColumnarSorter(
elapse.set(NANOSECONDS.toMillis(total_elapse))
sortTime.set(NANOSECONDS.toMillis(sort_elapse))
shuffleTime.set(NANOSECONDS.toMillis(shuffle_elapse))
inputBatchHolder.foreach(cb => cb.close())
if (sorter != null) {
sorter.close()
}
Expand Down Expand Up @@ -153,7 +152,12 @@ class ColumnarSorter(
sort_elapse += System.nanoTime() - beforeSort
total_elapse += System.nanoTime() - beforeSort
}
sort_iterator.hasNext()
if (sort_iterator.hasNext()) {
return true
} else {
inputBatchHolder.foreach(cb => cb.close())
return false
}
}

override def next(): ColumnarBatch = {
Expand Down

0 comments on commit c907202

Please sign in to comment.