StefanRRichter commented on a change in pull request #8124: [FLINK-11877] 
Implement the runtime handling of the InputSelectable interface
URL: https://github.com/apache/flink/pull/8124#discussion_r274511867
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/Input.java
 ##########
 @@ -0,0 +1,69 @@
+/*
+ * 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.streaming.runtime.io;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.streaming.runtime.streamrecord.StreamElement;
+
+import java.io.IOException;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Basic interface for inputs of stream operators.
+ */
+@Internal
+public interface Input {
+
+       int getId();
+
+       /**
+        * Poll the next {@link StreamElement}.
+        *
+        * @return null if there is no data to return or if {@link 
#isFinished()} returns true.
+        *
+        * @throws IOException  Thrown if the network or local disk I/O fails.
+        * @throws InterruptedException Thrown if the thread is interrupted.
+        */
+       StreamElement pollNextElement() throws IOException, 
InterruptedException;
+
+       /**
+        * Tests if it reaches the end of the input.
+        *
+        * @return true if was reached, false otherwise.
+        */
+       boolean isFinished();
+
+       /**
+        * Register a listener that forward input notifications to.
+        */
+       CompletableFuture<?> listen();
+
+       /**
+        * Cancel the listener registered previously.
+        *
+        * <p>Note that it must be guaranteed to be thread-safe.
+        */
+       void unlisten();
+
+       /**
+        * Closes this input and releases any resources associated with the 
input.
+        *
+        * @throws Exception
 
 Review comment:
   Missing description.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to