Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getCatalog can be called from the driver, and can return null #562

Merged
merged 1 commit into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ object GpuShuffleEnv extends Logging {
Option(env).foreach(_.closeStorage())
}

def getCatalog: ShuffleBufferCatalog = if (env == null) {
null
} else {
env.getCatalog
}

//
// Functions below only get called from the executor
//
Expand All @@ -135,8 +141,6 @@ object GpuShuffleEnv extends Logging {
env = shuffleEnv
}

def getCatalog: ShuffleBufferCatalog = env.getCatalog

def getReceivedCatalog: ShuffleReceivedBufferCatalog = env.getReceivedCatalog

def getDeviceStorage: RapidsDeviceMemoryStore = env.getDeviceStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ abstract class RapidsShuffleInternalManagerBase(conf: SparkConf, isDriver: Boole

//Many of these values like blockManager are not initialized when the constructor is called,
// so they all need to be lazy values that are executed when things are first called

// NOTE: this can be null in the driver side.
private[this] lazy val catalog = GpuShuffleEnv.getCatalog
private lazy val env = SparkEnv.get
private lazy val blockManager = env.blockManager
Expand Down Expand Up @@ -284,7 +286,7 @@ abstract class RapidsShuffleInternalManagerBase(conf: SparkConf, isDriver: Boole
gpu.asInstanceOf[GpuShuffleHandle[K, V]],
mapId,
metrics,
GpuShuffleEnv.getCatalog,
catalog,
GpuShuffleEnv.getDeviceStorage,
server)
case other =>
Expand Down