You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2020/09/15 08:29:28 UTC

[flink-statefun] 02/06: [FLINK-19220] Add an internal interface

This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit 6e11a27934044e2566548e9c488507bc7f909ca3
Author: Igal Shilman <ig...@gmail.com>
AuthorDate: Mon Sep 14 17:16:28 2020 +0200

    [FLINK-19220] Add an internal interface
    
    This commits adds an internal interface that
    indicate that the implementer is managing
    resources. The implementers of that interface
    require to be notified explicitly when a task
    shuts down. (via the .shutdown() method)
---
 .../flink/core/common/ManagingResources.java       | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/common/ManagingResources.java b/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/common/ManagingResources.java
new file mode 100644
index 0000000..bc4ba3d
--- /dev/null
+++ b/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/common/ManagingResources.java
@@ -0,0 +1,30 @@
+/*
+ * 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.statefun.flink.core.common;
+
+import org.apache.flink.annotation.Internal;
+
+@Internal
+public interface ManagingResources {
+  /**
+   * This method would be called by the runtime on shutdown, and indicates that this is the time to
+   * free up any resources managed by this class.
+   */
+  void shutdown();
+}