attilapiros commented on a change in pull request #23393: 
[SPARK-26288][CORE]add initRegisteredExecutorsDB
URL: https://github.com/apache/spark/pull/23393#discussion_r265140605
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/deploy/ExternalShuffleService.scala
 ##########
 @@ -58,9 +61,39 @@ class ExternalShuffleService(sparkConf: SparkConf, 
securityManager: SecurityMana
 
   private val shuffleServiceSource = new ExternalShuffleServiceSource
 
+  protected def findRegisteredExecutorsDBFile(dbName: String): File = {
+    val localDirs = 
sparkConf.getOption("spark.local.dir").map(_.split(",")).getOrElse(Array())
+    var dbFile: File = null
 
 Review comment:
   I just have seen the default value of "spark.local.dir" is 64 and might 
happen the first one contains the "registeredExecutors.ldb" file so what about 
replacing the `for` and the `if` to something like:
   
   ```scala
   localDirs
     .find(dir => new File(dir, dbName).exists())
     .getOrElse(new File(localDirs(0), dbName))
   ```
   
   As `find` stops at the first occurrence.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to