flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From azagre...@apache.org
Subject [flink] 03/03: [hotifx][tests] Remove dead code in TaskExecutorTest
Date Tue, 14 Apr 2020 09:14:47 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit b91c05953565a7b511ece8c8c0187a44ec9f22a1
Author: Andrey Zagrebin <azagrebin@apache.org>
AuthorDate: Thu Apr 9 11:44:31 2020 +0300

    [hotifx][tests] Remove dead code in TaskExecutorTest
---
 .../runtime/taskexecutor/TaskExecutorTest.java     | 39 +---------------------
 1 file changed, 1 insertion(+), 38 deletions(-)

diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java
index f140667..4d8beb8 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java
@@ -57,7 +57,6 @@ import org.apache.flink.runtime.io.network.partition.ResultPartitionID;
 import org.apache.flink.runtime.io.network.partition.TaskExecutorPartitionTracker;
 import org.apache.flink.runtime.io.network.partition.TaskExecutorPartitionTrackerImpl;
 import org.apache.flink.runtime.jobgraph.IntermediateDataSetID;
-import org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable;
 import org.apache.flink.runtime.jobmaster.AllocatedSlotInfo;
 import org.apache.flink.runtime.jobmaster.AllocatedSlotReport;
 import org.apache.flink.runtime.jobmaster.JMTMRegistrationSuccess;
@@ -1957,25 +1956,19 @@ public class TaskExecutorTest extends TestLogger {
 			.build());
 
 		jobManagerLeaderRetriever.notifyListener(jobMasterGateway.getAddress(), jobMasterGateway.getFencingToken().toUUID());
-		return new TaskExecutorTestingContext(offerSlotsLatch, jobMasterGateway, jobLeaderService,
taskSlotTable, taskExecutor);
+		return new TaskExecutorTestingContext(jobMasterGateway, taskSlotTable, taskExecutor);
 	}
 
 	private class TaskExecutorTestingContext implements AutoCloseable {
-		private final OneShotLatch offerSlotsLatch;
 		private final TestingJobMasterGateway jobMasterGateway;
-		private final JobLeaderService jobLeaderService;
 		private final TaskSlotTable taskSlotTable;
 		private final TestingTaskExecutor taskExecutor;
 
 		private TaskExecutorTestingContext(
-				OneShotLatch offerSlotsLatch,
 				TestingJobMasterGateway jobMasterGateway,
-				JobLeaderService jobLeaderService,
 				TaskSlotTable taskSlotTable,
 				TestingTaskExecutor taskExecutor) {
-			this.offerSlotsLatch = offerSlotsLatch;
 			this.jobMasterGateway = jobMasterGateway;
-			this.jobLeaderService = jobLeaderService;
 			this.taskSlotTable = taskSlotTable;
 			this.taskExecutor = taskExecutor;
 		}
@@ -1985,36 +1978,6 @@ public class TaskExecutorTest extends TestLogger {
 			taskExecutor.waitUntilStarted();
 		}
 
-		private void startAllocateSlotAndSubmit(
-			final Class<? extends AbstractInvokable> task) throws Exception {
-			final AllocationID allocationId = new AllocationID();
-
-			start();
-
-			taskSlotTable.allocateSlot(0, jobId, allocationId, Time.milliseconds(10000L));
-
-			// we have to add the job after the TaskExecutor, because otherwise the service has not
-			// been properly started.
-			jobLeaderService.addJob(jobId, jobMasterGateway.getAddress());
-			offerSlotsLatch.await();
-
-			taskExecutor
-				.getSelfGateway(TaskExecutorGateway.class)
-				.submitTask(
-					createTaskDeploymentDescriptor(allocationId, task),
-					jobMasterGateway.getFencingToken(),
-					timeout);
-		}
-
-		private TaskDeploymentDescriptor createTaskDeploymentDescriptor(
-			final AllocationID allocationId,
-			final Class<? extends AbstractInvokable> task) throws IOException {
-			return TaskDeploymentDescriptorBuilder
-				.newBuilder(jobId, task)
-				.setAllocationId(allocationId)
-				.build();
-		}
-
 		@Override
 		public void close() throws ExecutionException, InterruptedException, TimeoutException {
 			RpcUtils.terminateRpcEndpoint(taskExecutor, timeout);


Mime
View raw message