You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/31 08:24:29 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #37648: [SPARK-38909][BUILD][CORE][YARN][FOLLOWUP] Make some code cleanup related to shuffle state db

LuciferYang commented on code in PR #37648:
URL: https://github.com/apache/spark/pull/37648#discussion_r959301662


##########
resource-managers/yarn/src/test/scala/org/apache/spark/network/shuffle/ShuffleTestAccessor.scala:
##########
@@ -220,4 +219,21 @@ object ShuffleTestAccessor {
       db: DB): ConcurrentMap[ExternalShuffleBlockResolver.AppExecId, ExecutorShuffleInfo] = {
     ExternalShuffleBlockResolver.reloadRegisteredExecutors(db)
   }
+
+  private def initDB(dbBackend: DBBackend, file: File): DB = {
+    if (file != null) {
+      // TODO: SPARK-38888, add rocksdb implementation.
+      dbBackend match {
+        case DBBackend.LEVELDB =>
+          val options = new org.iq80.leveldb.Options()
+          options.createIfMissing(true)
+          val factory = new org.fusesource.leveldbjni.JniDBFactory()
+          new LevelDB(factory.open(file, options))
+        case _ =>
+          throw new IllegalArgumentException("Unsupported DBBackend: " + dbBackend)
+      }
+    } else {
+      null
+    }

Review Comment:
   OK, let me revert this change first and then see if there is a better way
   
   



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org