HeartSaVioR commented on code in PR #47778:
URL: https://github.com/apache/spark/pull/47778#discussion_r1722496267
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateStore.scala:
##########
@@ -135,7 +135,14 @@ trait StateStore extends ReadStateStore {
valueSchema: StructType,
keyStateEncoderSpec: KeyStateEncoderSpec,
useMultipleValuesPerKey: Boolean = false,
- isInternal: Boolean = false): Short
+ isInternal: Boolean = false): Unit
+
+ // Test-visible methods to fetch column family mapping for this State Store
version
Review Comment:
Shall we put this into RocksDBStateStore and in test we perform explicit
type conversion to RocksDBStateStore? This still put the concept of column
family ID into top level of StateStore interface.
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala:
##########
@@ -635,17 +639,19 @@ class RocksDB(
logInfo(log"Syncing checkpoint for ${MDC(LogKeys.VERSION_NUM,
newVersion)} to DFS")
val fileSyncTimeMs = timeTakenMs {
if (enableChangelogCheckpointing) {
- try {
- assert(changelogWriter.isDefined)
- changelogWriter.foreach(_.commit())
- } finally {
- changelogWriter = None
- }
// If we have changed the columnFamilyId mapping, we have set a new
// snapshot and need to upload this to the DFS even if changelog
checkpointing
// is enabled.
if (shouldForceSnapshot.get()) {
uploadSnapshot()
+ changelogWriter = None
Review Comment:
nit: Let's explicitly call changelogWriter.foreach(_.abort()) to clean up
resource properly.
--
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]