public class MapTaskExecutionDao extends Object implements TaskExecutionDao
Constructor and Description |
---|
MapTaskExecutionDao() |
Modifier and Type | Method and Description |
---|---|
void |
completeTaskExecution(long executionId,
Integer exitCode,
Date endTime,
String exitMessage)
Update and existing
TaskExecution . |
void |
completeTaskExecution(long executionId,
Integer exitCode,
Date endTime,
String exitMessage,
String errorMessage)
Update and existing
TaskExecution to mark it as completed. |
TaskExecution |
createTaskExecution(String taskName,
Date startTime,
List<String> arguments,
String externalExecutionId)
Save a new
TaskExecution . |
TaskExecution |
createTaskExecution(String taskName,
Date startTime,
List<String> arguments,
String externalExecutionId,
Long parentExecutionId)
Save a new
TaskExecution . |
org.springframework.data.domain.Page<TaskExecution> |
findAll(org.springframework.data.domain.Pageable pageable)
Retrieves all the task executions within the pageable constraints.
|
org.springframework.data.domain.Page<TaskExecution> |
findRunningTaskExecutions(String taskName,
org.springframework.data.domain.Pageable pageable)
Retrieves a set of task executions that are running for a taskName.
|
org.springframework.data.domain.Page<TaskExecution> |
findTaskExecutionsByName(String taskName,
org.springframework.data.domain.Pageable pageable)
Retrieves a subset of task executions by task name, start location and size.
|
ConcurrentMap<Long,Set<Long>> |
getBatchJobAssociations() |
Set<Long> |
getJobExecutionIdsByTaskExecutionId(long taskExecutionId)
Returns the job execution ids associated with a task execution id.
|
TaskExecution |
getLatestTaskExecutionForTaskName(String taskName)
Returns the latest task execution for a given task name.
|
List<TaskExecution> |
getLatestTaskExecutionsByTaskNames(String... taskNames)
Returns a
List of the latest TaskExecution for 1 or more task
names. |
long |
getNextExecutionId()
Retrieves the next available execution id for a task execution.
|
long |
getRunningTaskExecutionCount()
Retrieves current number of task executions with an endTime of null.
|
long |
getRunningTaskExecutionCountByTaskName(String taskName)
Retrieves current number of task executions for a taskName and with an endTime of
null.
|
TaskExecution |
getTaskExecution(long executionId)
Retrieves a task execution from the task repository.
|
long |
getTaskExecutionCount()
Retrieves current number of task executions.
|
long |
getTaskExecutionCountByTaskName(String taskName)
Retrieves current number of task executions for a taskName.
|
Long |
getTaskExecutionIdByJobExecutionId(long jobExecutionId)
Returns the id of the TaskExecution that the requested Spring Batch job execution
was executed within the context of.
|
Map<Long,TaskExecution> |
getTaskExecutions() |
List<String> |
getTaskNames()
Retrieves a sorted list of distinct task names for the task executions.
|
TaskExecution |
startTaskExecution(long executionId,
String taskName,
Date startTime,
List<String> arguments,
String externalExecutionid)
Update and existing
TaskExecution to mark it as started. |
TaskExecution |
startTaskExecution(long executionId,
String taskName,
Date startTime,
List<String> arguments,
String externalExecutionid,
Long parentExecutionId)
Update and existing
TaskExecution to mark it as started. |
void |
updateExternalExecutionId(long taskExecutionId,
String externalExecutionId)
Updates the externalExecutionId for the execution id specified.
|
public TaskExecution createTaskExecution(String taskName, Date startTime, List<String> arguments, String externalExecutionId)
TaskExecutionDao
TaskExecution
.createTaskExecution
in interface TaskExecutionDao
taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionId
- id assigned to the task by the platformTaskExecution
instance.public TaskExecution createTaskExecution(String taskName, Date startTime, List<String> arguments, String externalExecutionId, Long parentExecutionId)
TaskExecutionDao
TaskExecution
.createTaskExecution
in interface TaskExecutionDao
taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionId
- id assigned to the task by the platformparentExecutionId
- the parent task execution id.TaskExecution
instance.public TaskExecution startTaskExecution(long executionId, String taskName, Date startTime, List<String> arguments, String externalExecutionid)
TaskExecutionDao
TaskExecution
to mark it as started.startTaskExecution
in interface TaskExecutionDao
executionId
- the id of the taskExecution to be updated.taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionid
- id assigned to the task by the platformpublic TaskExecution startTaskExecution(long executionId, String taskName, Date startTime, List<String> arguments, String externalExecutionid, Long parentExecutionId)
TaskExecutionDao
TaskExecution
to mark it as started.startTaskExecution
in interface TaskExecutionDao
executionId
- the id of the taskExecution to be updated.taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionid
- id assigned to the task by the platformparentExecutionId
- the parent task execution id.public void completeTaskExecution(long executionId, Integer exitCode, Date endTime, String exitMessage, String errorMessage)
TaskExecutionDao
TaskExecution
to mark it as completed.completeTaskExecution
in interface TaskExecutionDao
executionId
- the id of the taskExecution to be updated.exitCode
- the status of the task upon completion.endTime
- the time the task completed.exitMessage
- the message assigned to the task upon completion.errorMessage
- error information available upon failure of a task.public void completeTaskExecution(long executionId, Integer exitCode, Date endTime, String exitMessage)
TaskExecutionDao
TaskExecution
.completeTaskExecution
in interface TaskExecutionDao
executionId
- the id of the taskExecution to be updated.exitCode
- the status of the task upon completion.endTime
- the time the task completed.exitMessage
- the message assigned to the task upon completion.public TaskExecution getTaskExecution(long executionId)
TaskExecutionDao
getTaskExecution
in interface TaskExecutionDao
executionId
- the id associated with the task execution.public long getTaskExecutionCountByTaskName(String taskName)
TaskExecutionDao
getTaskExecutionCountByTaskName
in interface TaskExecutionDao
taskName
- the name of the task to search for in the repository.public long getRunningTaskExecutionCountByTaskName(String taskName)
TaskExecutionDao
getRunningTaskExecutionCountByTaskName
in interface TaskExecutionDao
taskName
- the name of the task to search for in the repository.public long getRunningTaskExecutionCount()
TaskExecutionDao
getRunningTaskExecutionCount
in interface TaskExecutionDao
public long getTaskExecutionCount()
TaskExecutionDao
getTaskExecutionCount
in interface TaskExecutionDao
public org.springframework.data.domain.Page<TaskExecution> findRunningTaskExecutions(String taskName, org.springframework.data.domain.Pageable pageable)
TaskExecutionDao
findRunningTaskExecutions
in interface TaskExecutionDao
taskName
- the name of the task to search for in the repository.pageable
- the constraints for the search.public org.springframework.data.domain.Page<TaskExecution> findTaskExecutionsByName(String taskName, org.springframework.data.domain.Pageable pageable)
TaskExecutionDao
findTaskExecutionsByName
in interface TaskExecutionDao
taskName
- the name of the task to search for in the repository.pageable
- the constraints for the search.public List<String> getTaskNames()
TaskExecutionDao
getTaskNames
in interface TaskExecutionDao
public org.springframework.data.domain.Page<TaskExecution> findAll(org.springframework.data.domain.Pageable pageable)
TaskExecutionDao
findAll
in interface TaskExecutionDao
pageable
- the constraints for the searchpublic Map<Long,TaskExecution> getTaskExecutions()
public long getNextExecutionId()
TaskExecutionDao
getNextExecutionId
in interface TaskExecutionDao
public Long getTaskExecutionIdByJobExecutionId(long jobExecutionId)
TaskExecutionDao
getTaskExecutionIdByJobExecutionId
in interface TaskExecutionDao
jobExecutionId
- the id of the JobExecutionTaskExecution
public Set<Long> getJobExecutionIdsByTaskExecutionId(long taskExecutionId)
TaskExecutionDao
getJobExecutionIdsByTaskExecutionId
in interface TaskExecutionDao
taskExecutionId
- id of the TaskExecution
Set
of the ids of the job executions executed within the
task.public void updateExternalExecutionId(long taskExecutionId, String externalExecutionId)
TaskExecutionDao
updateExternalExecutionId
in interface TaskExecutionDao
taskExecutionId
- the execution id for the task to be updated.externalExecutionId
- the new externalExecutionId.public ConcurrentMap<Long,Set<Long>> getBatchJobAssociations()
public List<TaskExecution> getLatestTaskExecutionsByTaskNames(String... taskNames)
TaskExecutionDao
List
of the latest TaskExecution
for 1 or more task
names.
Latest is defined by the most recent start time. A TaskExecution
does not
have to be finished (The results may including pending TaskExecution
s).
It is theoretically possible that a TaskExecution
with the same name to
have more than 1 TaskExecution
for the exact same start time. In that case
the TaskExecution
with the highest Task Execution ID is returned.
This method will not consider end times in its calculations. Thus, when a task
execution A
starts after task execution B
but finishes BEFORE task
execution A
, then task execution B
is being returned.getLatestTaskExecutionsByTaskNames
in interface TaskExecutionDao
taskNames
- At least 1 task name must be providedpublic TaskExecution getLatestTaskExecutionForTaskName(String taskName)
TaskExecutionDao
TaskExecutionDao.getLatestTaskExecutionsByTaskNames(String...)
but will only return a single result.getLatestTaskExecutionForTaskName
in interface TaskExecutionDao
taskName
- Must not be null or emptyTaskExecutionDao.getLatestTaskExecutionsByTaskNames(String...)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.