anishshri-db commented on code in PR #47730:
URL: https://github.com/apache/spark/pull/47730#discussion_r1717992420
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala:
##########
@@ -233,7 +250,39 @@ class RocksDB(
changelogWriter.foreach(_.abort())
changelogWriter = Some(fileManager.getChangeLogWriter(version + 1,
useColumnFamilies))
}
- this
+ (this, loadedMapping, maxColumnFamilyId)
+ }
+
+ private def getColumnFamilyMapping(): Map[String, Short] = {
+ colFamilyNameToIdMap.asScala.toMap
+ }
+
+ private def getMaxColumnFamilyId(): Short = {
+ maxColumnFamilyId.get().toShort
+ }
+
+ def updateColumnFamilyMapping(mapping: Option[Map[String, Short]]): Unit = {
+ mapping.foreach { map =>
+ // Check if map and colFamilyNameToIdMap are the same
+ // if so, we don't need to force a snapshot and put a map.
+ if (map.size == colFamilyNameToIdMap.size() &&
Review Comment:
this is not thread safe any more. We need to guard with a explicit mutex
--
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]