liviazhu-db commented on code in PR #50497: URL: https://github.com/apache/spark/pull/50497#discussion_r2049379593
########## sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreProvider.scala: ########## @@ -43,14 +43,120 @@ private[sql] class RocksDBStateStoreProvider with SupportsFineGrainedReplay { import RocksDBStateStoreProvider._ - class RocksDBStateStore(lastVersion: Long) extends StateStore { + /** + * Implementation of a state store that uses RocksDB as the backing data store. + * + * This store implements a state machine with the following states: + * - UPDATING: The store is being updated and has not yet been committed or aborted + * - COMMITTED: Updates have been successfully committed + * - ABORTED: Updates have been aborted + * + * Operations are validated against the current state to ensure proper usage: + * - Get/put/remove/iterator operations are only allowed in UPDATING state + * - Commit is only allowed in UPDATING state + * - Abort is allowed in UPDATING or ABORTED state + * - Metrics retrieval is only allowed in COMMITTED or ABORTED state + * + * Each store instance is assigned a unique stamp when created, which is used to + * verify that operations are performed by the owning thread and to prevent + * concurrent modifications to the same store. Review Comment: "concurrent modifications to the same store" -> "concurrent modifications to the same StateStoreProvider/NativeRocksDB instance" (the term "store" is overloaded) -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org