Savonitar commented on code in PR #28709:
URL: https://github.com/apache/flink/pull/28709#discussion_r3588500730
##########
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(
Review Comment:
The main use case is the state processor API's deep copy: the carried-over
handles refer to outside the directory at write time, while FileCopyFunction
puts a copy of every referenced file next to the new _metadata, so on read all
relative references are correct. "Forbidding" would break that usage, which is
correct.
--
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]