You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by za...@apache.org on 2025/03/04 11:55:23 UTC
(flink) 01/07: [FLINK-33734][checkpointing] Introduce interface ChannelState,InputStateHandle,OutputStateHandle
This is an automated email from the ASF dual-hosted git repository.
zakelly pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit be91c9f278f3543089facfd7b0a97188d30a65f1
Author: wangfeifan <zo...@163.com>
AuthorDate: Thu Feb 1 12:23:43 2024 +0800
[FLINK-33734][checkpointing] Introduce interface ChannelState,InputStateHandle,OutputStateHandle
---
.../apache/flink/runtime/state/ChannelState.java | 22 ++++++++++++++++++++++
.../runtime/state/InputChannelStateHandle.java | 3 ++-
.../flink/runtime/state/InputStateHandle.java | 22 ++++++++++++++++++++++
.../flink/runtime/state/OutputStateHandle.java | 22 ++++++++++++++++++++++
.../state/ResultSubpartitionStateHandle.java | 2 +-
5 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/ChannelState.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/ChannelState.java
new file mode 100644
index 00000000000..33e1ab7b6b7
--- /dev/null
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/ChannelState.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.state;
+
+/** empty interface just for mark a state object is unaligned checkpoint inflight-data. */
+public interface ChannelState extends StateObject {}
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/InputChannelStateHandle.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/InputChannelStateHandle.java
index 6fdf8b84999..36f36ebb61c 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/InputChannelStateHandle.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/InputChannelStateHandle.java
@@ -28,7 +28,8 @@ import java.util.List;
* org.apache.flink.runtime.io.network.partition.consumer.InputChannel InputChannel} state.
*/
@Internal
-public class InputChannelStateHandle extends AbstractChannelStateHandle<InputChannelInfo> {
+public class InputChannelStateHandle extends AbstractChannelStateHandle<InputChannelInfo>
+ implements InputStateHandle {
private static final long serialVersionUID = 1L;
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/InputStateHandle.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/InputStateHandle.java
new file mode 100644
index 00000000000..eb7b4c7de66
--- /dev/null
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/InputStateHandle.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.state;
+
+/** empty interface just for mark a state object is input inflight-data. */
+public interface InputStateHandle extends ChannelState {}
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/OutputStateHandle.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/OutputStateHandle.java
new file mode 100644
index 00000000000..e6c5f205d29
--- /dev/null
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/OutputStateHandle.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.state;
+
+/** empty interface just for mark a state object is output inflight-data. */
+public interface OutputStateHandle extends ChannelState {}
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/ResultSubpartitionStateHandle.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/ResultSubpartitionStateHandle.java
index 0f281506f49..4b969e028ed 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/ResultSubpartitionStateHandle.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/ResultSubpartitionStateHandle.java
@@ -29,7 +29,7 @@ import java.util.List;
*/
@Internal
public class ResultSubpartitionStateHandle
- extends AbstractChannelStateHandle<ResultSubpartitionInfo> {
+ extends AbstractChannelStateHandle<ResultSubpartitionInfo> implements OutputStateHandle {
private static final long serialVersionUID = 1L;