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/11/17 03:38:11 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #38567: [SPARK-41054][UI][CORE] Support RocksDB as KVStore in live UI

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


##########
core/src/main/scala/org/apache/spark/status/KVUtils.scala:
##########
@@ -80,6 +89,44 @@ private[spark] object KVUtils extends Logging {
     db
   }
 
+  def createKVStore(
+      storePath: Option[File],
+      diskBackend: HybridStoreDiskBackend.Value,
+      conf: SparkConf): KVStore = {
+    storePath.map { path =>
+      val dir = diskBackend match {
+        case LEVELDB => "listing.ldb"
+        case ROCKSDB => "listing.rdb"
+      }
+
+      val dbPath = Files.createDirectories(new File(path, dir).toPath()).toFile()
+      Utils.chmod700(dbPath)
+
+
+      val metadata = FsHistoryProviderMetadata(
+        FsHistoryProvider.CURRENT_LISTING_VERSION,
+        AppStatusStore.CURRENT_VERSION,
+        conf.get(History.HISTORY_LOG_DIR))
+
+      try {
+        open(dbPath, metadata, conf, Some(diskBackend))
+      } catch {
+        // If there's an error, remove the listing database and any existing UI database
+        // from the store directory, since it's extremely likely that they'll all contain
+        // incompatible information.
+        case _: UnsupportedStoreVersionException | _: MetadataMismatchException =>

Review Comment:
   For Live UI, are these two exception scenarios possible?



-- 
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