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_r328538591
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/async/queue/StreamElementQueueTest.java
 ##########
 @@ -18,253 +18,117 @@
 
 package org.apache.flink.streaming.api.operators.async.queue;
 
-import org.apache.flink.streaming.api.operators.async.OperatorActions;
+import org.apache.flink.streaming.api.datastream.AsyncDataStream;
+import org.apache.flink.streaming.api.functions.async.ResultFuture;
 import org.apache.flink.streaming.api.watermark.Watermark;
 import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
 import org.apache.flink.util.Preconditions;
 import org.apache.flink.util.TestLogger;
 
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
 
-import static 
org.apache.flink.streaming.api.operators.async.queue.StreamElementQueueTest.StreamElementQueueType.OrderedStreamElementQueueType;
-import static 
org.apache.flink.streaming.api.operators.async.queue.StreamElementQueueTest.StreamElementQueueType.UnorderedStreamElementQueueType;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
+import static 
org.apache.flink.streaming.api.operators.async.queue.QueueUtil.popCompleted;
+import static 
org.apache.flink.streaming.api.operators.async.queue.QueueUtil.putSucessfully;
+import static 
org.apache.flink.streaming.api.operators.async.queue.QueueUtil.putUnsucessfully;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for the basic functionality of {@link StreamElementQueue}. The basic 
operations consist
  * of putting and polling elements from the queue.
  */
 @RunWith(Parameterized.class)
 public class StreamElementQueueTest extends TestLogger {
-
-       private static final long timeout = 10000L;
-       private static ExecutorService executor;
-
-       @BeforeClass
-       public static void setup() {
-               executor = Executors.newFixedThreadPool(3);
-       }
-
-       @AfterClass
-       public static void shutdown() {
-               executor.shutdown();
-
-               try {
-                       if (!executor.awaitTermination(timeout, 
TimeUnit.MILLISECONDS)) {
-                               executor.shutdownNow();
-                       }
-               } catch (InterruptedException interrupted) {
-                       executor.shutdownNow();
-
-                       Thread.currentThread().interrupt();
-               }
-       }
-
-       enum StreamElementQueueType {
-               OrderedStreamElementQueueType,
-               UnorderedStreamElementQueueType
-       }
-
        @Parameterized.Parameters
-       public static Collection<StreamElementQueueType> 
streamElementQueueTypes() {
-               return Arrays.asList(OrderedStreamElementQueueType, 
UnorderedStreamElementQueueType);
+       public static Collection<AsyncDataStream.OutputMode> 
streamElementQueueTypes() {
 
 Review comment:
   streamElementQueueTypes -> outputModes

----------------------------------------------------------------
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