You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/01/16 21:00:51 UTC

[GitHub] TisonKun commented on a change in pull request #7245: [FLINK-11069] [utils] Remove FutureUtil

TisonKun commented on a change in pull request #7245: [FLINK-11069] [utils] Remove FutureUtil
URL: https://github.com/apache/flink/pull/7245#discussion_r248448673
 
 

 ##########
 File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannelTest.java
 ##########
 @@ -158,27 +160,31 @@ public void testConcurrentConsumeMultiplePartitions() throws Exception {
 		// Test
 		try {
 			// Submit producer tasks
-			List<Future<?>> results = Lists.newArrayListWithCapacity(
+			List<CompletableFuture<?>> results = Lists.newArrayListWithCapacity(
 				parallelism + 1);
 
 			for (int i = 0; i < parallelism; i++) {
-				results.add(executor.submit(partitionProducers[i]));
+				results.add(CompletableFuture.supplyAsync(
+					CheckedSupplier.unchecked(partitionProducers[i]::call), executor));
 			}
 
 			// Submit consumer
 			for (int i = 0; i < parallelism; i++) {
-				results.add(executor.submit(
-					new TestLocalInputChannelConsumer(
-						i,
-						parallelism,
-						numberOfBuffersPerChannel,
-						networkBuffers.createBufferPool(parallelism, parallelism),
-						partitionManager,
-						new TaskEventDispatcher(),
-						partitionIds)));
+				results.add(CompletableFuture.supplyAsync(
+					CheckedSupplier.unchecked(
+						new TestLocalInputChannelConsumer(
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services