This is an automated email from the ASF dual-hosted git repository. roman pushed a commit to branch release-1.16 in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.16 by this push: new f2d3ca0bf4d [hotfix][checkpointing] Fix outdated java doc in SharedStateRegistry after FLINK-29913 f2d3ca0bf4d is described below commit f2d3ca0bf4d49621450c7e71c1bd7c9de2deb89b Author: wangfeifan <zoltar9...@163.com> AuthorDate: Sat Aug 5 19:14:55 2023 +0800 [hotfix][checkpointing] Fix outdated java doc in SharedStateRegistry after FLINK-29913 Co-authored-by: Roman <khachatryan.ro...@gmail.com> --- .../apache/flink/runtime/state/SharedStateRegistry.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java index 097e7f12da8..53beb00bb35 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java @@ -54,19 +54,20 @@ public interface SharedStateRegistry extends AutoCloseable { } /** - * Register a reference to the given shared state in the registry. If there is already a state - * handle registered under the given key, the "new" state handle is disposed . + * Register a reference to the given shared state in the registry. The registry key should be + * based on the physical identifier of the state. If there is already a state handle registered + * under the same key and the 'new' state is not equal to the old one, an exception will be + * thrown. * - * <p>IMPORTANT: caller should check the state handle returned by the result, because the - * registry is performing de-duplication and could potentially return a handle that is supposed - * to replace the one from the registration request. + * <p>IMPORTANT: the caller must use the returned state handle instead of the passed one because + * the registry might replace or update it. * * @param state the shared state for which we register a reference. * @param checkpointID which uses the state * @param preventDiscardingCreatedCheckpoint as long as this state is still in use. The * "checkpoint that created the state" is recorded on the first state registration. - * @return the result of this registration request, consisting of the state handle that is - * registered under the key by the end of the operation and its current reference count. + * @return the state handle registered under the given key. It might differ from the passed + * state handle, e.g. if it was a placeholder. */ StreamStateHandle registerReference( SharedStateRegistryKey registrationKey,