@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,
DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao,
org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService,
TaskSaveService taskSaveService)
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)
Launch a task.
|
TaskManifest |
findTaskManifestById(Long id)
Retrieve the TaskManifest for the execution id provided
|
String |
getLog(String platformName,
String taskId)
Retrieve logs for the task application.
|
void |
setAutoCreateTaskDefinitions(boolean autoCreateTaskDefinitions) |
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) |
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
protected final org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService
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, DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao, org.springframework.cloud.common.security.core.support.OAuth2TokenUtilsService oauth2TokenUtilsService, TaskSaveService taskSaveService)
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 executiondataflowTaskExecutionMetadataDao - repository used to manipulate task manifestspublic long executeTask(String taskName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs, String composedTaskRunnerName)
executeTask in interface TaskExecutionServicetaskName - Name of the task definition or registered task application.
If a task definition does not exist, one will be created if `autoCreateTask-Definitions` is true. 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.public TaskManifest findTaskManifestById(Long id)
TaskExecutionServicefindTaskManifestById in interface TaskExecutionServiceid - task exectution idTaskManifest or null if not found.public void setAutoCreateTaskDefinitions(boolean autoCreateTaskDefinitions)
protected void updateExternalExecutionId(long executionId,
String taskLaunchId)
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.