WweiL commented on code in PR #48355:
URL: https://github.com/apache/spark/pull/48355#discussion_r1871446835


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala:
##########
@@ -278,77 +280,186 @@ class RocksDB(
   // We send snapshots that needs to be uploaded by the maintenance thread to 
this queue
   private val snapshotsToUploadQueue = new 
ConcurrentLinkedQueue[RocksDBSnapshot]()
 
+  /**
+   * Based on the ground truth lineage loaded from changelog file (lineage) and
+   * the latest snapshot (version, uniqueId) pair from file listing, this 
function finds
+   * the ground truth latest snapshot (version, uniqueId) the db instance 
needs to load.
+   *
+   * @param lineage the ground truth lineage loaded from changelog file

Review Comment:
   After the refactor here
   
https://github.com/apache/spark/blob/97d31afa77afc7594f947cadc52f8af6a3f021be/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBFileManager.scala#L354
   
   lineage being sorted is not an enforced requirement because there is a 
`sort` in the function itself.
   
   I still sorted the array here: 
https://github.com/apache/spark/blob/abe6056bf8e10e52081a0becad598f2f5ff22e06/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala#L344



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

Reply via email to