zhijiangW commented on a change in pull request #9717: [FLINK-14044] [runtime] 
Reducing synchronization in AsyncWaitOperator
URL: https://github.com/apache/flink/pull/9717#discussion_r327957126
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/async/queue/StreamElementQueueEntry.java
 ##########
 @@ -19,79 +19,47 @@
 package org.apache.flink.streaming.api.operators.async.queue;
 
 import org.apache.flink.annotation.Internal;
+import org.apache.flink.streaming.api.functions.async.ResultFuture;
+import org.apache.flink.streaming.api.operators.TimestampedCollector;
 import org.apache.flink.streaming.runtime.streamrecord.StreamElement;
-import org.apache.flink.util.Preconditions;
 
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.Executor;
-import java.util.function.Consumer;
+import javax.annotation.Nonnull;
 
 /**
- * Entry class for the {@link StreamElementQueue}. The stream element queue 
entry stores the
- * {@link StreamElement} for which the stream element queue entry has been 
instantiated.
- * Furthermore, it allows to register callbacks for when the queue entry is 
completed.
- *
- * @param <T> Type of the result
+ * An entry for the {@link StreamElementQueue}. The stream element queue entry 
stores the {@link StreamElement} for
+ * which the stream element queue entry has been instantiated.
+ * Furthermore, it allows to set the result of a completed entry through 
{@link ResultFuture}.
  */
 @Internal
-public abstract class StreamElementQueueEntry<T> implements AsyncResult {
-
-       private final StreamElement streamElement;
-
-       public StreamElementQueueEntry(StreamElement streamElement) {
-               this.streamElement = Preconditions.checkNotNull(streamElement);
-       }
-
-       public StreamElement getStreamElement() {
-               return streamElement;
-       }
+interface StreamElementQueueEntry<OUT> extends ResultFuture<OUT> {
 
        /**
         * True if the stream element queue entry has been completed; otherwise 
false.
         *
         * @return True if the stream element queue entry has been completed; 
otherwise false.
         */
-       public boolean isDone() {
-               return getFuture().isDone();
-       }
+       boolean isDone();
 
        /**
-        * Register the given complete function to be called once this queue 
entry has been completed.
+        * Emits the results associated with this queue entry.
         *
-        * @param completeFunction to call when the queue entry has been 
completed
-        * @param executor to run the complete function
+        * @param output the output into which to emit.
+        * @throws IllegalStateException if this entry is not done yet.
 
 Review comment:
   We can not see this exception explicitly, so might not need this javadoc

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to