@Transactional public class DefaultTaskExecutionService extends Object implements TaskExecutionService
TaskExecutionService interface. Provide service
methods for Tasks.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.cloud.dataflow.audit.service.AuditRecordService |
auditRecordService |
static String |
COMMAND_LINE_ARGS |
static String |
TASK_DEFINITION_DSL_TEXT |
static String |
TASK_DEPLOYMENT_PROPERTIES |
static String |
TASK_PLATFORM_NAME |
| Constructor and Description |
|---|
DefaultTaskExecutionService(LauncherRepository launcherRepository,
org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService,
org.springframework.cloud.task.repository.TaskRepository taskRepository,
TaskExecutionInfoService taskExecutionInfoService,
TaskDeploymentRepository taskDeploymentRepository,
TaskExecutionCreationService taskExecutionRepositoryService,
TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator,
org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
DataflowTaskExecutionDao dataflowTaskExecutionDao)
Initializes the
DefaultTaskExecutionService. |
| Modifier and Type | Method and Description |
|---|---|
long |
executeTask(String taskName,
Map<String,String> taskDeploymentProperties,
List<String> commandLineArgs)
Execute a task with the provided task name and optional runtime properties.
|
long |
executeTask(String taskName,
Map<String,String> taskDeploymentProperties,
List<String> commandLineArgs,
String composedTaskRunnerName)
Execute a task with the provided task name and optional runtime properties.
|
String |
getLog(String platformName,
String taskId)
Retrieve logs for the task application.
|
void |
stopTaskExecution(Set<Long> ids)
Request the platform to stop the task executions for the ids provided.
|
void |
stopTaskExecution(Set<Long> ids,
String platform)
Request the platform to stop the task executions for the ids provided.
|
protected void |
updateExternalExecutionId(long executionId,
String taskLaunchId) |
protected final org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService
public static final String TASK_DEFINITION_DSL_TEXT
public static final String TASK_DEPLOYMENT_PROPERTIES
public static final String COMMAND_LINE_ARGS
public static final String TASK_PLATFORM_NAME
public DefaultTaskExecutionService(LauncherRepository launcherRepository, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService, org.springframework.cloud.task.repository.TaskRepository taskRepository, TaskExecutionInfoService taskExecutionInfoService, TaskDeploymentRepository taskDeploymentRepository, TaskExecutionCreationService taskExecutionRepositoryService, TaskAppDeploymentRequestCreator taskAppDeploymentRequestCreator, org.springframework.cloud.task.repository.TaskExplorer taskExplorer, DataflowTaskExecutionDao dataflowTaskExecutionDao)
DefaultTaskExecutionService.launcherRepository - the repository of task launcher used to launch task apps.auditRecordService - the audit record servicetaskRepository - the repository to use for accessing and updating task executionstaskDeploymentRepository - the repository to track task deploymenttaskExecutionInfoService - the service used to setup a task executiontaskExecutionRepositoryService - the service used to create the task executionpublic long executeTask(String taskName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs, String composedTaskRunnerName)
TaskExecutionServiceexecuteTask in interface TaskExecutionServicetaskName - Name of the task. Must not be null or empty.taskDeploymentProperties - Optional deployment properties. Must not be null.commandLineArgs - Optional runtime commandline argumentcomposedTaskRunnerName - the name of the app the user would like to use if they don't want the default. If null default will be used.public long executeTask(String taskName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs)
TaskExecutionServiceexecuteTask in interface TaskExecutionServicetaskName - Name of the task. Must not be null or empty.taskDeploymentProperties - Optional deployment properties. Must not be null.commandLineArgs - Optional runtime commandline argumentpublic String getLog(String platformName, String taskId)
TaskExecutionServicegetLog in interface TaskExecutionServiceplatformName - the name of the platformtaskId - the ID that uniquely identifies the taskpublic void stopTaskExecution(Set<Long> ids)
TaskExecutionServicestopTaskExecution in interface TaskExecutionServiceids - a set of ids for the task executions to be stopped.public void stopTaskExecution(Set<Long> ids, String platform)
TaskExecutionServicestopTaskExecution in interface TaskExecutionServiceids - a set of ids for the task executions to be stopped.platform - The name of the platform where the tasks are executing.protected void updateExternalExecutionId(long executionId,
String taskLaunchId)
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.