Search in sources :

Example 1 with TaskExecutor

use of org.apache.flink.runtime.taskexecutor.TaskExecutor in project flink by apache.

the class MiniCluster method startTaskManager.

/**
 * Starts additional TaskManager process.
 *
 * <p>When the MiniCluster starts up, it always starts {@link
 * MiniClusterConfiguration#getNumTaskManagers} TaskManagers. All TaskManagers are indexed from
 * 0 to the number of TaskManagers, started so far, minus one. This method starts a TaskManager
 * with the next index which is the number of TaskManagers, started so far. The index always
 * increases with each new started TaskManager. The indices of terminated TaskManagers are not
 * reused after {@link #terminateTaskManager(int)}.
 */
public void startTaskManager() throws Exception {
    synchronized (lock) {
        final Configuration configuration = miniClusterConfiguration.getConfiguration();
        final TaskExecutor taskExecutor = TaskManagerRunner.startTaskManager(configuration, new ResourceID(UUID.randomUUID().toString()), taskManagerRpcServiceFactory.createRpcService(), haServices, heartbeatServices, metricRegistry, blobCacheService, useLocalCommunication(), ExternalResourceInfoProvider.NO_EXTERNAL_RESOURCES, workingDirectory.createSubWorkingDirectory("tm_" + taskManagers.size()), taskManagerTerminatingFatalErrorHandlerFactory.create(taskManagers.size()));
        taskExecutor.start();
        taskManagers.add(taskExecutor);
    }
}
Also used : TaskExecutor(org.apache.flink.runtime.taskexecutor.TaskExecutor) MetricRegistryConfiguration(org.apache.flink.runtime.metrics.MetricRegistryConfiguration) Configuration(org.apache.flink.configuration.Configuration) ResourceID(org.apache.flink.runtime.clusterframework.types.ResourceID)

Aggregations

Configuration (org.apache.flink.configuration.Configuration)1 ResourceID (org.apache.flink.runtime.clusterframework.types.ResourceID)1 MetricRegistryConfiguration (org.apache.flink.runtime.metrics.MetricRegistryConfiguration)1 TaskExecutor (org.apache.flink.runtime.taskexecutor.TaskExecutor)1