Savonitar commented on code in PR #28709:
URL: https://github.com/apache/flink/pull/28709#discussion_r3588128000
##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/Checkpoints.java:
##########
@@ -76,29 +78,80 @@ public class Checkpoints {
// Writing out checkpoint metadata
// ------------------------------------------------------------------------
- public static void storeCheckpointMetadata(
+ /**
+ * Stores the checkpoint metadata without knowing the checkpoint's
exclusive directory: relative
+ * file references are always persisted as relative and are resolved
against whatever directory
+ * the metadata is later read from. When writing the metadata of an actual
checkpoint or
+ * savepoint, prefer {@link #storeCheckpointMetadata(CheckpointMetadata,
+ * CheckpointMetadataOutputStream)}.
+ *
+ * <p>The deliberately different method name keeps the context-free
variants out of the {@code
+ * storeCheckpointMetadata} overload set, so a caller cannot switch
between the two encodings by
+ * merely changing a variable's static type.
+ */
+ public static void storeCheckpointMetadataWithoutExclusiveDir(
CheckpointMetadata checkpointMetadata, OutputStream out) throws
IOException {
DataOutputStream dos = new DataOutputStream(out);
- storeCheckpointMetadata(checkpointMetadata, dos);
+ storeCheckpointMetadataWithoutExclusiveDir(checkpointMetadata, dos);
}
+ /**
+ * Stores the checkpoint metadata into the given metadata output stream,
passing the stream's
+ * exclusive checkpoint directory to the serializer so that relative file
references stay
+ * self-consistent on recovery.
+ */
Review Comment:
java docs updated in
https://github.com/apache/flink/pull/28709/changes/70dff60af58276a15ed5b87687ce24c989e4600d
--
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]