anishshri-db commented on code in PR #50520:
URL: https://github.com/apache/spark/pull/50520#discussion_r2029575894
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala:
##########
@@ -1984,27 +1983,33 @@ case class AcquiredThreadInfo(
private[sql] class RocksDBLineageManager {
@volatile private var lineage: Array[LineageItem] = Array.empty
- override def toString: String = lineage.map {
- case LineageItem(version, uuid) => s"$version: $uuid"
- }.mkString(" ")
+ override def toString: String = synchronized {
+ lineage.map {
+ case LineageItem(version, uuid) => s"$version: $uuid"
+ }.mkString(" ")
+ }
- def appendLineageItem(item: LineageItem): Unit = {
+ def appendLineageItem(item: LineageItem): Unit = synchronized {
lineage = lineage :+ item
}
- def resetLineage(newLineage: Array[LineageItem]): Unit = {
+ def truncateFromVersion(versionToKeep: Long): Unit = synchronized {
+ resetLineage(getLineageForCurrVersion().filter(i => i.version >=
versionToKeep))
Review Comment:
Are there any other places where these 2 operations were split ?
--
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]