Search in sources :

Example 1 with ComponentMainThreadExecutor

use of org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor in project flink by apache.

the class Execution method releaseAssignedResource.

/**
 * Releases the assigned resource and completes the release future once the assigned resource
 * has been successfully released.
 *
 * @param cause for the resource release, null if none
 */
private void releaseAssignedResource(@Nullable Throwable cause) {
    assertRunningInJobMasterMainThread();
    final LogicalSlot slot = assignedResource;
    if (slot != null) {
        ComponentMainThreadExecutor jobMasterMainThreadExecutor = getVertex().getExecutionGraphAccessor().getJobMasterMainThreadExecutor();
        slot.releaseSlot(cause).whenComplete((Object ignored, Throwable throwable) -> {
            jobMasterMainThreadExecutor.assertRunningInMainThread();
            if (throwable != null) {
                releaseFuture.completeExceptionally(throwable);
            } else {
                releaseFuture.complete(null);
            }
        });
    } else {
        // no assigned resource --> we can directly complete the release future
        releaseFuture.complete(null);
    }
}
Also used : ComponentMainThreadExecutor(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor) LogicalSlot(org.apache.flink.runtime.jobmaster.LogicalSlot)

Example 2 with ComponentMainThreadExecutor

use of org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor in project flink by apache.

the class AdaptiveScheduler method tryToAssignSlots.

@Override
public CreatingExecutionGraph.AssignmentResult tryToAssignSlots(CreatingExecutionGraph.ExecutionGraphWithVertexParallelism executionGraphWithVertexParallelism) {
    final ExecutionGraph executionGraph = executionGraphWithVertexParallelism.getExecutionGraph();
    executionGraph.start(componentMainThreadExecutor);
    executionGraph.transitionToRunning();
    executionGraph.setInternalTaskFailuresListener(new UpdateSchedulerNgOnInternalFailuresListener(this));
    final VertexParallelism vertexParallelism = executionGraphWithVertexParallelism.getVertexParallelism();
    return slotAllocator.tryReserveResources(vertexParallelism).map(reservedSlots -> CreatingExecutionGraph.AssignmentResult.success(assignSlotsToExecutionGraph(executionGraph, reservedSlots))).orElseGet(CreatingExecutionGraph.AssignmentResult::notPossible);
}
Also used : UpdateSchedulerNgOnInternalFailuresListener(org.apache.flink.runtime.scheduler.UpdateSchedulerNgOnInternalFailuresListener) ExecutionGraphFactory(org.apache.flink.runtime.scheduler.ExecutionGraphFactory) DeclarativeSlotPool(org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPool) TaskNotRunningException(org.apache.flink.runtime.operators.coordination.TaskNotRunningException) CheckpointException(org.apache.flink.runtime.checkpoint.CheckpointException) ResultPartitionID(org.apache.flink.runtime.io.network.partition.ResultPartitionID) PhysicalSlot(org.apache.flink.runtime.jobmaster.slotpool.PhysicalSlot) Duration(java.time.Duration) FunctionWithException(org.apache.flink.util.function.FunctionWithException) ExecutionGraphHandler(org.apache.flink.runtime.scheduler.ExecutionGraphHandler) JobManagerJobMetricGroup(org.apache.flink.runtime.metrics.groups.JobManagerJobMetricGroup) ReservedSlots(org.apache.flink.runtime.scheduler.adaptive.allocator.ReservedSlots) MetricOptions(org.apache.flink.configuration.MetricOptions) JobManagerOptions(org.apache.flink.configuration.JobManagerOptions) ExecutionFailureHandler(org.apache.flink.runtime.executiongraph.failover.flip1.ExecutionFailureHandler) JobStatusStore(org.apache.flink.runtime.scheduler.JobStatusStore) VertexParallelismStore(org.apache.flink.runtime.scheduler.VertexParallelismStore) CheckpointScheduling(org.apache.flink.runtime.checkpoint.CheckpointScheduling) RootExceptionHistoryEntry(org.apache.flink.runtime.scheduler.exceptionhistory.RootExceptionHistoryEntry) FlinkException(org.apache.flink.util.FlinkException) ComponentMainThreadExecutor(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor) JobEdge(org.apache.flink.runtime.jobgraph.JobEdge) CoordinationResponse(org.apache.flink.runtime.operators.coordination.CoordinationResponse) ExceptionHistoryEntry(org.apache.flink.runtime.scheduler.exceptionhistory.ExceptionHistoryEntry) ExecutionGraph(org.apache.flink.runtime.executiongraph.ExecutionGraph) ResourceCounter(org.apache.flink.runtime.util.ResourceCounter) JobStatus(org.apache.flink.api.common.JobStatus) CheckpointFailureReason(org.apache.flink.runtime.checkpoint.CheckpointFailureReason) ArrayList(java.util.ArrayList) SchedulerNG(org.apache.flink.runtime.scheduler.SchedulerNG) FutureUtils(org.apache.flink.util.concurrent.FutureUtils) PartitionProducerDisposedException(org.apache.flink.runtime.jobmanager.PartitionProducerDisposedException) JobExecutionException(org.apache.flink.runtime.client.JobExecutionException) Nullable(javax.annotation.Nullable) DefaultVertexParallelismStore(org.apache.flink.runtime.scheduler.DefaultVertexParallelismStore) KvStateLocation(org.apache.flink.runtime.query.KvStateLocation) Executor(java.util.concurrent.Executor) ExecutionState(org.apache.flink.runtime.execution.ExecutionState) VertexParallelism(org.apache.flink.runtime.scheduler.adaptive.allocator.VertexParallelism) CheckpointsCleaner(org.apache.flink.runtime.checkpoint.CheckpointsCleaner) IOException(java.io.IOException) OperatorCoordinatorHandler(org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler) VisibleForTesting(org.apache.flink.annotation.VisibleForTesting) RestartBackoffTimeStrategy(org.apache.flink.runtime.executiongraph.failover.flip1.RestartBackoffTimeStrategy) ReactiveScaleUpController(org.apache.flink.runtime.scheduler.adaptive.scalingpolicy.ReactiveScaleUpController) TaskExecutionStateTransition(org.apache.flink.runtime.executiongraph.TaskExecutionStateTransition) JobID(org.apache.flink.api.common.JobID) SlotInfo(org.apache.flink.runtime.jobmaster.SlotInfo) ExecutionVertex(org.apache.flink.runtime.executiongraph.ExecutionVertex) KvStateID(org.apache.flink.queryablestate.KvStateID) ScheduledFuture(java.util.concurrent.ScheduledFuture) ScaleUpController(org.apache.flink.runtime.scheduler.adaptive.scalingpolicy.ScaleUpController) TaskDeploymentDescriptorFactory(org.apache.flink.runtime.deployment.TaskDeploymentDescriptorFactory) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) LoggerFactory(org.slf4j.LoggerFactory) ExceptionUtils(org.apache.flink.util.ExceptionUtils) UpdateSchedulerNgOnInternalFailuresListener(org.apache.flink.runtime.scheduler.UpdateSchedulerNgOnInternalFailuresListener) MutableVertexAttemptNumberStore(org.apache.flink.runtime.executiongraph.MutableVertexAttemptNumberStore) BoundedFIFOQueue(org.apache.flink.runtime.util.BoundedFIFOQueue) TaskStateSnapshot(org.apache.flink.runtime.checkpoint.TaskStateSnapshot) KeyGroupRange(org.apache.flink.runtime.state.KeyGroupRange) UnknownKvStateLocation(org.apache.flink.runtime.query.UnknownKvStateLocation) SerializedInputSplit(org.apache.flink.runtime.jobmaster.SerializedInputSplit) JobDetails(org.apache.flink.runtime.messages.webmonitor.JobDetails) CheckpointIDCounter(org.apache.flink.runtime.checkpoint.CheckpointIDCounter) Collection(java.util.Collection) IntermediateDataSetID(org.apache.flink.runtime.jobgraph.IntermediateDataSetID) Preconditions(org.apache.flink.util.Preconditions) InetSocketAddress(java.net.InetSocketAddress) ResourceProfile(org.apache.flink.runtime.clusterframework.types.ResourceProfile) List(java.util.List) CoordinationRequest(org.apache.flink.runtime.operators.coordination.CoordinationRequest) FlinkJobNotFoundException(org.apache.flink.runtime.messages.FlinkJobNotFoundException) OperatorID(org.apache.flink.runtime.jobgraph.OperatorID) Optional(java.util.Optional) CheckpointMetrics(org.apache.flink.runtime.checkpoint.CheckpointMetrics) SchedulerExecutionMode(org.apache.flink.configuration.SchedulerExecutionMode) NoResourceAvailableException(org.apache.flink.runtime.jobmanager.scheduler.NoResourceAvailableException) SchedulerBase(org.apache.flink.runtime.scheduler.SchedulerBase) SavepointFormatType(org.apache.flink.core.execution.SavepointFormatType) JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) SchedulerUtils(org.apache.flink.runtime.scheduler.SchedulerUtils) SlotAllocator(org.apache.flink.runtime.scheduler.adaptive.allocator.SlotAllocator) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) JobType(org.apache.flink.runtime.jobgraph.JobType) VertexParallelismInformation(org.apache.flink.runtime.scheduler.VertexParallelismInformation) JobVertexID(org.apache.flink.runtime.jobgraph.JobVertexID) JobException(org.apache.flink.runtime.JobException) DeploymentStateTimeMetrics(org.apache.flink.runtime.scheduler.metrics.DeploymentStateTimeMetrics) FatalErrorHandler(org.apache.flink.runtime.rpc.FatalErrorHandler) DefaultVertexParallelismInfo(org.apache.flink.runtime.scheduler.DefaultVertexParallelismInfo) ThrowingConsumer(org.apache.flink.util.function.ThrowingConsumer) Nonnull(javax.annotation.Nonnull) ArchivedExecutionGraph(org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph) ExecutionJobVertex(org.apache.flink.runtime.executiongraph.ExecutionJobVertex) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) Configuration(org.apache.flink.configuration.Configuration) CompletedCheckpointStore(org.apache.flink.runtime.checkpoint.CompletedCheckpointStore) LogicalSlot(org.apache.flink.runtime.jobmaster.LogicalSlot) AccumulatorSnapshot(org.apache.flink.runtime.accumulators.AccumulatorSnapshot) JobStatusListener(org.apache.flink.runtime.executiongraph.JobStatusListener) DeclineCheckpoint(org.apache.flink.runtime.messages.checkpoint.DeclineCheckpoint) ExecutionGraphInfo(org.apache.flink.runtime.scheduler.ExecutionGraphInfo) CheckpointRecoveryFactory(org.apache.flink.runtime.checkpoint.CheckpointRecoveryFactory) TimeUnit(java.util.concurrent.TimeUnit) WebOptions(org.apache.flink.configuration.WebOptions) ExecutionAttemptID(org.apache.flink.runtime.executiongraph.ExecutionAttemptID) DefaultVertexAttemptNumberStore(org.apache.flink.runtime.executiongraph.DefaultVertexAttemptNumberStore) Collections(java.util.Collections) OperatorEvent(org.apache.flink.runtime.operators.coordination.OperatorEvent) VertexParallelism(org.apache.flink.runtime.scheduler.adaptive.allocator.VertexParallelism) ExecutionGraph(org.apache.flink.runtime.executiongraph.ExecutionGraph) ArchivedExecutionGraph(org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph)

Example 3 with ComponentMainThreadExecutor

use of org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor in project flink by apache.

the class SchedulerBenchmarkUtils method createAndInitExecutionGraph.

public static ExecutionGraph createAndInitExecutionGraph(List<JobVertex> jobVertices, JobConfiguration jobConfiguration, ScheduledExecutorService scheduledExecutorService) throws Exception {
    final JobGraph jobGraph = createJobGraph(jobVertices, jobConfiguration);
    final ComponentMainThreadExecutor mainThreadExecutor = ComponentMainThreadExecutorServiceAdapter.forMainThread();
    final DefaultScheduler scheduler = SchedulerTestingUtils.createSchedulerBuilder(jobGraph, mainThreadExecutor).setIoExecutor(scheduledExecutorService).setFutureExecutor(scheduledExecutorService).setDelayExecutor(new ScheduledExecutorServiceAdapter(scheduledExecutorService)).build();
    return scheduler.getExecutionGraph();
}
Also used : JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) ComponentMainThreadExecutor(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor) ScheduledExecutorServiceAdapter(org.apache.flink.util.concurrent.ScheduledExecutorServiceAdapter) DefaultScheduler(org.apache.flink.runtime.scheduler.DefaultScheduler)

Example 4 with ComponentMainThreadExecutor

use of org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor in project flink by apache.

the class DeclarativeSlotPoolBridgeResourceDeclarationTest method testRequirementsDecreasedOnAllocationTimeout.

@Test
public void testRequirementsDecreasedOnAllocationTimeout() throws Exception {
    final ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
    try {
        ComponentMainThreadExecutor mainThreadExecutor = ComponentMainThreadExecutorServiceAdapter.forSingleThreadExecutor(scheduledExecutorService);
        declarativeSlotPoolBridge.start(jobMasterId, "localhost", mainThreadExecutor);
        // requesting the allocation of a new slot increases the requirements
        final CompletableFuture<PhysicalSlot> allocationFuture = CompletableFuture.supplyAsync(() -> declarativeSlotPoolBridge.requestNewAllocatedSlot(new SlotRequestId(), ResourceProfile.UNKNOWN, Time.milliseconds(5)), mainThreadExecutor).get();
        // waiting for the timeout
        assertThat(allocationFuture, FlinkMatchers.futureWillCompleteExceptionally(Duration.ofMinutes(1)));
        // when the allocation fails the requirements should be reduced (it is the users
        // responsibility to retry)
        CompletableFuture.runAsync(() -> assertThat(requirementListener.getRequirements().getResourceCount(ResourceProfile.UNKNOWN), is(0)), mainThreadExecutor).join();
    } finally {
        scheduledExecutorService.shutdown();
    }
}
Also used : SlotRequestId(org.apache.flink.runtime.jobmaster.SlotRequestId) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ComponentMainThreadExecutor(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor) Test(org.junit.Test)

Example 5 with ComponentMainThreadExecutor

use of org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor in project flink by apache.

the class DefaultSchedulerTest method testStatusMetrics.

@Test
public void testStatusMetrics() throws Exception {
    // running time acts as a stand-in for generic status time metrics
    final CompletableFuture<Gauge<Long>> runningTimeMetricFuture = new CompletableFuture<>();
    final MetricRegistry metricRegistry = TestingMetricRegistry.builder().setRegisterConsumer((metric, name, group) -> {
        switch(name) {
            case "runningTimeTotal":
                runningTimeMetricFuture.complete((Gauge<Long>) metric);
                break;
        }
    }).build();
    final JobGraph jobGraph = singleNonParallelJobVertexJobGraph();
    final JobVertex onlyJobVertex = getOnlyJobVertex(jobGraph);
    final Configuration configuration = new Configuration();
    configuration.set(MetricOptions.JOB_STATUS_METRICS, Arrays.asList(MetricOptions.JobStatusMetrics.TOTAL_TIME));
    final ComponentMainThreadExecutor singleThreadMainThreadExecutor = ComponentMainThreadExecutorServiceAdapter.forSingleThreadExecutor(scheduledExecutorService);
    final Time slotTimeout = Time.milliseconds(5L);
    final SlotPool slotPool = new DeclarativeSlotPoolBridgeBuilder().setBatchSlotTimeout(slotTimeout).buildAndStart(singleThreadMainThreadExecutor);
    final PhysicalSlotProvider slotProvider = new PhysicalSlotProviderImpl(LocationPreferenceSlotSelectionStrategy.createDefault(), slotPool);
    final DefaultScheduler scheduler = createSchedulerBuilder(jobGraph, singleThreadMainThreadExecutor).setJobMasterConfiguration(configuration).setJobManagerJobMetricGroup(JobManagerMetricGroup.createJobManagerMetricGroup(metricRegistry, "localhost").addJob(new JobID(), "jobName")).setExecutionSlotAllocatorFactory(SchedulerTestingUtils.newSlotSharingExecutionSlotAllocatorFactory(slotProvider, slotTimeout)).build();
    final AdaptiveSchedulerTest.SubmissionBufferingTaskManagerGateway taskManagerGateway = new AdaptiveSchedulerTest.SubmissionBufferingTaskManagerGateway(1);
    taskManagerGateway.setCancelConsumer(executionAttemptId -> {
        singleThreadMainThreadExecutor.execute(() -> scheduler.updateTaskExecutionState(new TaskExecutionState(executionAttemptId, ExecutionState.CANCELED)));
    });
    singleThreadMainThreadExecutor.execute(() -> {
        scheduler.startScheduling();
        offerSlots(slotPool, createSlotOffersForResourceRequirements(ResourceCounter.withResource(ResourceProfile.UNKNOWN, 1)), taskManagerGateway);
    });
    // wait for the first task submission
    taskManagerGateway.waitForSubmissions(1, Duration.ofSeconds(5));
    // sleep a bit to ensure uptime is > 0
    Thread.sleep(10L);
    final Gauge<Long> runningTimeGauge = runningTimeMetricFuture.get();
    Assert.assertThat(runningTimeGauge.getValue(), greaterThan(0L));
}
Also used : ManuallyTriggeredScheduledExecutor(org.apache.flink.util.concurrent.ManuallyTriggeredScheduledExecutor) Arrays(java.util.Arrays) ArchivedExecution(org.apache.flink.runtime.executiongraph.ArchivedExecution) TestMasterHook(org.apache.flink.runtime.checkpoint.hooks.TestMasterHook) Is(org.hamcrest.core.Is) ExceptionUtils.findThrowable(org.apache.flink.util.ExceptionUtils.findThrowable) ResultPartitionID(org.apache.flink.runtime.io.network.partition.ResultPartitionID) MetricRegistry(org.apache.flink.runtime.metrics.MetricRegistry) Duration(java.time.Duration) Matchers.nullValue(org.hamcrest.Matchers.nullValue) ClassRule(org.junit.ClassRule) TestingCheckpointRecoveryFactory(org.apache.flink.runtime.checkpoint.TestingCheckpointRecoveryFactory) SchedulingStrategyFactory(org.apache.flink.runtime.scheduler.strategy.SchedulingStrategyFactory) ScheduledExecutor(org.apache.flink.util.concurrent.ScheduledExecutor) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) PhysicalSlotProvider(org.apache.flink.runtime.jobmaster.slotpool.PhysicalSlotProvider) Set(java.util.Set) MetricOptions(org.apache.flink.configuration.MetricOptions) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) Matchers.contains(org.hamcrest.Matchers.contains) Assert.assertFalse(org.junit.Assert.assertFalse) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) Matchers.is(org.hamcrest.Matchers.is) Matchers.containsString(org.hamcrest.Matchers.containsString) Time(org.apache.flink.api.common.time.Time) RootExceptionHistoryEntry(org.apache.flink.runtime.scheduler.exceptionhistory.RootExceptionHistoryEntry) PipelinedRegionSchedulingStrategy(org.apache.flink.runtime.scheduler.strategy.PipelinedRegionSchedulingStrategy) FlinkException(org.apache.flink.util.FlinkException) ComponentMainThreadExecutor(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor) LocalTaskManagerLocation(org.apache.flink.runtime.taskmanager.LocalTaskManagerLocation) ResourceCounter(org.apache.flink.runtime.util.ResourceCounter) Callable(java.util.concurrent.Callable) JobStatus(org.apache.flink.api.common.JobStatus) TestFailoverStrategyFactory(org.apache.flink.runtime.executiongraph.utils.TestFailoverStrategyFactory) ArrayList(java.util.ArrayList) DirectScheduledExecutorService(org.apache.flink.runtime.testutils.DirectScheduledExecutorService) DeclarativeSlotPoolBridgeBuilder(org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridgeBuilder) Gauge(org.apache.flink.metrics.Gauge) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Matchers.hasSize(org.hamcrest.Matchers.hasSize) StreamSupport(java.util.stream.StreamSupport) Iterables(org.apache.flink.shaded.guava30.com.google.common.collect.Iterables) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) AdaptiveSchedulerTest(org.apache.flink.runtime.scheduler.adaptive.AdaptiveSchedulerTest) DistributionPattern(org.apache.flink.runtime.jobgraph.DistributionPattern) ArchivedExecutionVertex(org.apache.flink.runtime.executiongraph.ArchivedExecutionVertex) Before(org.junit.Before) ExecutionState(org.apache.flink.runtime.execution.ExecutionState) ErrorInfo(org.apache.flink.runtime.executiongraph.ErrorInfo) Assert.assertTrue(org.junit.Assert.assertTrue) CheckpointsCleaner(org.apache.flink.runtime.checkpoint.CheckpointsCleaner) Test(org.junit.Test) LocationPreferenceSlotSelectionStrategy(org.apache.flink.runtime.jobmaster.slotpool.LocationPreferenceSlotSelectionStrategy) SimpleAckingTaskManagerGateway(org.apache.flink.runtime.executiongraph.utils.SimpleAckingTaskManagerGateway) JobID(org.apache.flink.api.common.JobID) IsIterableWithSize(org.hamcrest.collection.IsIterableWithSize) SlotPoolTestUtils.offerSlots(org.apache.flink.runtime.jobmaster.slotpool.SlotPoolTestUtils.offerSlots) Assert(org.junit.Assert) ExecutionVertex(org.apache.flink.runtime.executiongraph.ExecutionVertex) JobManagerMetricGroup(org.apache.flink.runtime.metrics.groups.JobManagerMetricGroup) IsEmptyIterable(org.hamcrest.collection.IsEmptyIterable) Assert.assertEquals(org.junit.Assert.assertEquals) ComponentMainThreadExecutorServiceAdapter(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter) IsIterableContainingInOrder(org.hamcrest.collection.IsIterableContainingInOrder) TaskManagerLocation(org.apache.flink.runtime.taskmanager.TaskManagerLocation) ScheduledFuture(java.util.concurrent.ScheduledFuture) ExceptionUtils.findThrowableWithMessage(org.apache.flink.util.ExceptionUtils.findThrowableWithMessage) ScheduledTask(org.apache.flink.core.testutils.ScheduledTask) CheckpointCoordinator(org.apache.flink.runtime.checkpoint.CheckpointCoordinator) BiFunction(java.util.function.BiFunction) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) TestingLogicalSlotBuilder(org.apache.flink.runtime.jobmaster.TestingLogicalSlotBuilder) TestSchedulingStrategy(org.apache.flink.runtime.scheduler.strategy.TestSchedulingStrategy) After(org.junit.After) SchedulingTopology(org.apache.flink.runtime.scheduler.strategy.SchedulingTopology) TestLogger(org.apache.flink.util.TestLogger) Assert.fail(org.junit.Assert.fail) TestingShuffleMaster(org.apache.flink.runtime.shuffle.TestingShuffleMaster) CheckpointIDCounter(org.apache.flink.runtime.checkpoint.CheckpointIDCounter) AbstractInvokable(org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable) TestRestartBackoffTimeStrategy(org.apache.flink.runtime.executiongraph.failover.flip1.TestRestartBackoffTimeStrategy) ExecutionVertexID(org.apache.flink.runtime.scheduler.strategy.ExecutionVertexID) Preconditions(org.apache.flink.util.Preconditions) Collectors(java.util.stream.Collectors) ResourceProfile(org.apache.flink.runtime.clusterframework.types.ResourceProfile) ExecutorUtils(org.apache.flink.util.ExecutorUtils) PhysicalSlotProviderImpl(org.apache.flink.runtime.jobmaster.slotpool.PhysicalSlotProviderImpl) List(java.util.List) SchedulerTestingUtils.acknowledgePendingCheckpoint(org.apache.flink.runtime.scheduler.SchedulerTestingUtils.acknowledgePendingCheckpoint) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) StandaloneCheckpointIDCounter(org.apache.flink.runtime.checkpoint.StandaloneCheckpointIDCounter) FailoverStrategy(org.apache.flink.runtime.executiongraph.failover.flip1.FailoverStrategy) Matchers.equalTo(org.hamcrest.Matchers.equalTo) ExceptionHistoryEntryMatcher(org.apache.flink.runtime.scheduler.exceptionhistory.ExceptionHistoryEntryMatcher) RestartAllFailoverStrategy(org.apache.flink.runtime.executiongraph.failover.flip1.RestartAllFailoverStrategy) RestartPipelinedRegionFailoverStrategy(org.apache.flink.runtime.executiongraph.failover.flip1.RestartPipelinedRegionFailoverStrategy) NoResourceAvailableException(org.apache.flink.runtime.jobmanager.scheduler.NoResourceAvailableException) JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) ResultPartitionType(org.apache.flink.runtime.io.network.partition.ResultPartitionType) CompletableFuture(java.util.concurrent.CompletableFuture) JobVertexID(org.apache.flink.runtime.jobgraph.JobVertexID) TestingJobMasterPartitionTracker(org.apache.flink.runtime.io.network.partition.TestingJobMasterPartitionTracker) TestingMetricRegistry(org.apache.flink.runtime.metrics.util.TestingMetricRegistry) JobGraphTestUtils(org.apache.flink.runtime.jobgraph.JobGraphTestUtils) StandaloneCompletedCheckpointStore(org.apache.flink.runtime.checkpoint.StandaloneCompletedCheckpointStore) ExecutorService(java.util.concurrent.ExecutorService) ArchivedExecutionGraph(org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph) SlotPool(org.apache.flink.runtime.jobmaster.slotpool.SlotPool) Iterator(java.util.Iterator) Configuration(org.apache.flink.configuration.Configuration) CompletedCheckpointStore(org.apache.flink.runtime.checkpoint.CompletedCheckpointStore) LogicalSlot(org.apache.flink.runtime.jobmaster.LogicalSlot) DefaultDeclarativeSlotPoolTest.createSlotOffersForResourceRequirements(org.apache.flink.runtime.jobmaster.slotpool.DefaultDeclarativeSlotPoolTest.createSlotOffersForResourceRequirements) CheckpointRecoveryFactory(org.apache.flink.runtime.checkpoint.CheckpointRecoveryFactory) SchedulerTestingUtils.getCheckpointCoordinator(org.apache.flink.runtime.scheduler.SchedulerTestingUtils.getCheckpointCoordinator) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) WebOptions(org.apache.flink.configuration.WebOptions) ExecutionAttemptID(org.apache.flink.runtime.executiongraph.ExecutionAttemptID) SchedulingExecutionVertex(org.apache.flink.runtime.scheduler.strategy.SchedulingExecutionVertex) SchedulerTestingUtils.enableCheckpointing(org.apache.flink.runtime.scheduler.SchedulerTestingUtils.enableCheckpointing) TaskExecutionState(org.apache.flink.runtime.taskmanager.TaskExecutionState) Collections(java.util.Collections) TemporaryFolder(org.junit.rules.TemporaryFolder) NoOpInvokable(org.apache.flink.runtime.testtasks.NoOpInvokable) DeclarativeSlotPoolBridgeBuilder(org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridgeBuilder) Configuration(org.apache.flink.configuration.Configuration) MetricRegistry(org.apache.flink.runtime.metrics.MetricRegistry) TestingMetricRegistry(org.apache.flink.runtime.metrics.util.TestingMetricRegistry) Time(org.apache.flink.api.common.time.Time) AdaptiveSchedulerTest(org.apache.flink.runtime.scheduler.adaptive.AdaptiveSchedulerTest) TaskExecutionState(org.apache.flink.runtime.taskmanager.TaskExecutionState) Gauge(org.apache.flink.metrics.Gauge) SlotPool(org.apache.flink.runtime.jobmaster.slotpool.SlotPool) CompletableFuture(java.util.concurrent.CompletableFuture) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) PhysicalSlotProviderImpl(org.apache.flink.runtime.jobmaster.slotpool.PhysicalSlotProviderImpl) JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) ComponentMainThreadExecutor(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor) PhysicalSlotProvider(org.apache.flink.runtime.jobmaster.slotpool.PhysicalSlotProvider) JobID(org.apache.flink.api.common.JobID) AdaptiveSchedulerTest(org.apache.flink.runtime.scheduler.adaptive.AdaptiveSchedulerTest) Test(org.junit.Test)

Aggregations

ComponentMainThreadExecutor (org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor)11 JobGraph (org.apache.flink.runtime.jobgraph.JobGraph)5 LogicalSlot (org.apache.flink.runtime.jobmaster.LogicalSlot)5 CompletableFuture (java.util.concurrent.CompletableFuture)4 FlinkException (org.apache.flink.util.FlinkException)4 Test (org.junit.Test)4 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)3 ComponentMainThreadExecutorServiceAdapter (org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter)3 ExecutionState (org.apache.flink.runtime.execution.ExecutionState)3 JobVertex (org.apache.flink.runtime.jobgraph.JobVertex)3 Duration (java.time.Duration)2 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 Iterator (java.util.Iterator)2 List (java.util.List)2 ScheduledFuture (java.util.concurrent.ScheduledFuture)2 TimeUnit (java.util.concurrent.TimeUnit)2 TimeoutException (java.util.concurrent.TimeoutException)2 JobID (org.apache.flink.api.common.JobID)2 JobStatus (org.apache.flink.api.common.JobStatus)2