tillrohrmann commented on a change in pull request #18237:
URL: https://github.com/apache/flink/pull/18237#discussion_r800067576
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java
##########
@@ -176,14 +186,52 @@ public void storeLocalState(
}
}
+ /**
+ * Writes a task state snapshot file that contains the serialized content
of the local state.
+ *
+ * @param checkpointId identifying the checkpoint
+ * @param localState task state snapshot that will be persisted
+ */
+ private void persistLocalStateMetadata(long checkpointId,
TaskStateSnapshot localState) {
+ final File taskStateSnapshotFile =
getTaskStateSnapshotFile(checkpointId);
+ try (ObjectOutputStream oos =
+ new ObjectOutputStream(new
FileOutputStream(taskStateSnapshotFile))) {
+ oos.writeObject(localState);
+
+ LOG.debug(
+ "Successfully written local task state snapshot file {}
for checkpoint {}.",
+ taskStateSnapshotFile,
+ checkpointId);
+ } catch (IOException e) {
+ ExceptionUtils.rethrow(e, "Could not write the local task state
snapshot file.");
+ }
+ }
+
+ @VisibleForTesting
+ @Nonnull
+ File getTaskStateSnapshotFile(long checkpointId) {
+ final File checkpointDirectory =
+ localRecoveryConfig
+ .getLocalStateDirectoryProvider()
+ .subtaskSpecificCheckpointDirectory(checkpointId);
Review comment:
Will fix it.
--
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]