Skip to content

Commit

Permalink
Refactor GpuSorter further to keep it in SortUtils and just shim out …
Browse files Browse the repository at this point in the history
…the Stack implementation

Signed-off-by: Navin Kumar <[email protected]>
  • Loading branch information
NVnavkumar committed Oct 26, 2023
1 parent 5db5520 commit eb2dbd3
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 311 deletions.
147 changes: 0 additions & 147 deletions sql-plugin/src/main/scala-2.12/com/nvidia/spark/rapids/GpuSorter.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ package com.nvidia.spark.rapids

import scala.collection.mutable.ArrayStack

object CollectionHelper {
def createStack[T](): ArrayStack[T] = {
new ArrayStack[T]()
}
}
class ScalaStack[T] extends ArrayStack[T]
148 changes: 0 additions & 148 deletions sql-plugin/src/main/scala-2.13/com/nvidia/spark/rapids/GpuSorter.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ package com.nvidia.spark.rapids

import scala.collection.mutable.Stack

object CollectionHelper {
def createStack[T](): Stack[T] = {
new Stack[T]()
}
}
class ScalaStack[T] extends Stack[T]
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ case class GpuOutOfCoreSortIterator(
while (!pending.isEmpty && sortedSize < targetSize) {
// Keep going until we have enough data to return
var bytesLeftToFetch = targetSize
val pendingSort = CollectionHelper.createStack[SpillableColumnarBatch]()
val pendingSort = new ScalaStack[SpillableColumnarBatch]()
closeOnExcept(pendingSort) { _ =>
while (!pending.isEmpty &&
(bytesLeftToFetch - pending.peek().buffer.sizeInBytes >= 0 || pendingSort.isEmpty)) {
Expand Down
Loading

0 comments on commit eb2dbd3

Please sign in to comment.