Search in sources :

Example 1 with WorkingDirectory

use of org.apache.flink.runtime.entrypoint.WorkingDirectory in project flink by apache.

the class TaskManagerRunner method startTaskManagerRunnerServices.

private void startTaskManagerRunnerServices() throws Exception {
    synchronized (lock) {
        rpcSystem = RpcSystem.load(configuration);
        this.executor = Executors.newScheduledThreadPool(Hardware.getNumberCPUCores(), new ExecutorThreadFactory("taskmanager-future"));
        highAvailabilityServices = HighAvailabilityServicesUtils.createHighAvailabilityServices(configuration, executor, AddressResolution.NO_ADDRESS_RESOLUTION, rpcSystem, this);
        JMXService.startInstance(configuration.getString(JMXServerOptions.JMX_SERVER_PORT));
        rpcService = createRpcService(configuration, highAvailabilityServices, rpcSystem);
        this.resourceId = getTaskManagerResourceID(configuration, rpcService.getAddress(), rpcService.getPort());
        this.workingDirectory = ClusterEntrypointUtils.createTaskManagerWorkingDirectory(configuration, resourceId);
        LOG.info("Using working directory: {}", workingDirectory);
        HeartbeatServices heartbeatServices = HeartbeatServices.fromConfiguration(configuration);
        metricRegistry = new MetricRegistryImpl(MetricRegistryConfiguration.fromConfiguration(configuration, rpcSystem.getMaximumMessageSizeInBytes(configuration)), ReporterSetup.fromConfiguration(configuration, pluginManager));
        final RpcService metricQueryServiceRpcService = MetricUtils.startRemoteMetricsRpcService(configuration, rpcService.getAddress(), configuration.getString(TaskManagerOptions.BIND_HOST), rpcSystem);
        metricRegistry.startQueryService(metricQueryServiceRpcService, resourceId.unwrap());
        blobCacheService = BlobUtils.createBlobCacheService(configuration, Reference.borrowed(workingDirectory.unwrap().getBlobStorageDirectory()), highAvailabilityServices.createBlobStore(), null);
        final ExternalResourceInfoProvider externalResourceInfoProvider = ExternalResourceUtils.createStaticExternalResourceInfoProviderFromConfig(configuration, pluginManager);
        taskExecutorService = taskExecutorServiceFactory.createTaskExecutor(this.configuration, this.resourceId.unwrap(), rpcService, highAvailabilityServices, heartbeatServices, metricRegistry, blobCacheService, false, externalResourceInfoProvider, workingDirectory.unwrap(), this);
        handleUnexpectedTaskExecutorServiceTermination();
        MemoryLogger.startIfConfigured(LOG, configuration, terminationFuture.thenAccept(ignored -> {
        }));
    }
}
Also used : ExecutorThreadFactory(org.apache.flink.util.concurrent.ExecutorThreadFactory) HeartbeatServices(org.apache.flink.runtime.heartbeat.HeartbeatServices) TaskExecutorBlobService(org.apache.flink.runtime.blob.TaskExecutorBlobService) Tuple2(org.apache.flink.api.java.tuple.Tuple2) Hardware(org.apache.flink.runtime.util.Hardware) RpcSystemUtils(org.apache.flink.runtime.rpc.RpcSystemUtils) LoggerFactory(org.slf4j.LoggerFactory) ExternalResourceUtils(org.apache.flink.runtime.externalresource.ExternalResourceUtils) LeaderRetrievalException(org.apache.flink.runtime.leaderretrieval.LeaderRetrievalException) ExceptionUtils(org.apache.flink.util.ExceptionUtils) LeaderRetrievalUtils(org.apache.flink.runtime.util.LeaderRetrievalUtils) ReporterSetup(org.apache.flink.runtime.metrics.ReporterSetup) InetAddress(java.net.InetAddress) MemoryLogger(org.apache.flink.runtime.taskmanager.MemoryLogger) StateChangelogStorageLoader(org.apache.flink.runtime.state.changelog.StateChangelogStorageLoader) MetricRegistry(org.apache.flink.runtime.metrics.MetricRegistry) FunctionUtils(org.apache.flink.util.function.FunctionUtils) Duration(java.time.Duration) SecurityUtils(org.apache.flink.runtime.security.SecurityUtils) TaskManagerOptionsInternal(org.apache.flink.configuration.TaskManagerOptionsInternal) Preconditions.checkNotNull(org.apache.flink.util.Preconditions.checkNotNull) AkkaOptions(org.apache.flink.configuration.AkkaOptions) HighAvailabilityServices(org.apache.flink.runtime.highavailability.HighAvailabilityServices) ExecutorThreadFactory(org.apache.flink.util.concurrent.ExecutorThreadFactory) AbstractID(org.apache.flink.util.AbstractID) Collection(java.util.Collection) JvmShutdownSafeguard(org.apache.flink.runtime.util.JvmShutdownSafeguard) HighAvailabilityServicesUtils(org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils) MetricUtils(org.apache.flink.runtime.metrics.util.MetricUtils) GuardedBy(javax.annotation.concurrent.GuardedBy) SecurityConfiguration(org.apache.flink.runtime.security.SecurityConfiguration) EnvironmentInformation(org.apache.flink.runtime.util.EnvironmentInformation) StringUtils(org.apache.flink.util.StringUtils) Executors(java.util.concurrent.Executors) HeartbeatServices(org.apache.flink.runtime.heartbeat.HeartbeatServices) ExecutorUtils(org.apache.flink.util.ExecutorUtils) JMXService(org.apache.flink.management.jmx.JMXService) MetricGroup(org.apache.flink.metrics.MetricGroup) FileSystem(org.apache.flink.core.fs.FileSystem) PluginManager(org.apache.flink.core.plugin.PluginManager) ConfigurationParserUtils(org.apache.flink.runtime.util.ConfigurationParserUtils) ClusterEntrypointUtils(org.apache.flink.runtime.entrypoint.ClusterEntrypointUtils) Time(org.apache.flink.api.common.time.Time) TaskExecutorPartitionTrackerImpl(org.apache.flink.runtime.io.network.partition.TaskExecutorPartitionTrackerImpl) FlinkException(org.apache.flink.util.FlinkException) MetricRegistryImpl(org.apache.flink.runtime.metrics.MetricRegistryImpl) CompletableFuture(java.util.concurrent.CompletableFuture) ShutdownHookUtil(org.apache.flink.util.ShutdownHookUtil) ArrayList(java.util.ArrayList) MetricRegistryConfiguration(org.apache.flink.runtime.metrics.MetricRegistryConfiguration) TaskManagerOptions(org.apache.flink.configuration.TaskManagerOptions) RpcService(org.apache.flink.runtime.rpc.RpcService) FutureUtils(org.apache.flink.util.concurrent.FutureUtils) ExternalResourceInfoProvider(org.apache.flink.runtime.externalresource.ExternalResourceInfoProvider) FatalErrorHandler(org.apache.flink.runtime.rpc.FatalErrorHandler) FlinkSecurityManager(org.apache.flink.core.security.FlinkSecurityManager) ResourceID(org.apache.flink.runtime.clusterframework.types.ResourceID) ExecutorService(java.util.concurrent.ExecutorService) TaskManagerExceptionUtils(org.apache.flink.util.TaskManagerExceptionUtils) Logger(org.slf4j.Logger) AutoCloseableAsync(org.apache.flink.util.AutoCloseableAsync) Configuration(org.apache.flink.configuration.Configuration) TaskManagerMetricGroup(org.apache.flink.runtime.metrics.groups.TaskManagerMetricGroup) IOException(java.io.IOException) Reference(org.apache.flink.util.Reference) RpcUtils(org.apache.flink.runtime.rpc.RpcUtils) SignalHandler(org.apache.flink.runtime.util.SignalHandler) UndeclaredThrowableException(java.lang.reflect.UndeclaredThrowableException) VisibleForTesting(org.apache.flink.annotation.VisibleForTesting) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) DeterminismEnvelope(org.apache.flink.runtime.entrypoint.DeterminismEnvelope) RpcSystem(org.apache.flink.runtime.rpc.RpcSystem) PluginUtils(org.apache.flink.core.plugin.PluginUtils) WorkingDirectory(org.apache.flink.runtime.entrypoint.WorkingDirectory) JMXServerOptions(org.apache.flink.configuration.JMXServerOptions) BlobCacheService(org.apache.flink.runtime.blob.BlobCacheService) AddressResolution(org.apache.flink.runtime.rpc.AddressResolution) BlobUtils(org.apache.flink.runtime.blob.BlobUtils) FlinkParseException(org.apache.flink.runtime.entrypoint.FlinkParseException) RpcService(org.apache.flink.runtime.rpc.RpcService) MetricRegistryImpl(org.apache.flink.runtime.metrics.MetricRegistryImpl) ExternalResourceInfoProvider(org.apache.flink.runtime.externalresource.ExternalResourceInfoProvider)

Example 2 with WorkingDirectory

use of org.apache.flink.runtime.entrypoint.WorkingDirectory in project flink by apache.

the class TaskExecutorRecoveryTest method testRecoveredTaskExecutorWillRestoreAllocationState.

@Test
public void testRecoveredTaskExecutorWillRestoreAllocationState(@TempDir File tempDir) throws Exception {
    final ResourceID resourceId = ResourceID.generate();
    final Configuration configuration = new Configuration();
    configuration.set(TaskManagerOptions.NUM_TASK_SLOTS, 2);
    configuration.set(CheckpointingOptions.LOCAL_RECOVERY, true);
    final TestingResourceManagerGateway testingResourceManagerGateway = new TestingResourceManagerGateway();
    final ArrayBlockingQueue<TaskExecutorSlotReport> queue = new ArrayBlockingQueue<>(2);
    testingResourceManagerGateway.setSendSlotReportFunction(slotReportInformation -> {
        queue.offer(TaskExecutorSlotReport.create(slotReportInformation.f0, slotReportInformation.f2));
        return CompletableFuture.completedFuture(Acknowledge.get());
    });
    final TestingRpcService rpcService = rpcServiceExtension.getTestingRpcService();
    rpcService.registerGateway(testingResourceManagerGateway.getAddress(), testingResourceManagerGateway);
    final JobID jobId = new JobID();
    final TestingHighAvailabilityServices highAvailabilityServices = new TestingHighAvailabilityServices();
    highAvailabilityServices.setResourceManagerLeaderRetriever(new SettableLeaderRetrievalService(testingResourceManagerGateway.getAddress(), testingResourceManagerGateway.getFencingToken().toUUID()));
    final SettableLeaderRetrievalService jobMasterLeaderRetriever = new SettableLeaderRetrievalService();
    highAvailabilityServices.setJobMasterLeaderRetriever(jobId, jobMasterLeaderRetriever);
    final WorkingDirectory workingDirectory = WorkingDirectory.create(tempDir);
    final TaskExecutor taskExecutor = TaskExecutorBuilder.newBuilder(rpcService, highAvailabilityServices, workingDirectory).setConfiguration(configuration).setResourceId(resourceId).build();
    taskExecutor.start();
    final TaskExecutorGateway taskExecutorGateway = taskExecutor.getSelfGateway(TaskExecutorGateway.class);
    final TaskExecutorSlotReport taskExecutorSlotReport = queue.take();
    final SlotReport slotReport = taskExecutorSlotReport.getSlotReport();
    assertThat(slotReport.getNumSlotStatus(), is(2));
    final SlotStatus slotStatus = slotReport.iterator().next();
    final SlotID allocatedSlotID = slotStatus.getSlotID();
    final AllocationID allocationId = new AllocationID();
    taskExecutorGateway.requestSlot(allocatedSlotID, jobId, allocationId, slotStatus.getResourceProfile(), "localhost", testingResourceManagerGateway.getFencingToken(), Time.seconds(10L)).join();
    taskExecutor.close();
    final BlockingQueue<Collection<SlotOffer>> offeredSlots = new ArrayBlockingQueue<>(1);
    final TestingJobMasterGateway jobMasterGateway = new TestingJobMasterGatewayBuilder().setOfferSlotsFunction((resourceID, slotOffers) -> {
        offeredSlots.offer(new HashSet<>(slotOffers));
        return CompletableFuture.completedFuture(slotOffers);
    }).build();
    rpcService.registerGateway(jobMasterGateway.getAddress(), jobMasterGateway);
    jobMasterLeaderRetriever.notifyListener(jobMasterGateway.getAddress(), jobMasterGateway.getFencingToken().toUUID());
    // recover the TaskExecutor
    final TaskExecutor recoveredTaskExecutor = TaskExecutorBuilder.newBuilder(rpcService, highAvailabilityServices, workingDirectory).setConfiguration(configuration).setResourceId(resourceId).build();
    recoveredTaskExecutor.start();
    final TaskExecutorSlotReport recoveredSlotReport = queue.take();
    for (SlotStatus status : recoveredSlotReport.getSlotReport()) {
        if (status.getSlotID().equals(allocatedSlotID)) {
            assertThat(status.getJobID(), is(jobId));
            assertThat(status.getAllocationID(), is(allocationId));
        } else {
            assertThat(status.getJobID(), is(nullValue()));
        }
    }
    final Collection<SlotOffer> take = offeredSlots.take();
    assertThat(take, hasSize(1));
    final SlotOffer offeredSlot = take.iterator().next();
    assertThat(offeredSlot.getAllocationId(), is(allocationId));
}
Also used : TestingRpcService(org.apache.flink.runtime.rpc.TestingRpcService) CompletableFuture(java.util.concurrent.CompletableFuture) EachCallbackWrapper(org.apache.flink.core.testutils.EachCallbackWrapper) TestingJobMasterGateway(org.apache.flink.runtime.jobmaster.utils.TestingJobMasterGateway) HashSet(java.util.HashSet) TestLoggerExtension(org.apache.flink.util.TestLoggerExtension) TaskManagerOptions(org.apache.flink.configuration.TaskManagerOptions) SettableLeaderRetrievalService(org.apache.flink.runtime.leaderretrieval.SettableLeaderRetrievalService) TestingRpcServiceExtension(org.apache.flink.runtime.rpc.TestingRpcServiceExtension) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) RegisterExtension(org.junit.jupiter.api.extension.RegisterExtension) Matchers.nullValue(org.hamcrest.Matchers.nullValue) SlotID(org.apache.flink.runtime.clusterframework.types.SlotID) TestingJobMasterGatewayBuilder(org.apache.flink.runtime.jobmaster.utils.TestingJobMasterGatewayBuilder) Matchers.hasSize(org.hamcrest.Matchers.hasSize) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) ResourceID(org.apache.flink.runtime.clusterframework.types.ResourceID) Collection(java.util.Collection) Configuration(org.apache.flink.configuration.Configuration) BlockingQueue(java.util.concurrent.BlockingQueue) Acknowledge(org.apache.flink.runtime.messages.Acknowledge) File(java.io.File) CheckpointingOptions(org.apache.flink.configuration.CheckpointingOptions) SlotOffer(org.apache.flink.runtime.taskexecutor.slot.SlotOffer) Test(org.junit.jupiter.api.Test) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) TestingResourceManagerGateway(org.apache.flink.runtime.resourcemanager.utils.TestingResourceManagerGateway) JobID(org.apache.flink.api.common.JobID) WorkingDirectory(org.apache.flink.runtime.entrypoint.WorkingDirectory) TempDir(org.junit.jupiter.api.io.TempDir) Matchers.is(org.hamcrest.Matchers.is) TestingHighAvailabilityServices(org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices) Time(org.apache.flink.api.common.time.Time) AllocationID(org.apache.flink.runtime.clusterframework.types.AllocationID) Configuration(org.apache.flink.configuration.Configuration) TestingHighAvailabilityServices(org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) ResourceID(org.apache.flink.runtime.clusterframework.types.ResourceID) SettableLeaderRetrievalService(org.apache.flink.runtime.leaderretrieval.SettableLeaderRetrievalService) TestingRpcService(org.apache.flink.runtime.rpc.TestingRpcService) TestingJobMasterGatewayBuilder(org.apache.flink.runtime.jobmaster.utils.TestingJobMasterGatewayBuilder) HashSet(java.util.HashSet) WorkingDirectory(org.apache.flink.runtime.entrypoint.WorkingDirectory) SlotOffer(org.apache.flink.runtime.taskexecutor.slot.SlotOffer) AllocationID(org.apache.flink.runtime.clusterframework.types.AllocationID) SlotID(org.apache.flink.runtime.clusterframework.types.SlotID) TestingJobMasterGateway(org.apache.flink.runtime.jobmaster.utils.TestingJobMasterGateway) TestingResourceManagerGateway(org.apache.flink.runtime.resourcemanager.utils.TestingResourceManagerGateway) Collection(java.util.Collection) JobID(org.apache.flink.api.common.JobID) Test(org.junit.jupiter.api.Test)

Example 3 with WorkingDirectory

use of org.apache.flink.runtime.entrypoint.WorkingDirectory in project flink by apache.

the class TaskExecutorBuilder method build.

public TaskExecutor build() throws Exception {
    final TaskExecutorBlobService resolvedTaskExecutorBlobService;
    TaskExecutorResourceUtils.adjustForLocalExecution(configuration);
    if (taskExecutorBlobService == null) {
        resolvedTaskExecutorBlobService = NoOpTaskExecutorBlobService.INSTANCE;
    } else {
        resolvedTaskExecutorBlobService = taskExecutorBlobService;
    }
    final TaskManagerConfiguration resolvedTaskManagerConfiguration;
    if (taskManagerConfiguration == null) {
        resolvedTaskManagerConfiguration = TaskManagerConfiguration.fromConfiguration(configuration, taskExecutorResourceSpec, rpcService.getAddress(), workingDirectory.getTmpDirectory());
    } else {
        resolvedTaskManagerConfiguration = taskManagerConfiguration;
    }
    final TaskManagerServices resolvedTaskManagerServices;
    if (taskManagerServices == null) {
        final TaskManagerServicesConfiguration taskManagerServicesConfiguration = TaskManagerServicesConfiguration.fromConfiguration(configuration, resourceId, rpcService.getAddress(), true, taskExecutorResourceSpec, workingDirectory);
        resolvedTaskManagerServices = TaskManagerServices.fromConfiguration(taskManagerServicesConfiguration, VoidPermanentBlobService.INSTANCE, UnregisteredMetricGroups.createUnregisteredTaskManagerMetricGroup(), Executors.newDirectExecutorService(), throwable -> {
        }, workingDirectory);
    } else {
        resolvedTaskManagerServices = taskManagerServices;
    }
    return new TaskExecutor(rpcService, resolvedTaskManagerConfiguration, haServices, resolvedTaskManagerServices, externalResourceInfoProvider, heartbeatServices, taskManagerMetricGroup, metricQueryServiceAddress, resolvedTaskExecutorBlobService, fatalErrorHandler, partitionTracker);
}
Also used : TaskExecutorBlobService(org.apache.flink.runtime.blob.TaskExecutorBlobService) VoidPermanentBlobService(org.apache.flink.runtime.blob.VoidPermanentBlobService) HighAvailabilityServices(org.apache.flink.runtime.highavailability.HighAvailabilityServices) Configuration(org.apache.flink.configuration.Configuration) NoOpTaskExecutorBlobService(org.apache.flink.runtime.blob.NoOpTaskExecutorBlobService) TestingTaskExecutorPartitionTracker(org.apache.flink.runtime.io.network.partition.TestingTaskExecutorPartitionTracker) TaskManagerMetricGroup(org.apache.flink.runtime.metrics.groups.TaskManagerMetricGroup) MemorySize(org.apache.flink.configuration.MemorySize) HeartbeatServices(org.apache.flink.runtime.heartbeat.HeartbeatServices) Executors(org.apache.flink.util.concurrent.Executors) UnregisteredMetricGroups(org.apache.flink.runtime.metrics.groups.UnregisteredMetricGroups) RpcService(org.apache.flink.runtime.rpc.RpcService) WorkingDirectory(org.apache.flink.runtime.entrypoint.WorkingDirectory) TaskExecutorPartitionTracker(org.apache.flink.runtime.io.network.partition.TaskExecutorPartitionTracker) ExternalResourceInfoProvider(org.apache.flink.runtime.externalresource.ExternalResourceInfoProvider) FatalErrorHandler(org.apache.flink.runtime.rpc.FatalErrorHandler) BlobCacheService(org.apache.flink.runtime.blob.BlobCacheService) ResourceID(org.apache.flink.runtime.clusterframework.types.ResourceID) NoOpFatalErrorHandler(org.apache.flink.runtime.rest.util.NoOpFatalErrorHandler) Collections(java.util.Collections) Nullable(javax.annotation.Nullable) CPUResource(org.apache.flink.api.common.resources.CPUResource) TaskExecutorBlobService(org.apache.flink.runtime.blob.TaskExecutorBlobService) NoOpTaskExecutorBlobService(org.apache.flink.runtime.blob.NoOpTaskExecutorBlobService)

Example 4 with WorkingDirectory

use of org.apache.flink.runtime.entrypoint.WorkingDirectory in project flink by apache.

the class TaskExecutorLocalStateStoresManagerTest method testCreationFromConfigDefault.

/**
 * This tests that the creation of {@link TaskManagerServices} correctly falls back to the first
 * tmp directory of the IOManager as default for the local state root directory.
 */
@Test
public void testCreationFromConfigDefault() throws Exception {
    final Configuration config = new Configuration();
    final WorkingDirectory workingDirectory = WORKING_DIRECTORY_RESOURCE.createNewWorkingDirectory();
    TaskManagerServicesConfiguration taskManagerServicesConfiguration = createTaskManagerServiceConfiguration(config, workingDirectory);
    TaskManagerServices taskManagerServices = createTaskManagerServices(taskManagerServicesConfiguration, workingDirectory);
    try {
        TaskExecutorLocalStateStoresManager taskStateManager = taskManagerServices.getTaskManagerStateStore();
        File[] localStateRootDirectories = taskStateManager.getLocalStateRootDirectories();
        for (int i = 0; i < localStateRootDirectories.length; ++i) {
            Assert.assertEquals(workingDirectory.getLocalStateDirectory(), localStateRootDirectories[i]);
        }
        Assert.assertFalse(taskStateManager.isLocalRecoveryEnabled());
    } finally {
        taskManagerServices.shutDown();
    }
}
Also used : WorkingDirectory(org.apache.flink.runtime.entrypoint.WorkingDirectory) Configuration(org.apache.flink.configuration.Configuration) TaskManagerServicesConfiguration(org.apache.flink.runtime.taskexecutor.TaskManagerServicesConfiguration) TaskManagerServices(org.apache.flink.runtime.taskexecutor.TaskManagerServices) TaskManagerServicesConfiguration(org.apache.flink.runtime.taskexecutor.TaskManagerServicesConfiguration) File(java.io.File) Test(org.junit.Test)

Example 5 with WorkingDirectory

use of org.apache.flink.runtime.entrypoint.WorkingDirectory in project flink by apache.

the class TaskExecutorLocalStateStoresManagerTest method testCreationFromConfig.

/**
 * This tests that the creation of {@link TaskManagerServices} correctly creates the local state
 * root directory for the {@link TaskExecutorLocalStateStoresManager} with the configured root
 * directory.
 */
@Test
public void testCreationFromConfig() throws Exception {
    final Configuration config = new Configuration();
    File newFolder = temporaryFolder.newFolder();
    String tmpDir = newFolder.getAbsolutePath() + File.separator;
    final String rootDirString = "__localStateRoot1,__localStateRoot2,__localStateRoot3".replaceAll("__", tmpDir);
    // test configuration of the local state directories
    config.setString(CheckpointingOptions.LOCAL_RECOVERY_TASK_MANAGER_STATE_ROOT_DIRS, rootDirString);
    // test configuration of the local state mode
    config.setBoolean(CheckpointingOptions.LOCAL_RECOVERY, true);
    final WorkingDirectory workingDirectory = WORKING_DIRECTORY_RESOURCE.createNewWorkingDirectory();
    TaskManagerServices taskManagerServices = createTaskManagerServices(createTaskManagerServiceConfiguration(config, workingDirectory), workingDirectory);
    try {
        TaskExecutorLocalStateStoresManager taskStateManager = taskManagerServices.getTaskManagerStateStore();
        // verify configured directories for local state
        String[] split = rootDirString.split(",");
        File[] rootDirectories = taskStateManager.getLocalStateRootDirectories();
        for (int i = 0; i < split.length; ++i) {
            assertThat(rootDirectories[i].toPath()).startsWith(Paths.get(split[i]));
        }
        // verify local recovery mode
        Assert.assertTrue(taskStateManager.isLocalRecoveryEnabled());
        for (File rootDirectory : rootDirectories) {
            FileUtils.deleteFileOrDirectory(rootDirectory);
        }
    } finally {
        taskManagerServices.shutDown();
    }
}
Also used : WorkingDirectory(org.apache.flink.runtime.entrypoint.WorkingDirectory) Configuration(org.apache.flink.configuration.Configuration) TaskManagerServicesConfiguration(org.apache.flink.runtime.taskexecutor.TaskManagerServicesConfiguration) TaskManagerServices(org.apache.flink.runtime.taskexecutor.TaskManagerServices) File(java.io.File) Test(org.junit.Test)

Aggregations

Configuration (org.apache.flink.configuration.Configuration)5 WorkingDirectory (org.apache.flink.runtime.entrypoint.WorkingDirectory)5 File (java.io.File)3 ResourceID (org.apache.flink.runtime.clusterframework.types.ResourceID)3 Collection (java.util.Collection)2 CompletableFuture (java.util.concurrent.CompletableFuture)2 Time (org.apache.flink.api.common.time.Time)2 TaskManagerOptions (org.apache.flink.configuration.TaskManagerOptions)2 BlobCacheService (org.apache.flink.runtime.blob.BlobCacheService)2 TaskExecutorBlobService (org.apache.flink.runtime.blob.TaskExecutorBlobService)2 TaskManagerServices (org.apache.flink.runtime.taskexecutor.TaskManagerServices)2 TaskManagerServicesConfiguration (org.apache.flink.runtime.taskexecutor.TaskManagerServicesConfiguration)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)1 InetAddress (java.net.InetAddress)1 Duration (java.time.Duration)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1