WweiL commented on code in PR #48355:
URL: https://github.com/apache/spark/pull/48355#discussion_r1875419366
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala:
##########
@@ -359,6 +471,50 @@ class RocksDB(
this
}
+ /**
+ * Initialize in memory values based on the metadata loaded from DFS.
+ * @param metadata: metadata loaded from DFS
+ */
+ private def init(metadata: RocksDBCheckpointMetadata): Unit = {
+
+ setInitialCFInfo()
+ metadata.columnFamilyMapping.foreach { mapping =>
+ colFamilyNameToIdMap.putAll(mapping.asJava)
+ }
+
+ metadata.maxColumnFamilyId.foreach { maxId =>
+ maxColumnFamilyId.set(maxId)
+ }
+ openDB()
+ numKeysOnWritingVersion = if (!conf.trackTotalNumberOfRows) {
+ // we don't track the total number of rows - discard the number being
track
+ -1L
+ } else if (metadata.numKeys < 0) {
+ // we track the total number of rows, but the snapshot doesn't have
tracking number
+ // need to count keys now
+ countKeys()
+ } else {
+ metadata.numKeys
+ }
+ }
+
+ def load(
+ version: Long,
+ stateStoreCkptId: Option[String] = None,
+ readOnly: Boolean = false): RocksDB = {
+ assert(version >= 0)
+ acquire(LoadStore)
+ recordedMetrics = None
+ logInfo(log"Loading ${MDC(LogKeys.VERSION_NUM, version)} with
stateStoreCkptId: ${
+ MDC(LogKeys.UUID, stateStoreCkptId.getOrElse(""))}")
+ if (enableStateStoreCheckpointIds) {
Review Comment:
sure
--
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]