maheshk114 commented on code in PR #45228:
URL: https://github.com/apache/spark/pull/45228#discussion_r1542850643
##########
core/src/main/scala/org/apache/spark/storage/FallbackStorage.scala:
##########
@@ -110,14 +158,35 @@ private[spark] object FallbackStorage extends Logging {
/** We use one block manager id as a place holder. */
val FALLBACK_BLOCK_MANAGER_ID: BlockManagerId = BlockManagerId("fallback",
"remote", 7337)
- def getFallbackStorage(conf: SparkConf): Option[FallbackStorage] = {
- if (conf.get(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH).isDefined) {
- Some(new FallbackStorage(conf))
+ // There should be only one fallback storage thread pool per executor.
+ var fallbackStorage: Option[FallbackStorage] = None
+ def getFallbackStorage(conf: SparkConf): Option[FallbackStorage] =
this.synchronized {
+ if (conf != null &&
conf.get(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH).isDefined) {
+ if (fallbackStorage.isDefined) {
+ val fallbackPath =
conf.get(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH).get
+ if (fallbackPath.equals(fallbackStorage.get.fallbackPath.toString)) {
+ logDebug(s"FallbackStorage defined with path $fallbackPath")
+ fallbackStorage
+ } else {
+ // for unit test.
+ Some(new FallbackStorage(conf))
+ }
+ } else {
+ fallbackStorage = Some(new FallbackStorage(conf))
+ logInfo(s"Created FallbackStorage $fallbackStorage")
+ fallbackStorage
+ }
} else {
None
}
}
+ def getNumReadThreads(conf: SparkConf): Int = {
+ val numShuffleThreads =
+ if (conf == null) None else
conf.get(STORAGE_FALLBACK_STORAGE_NUM_THREADS_FOR_SHUFFLE_READ)
Review Comment:
to fix UT failures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]