File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,7 @@ private[state] class HDFSBackedStateStoreProvider extends StateStoreProvider wit
129
129
verify(state == UPDATING , " Cannot commit after already committed or aborted" )
130
130
131
131
try {
132
- finalizeDeltaFile(compressedStream)
133
- loadedMaps.put(newVersion, mapToUpdate)
132
+ commitUpdates(newVersion, mapToUpdate, compressedStream)
134
133
state = COMMITTED
135
134
logInfo(s " Committed version $newVersion for $this to file $finalDeltaFile" )
136
135
newVersion
@@ -250,6 +249,13 @@ private[state] class HDFSBackedStateStoreProvider extends StateStoreProvider wit
250
249
251
250
private case class StoreFile (version : Long , path : Path , isSnapshot : Boolean )
252
251
252
+ private def commitUpdates (newVersion : Long , map : MapType , output : DataOutputStream ): Unit = {
253
+ synchronized {
254
+ finalizeDeltaFile(output)
255
+ loadedMaps.put(newVersion, map)
256
+ }
257
+ }
258
+
253
259
/**
254
260
* Get iterator of all the data of the latest version of the store.
255
261
* Note that this will look up the files to determined the latest known version.
You can’t perform that action at this time.
0 commit comments