Class PersistTasksStorage
- java.lang.Object
 - 
- jetbrains.buildServer.serverSide.impl.persisting.PersistTasksStorage
 
 
- 
- All Implemented Interfaces:
 AfterBuildsCleanupExtension,ServerExtension,TeamCityExtension
public class PersistTasksStorage extends Object implements AfterBuildsCleanupExtension
 
- 
- 
Constructor Summary
Constructors Constructor Description PersistTasksStorage(SQLRunnerEx sqlRunner, ServerResponsibility serverResponsibility, Heartbeat heartbeat, EventDispatcher<BuildServerListener> eventDispatcher, ServerMetrics serverMetrics) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterCleanup(CleanupProcessState cleanupState)Invoked upon finishing of the main cleanup process.List<TaskInfo>getNextReadyForExecutionTasks(String taskType, int maxTasksToReturn)List<TaskInfo>getNextReadyForExecutionTasks(TaskType taskType, int maxTasksToReturn)Searches for the next task with statesPersistTaskStage.PREPARE,PersistTaskStage.TASK_WITH_METADATA_READYorPersistTaskStage.TASK_READYand returns its info if such a task should be processed by the current node ornullotherwise.static intgetStageIndex(PersistTaskStage stage)TaskInfogetTaskInfo(Long taskId)Map<Long,TaskInfo>getTasksInfo(Collection<Long> ids)List<TaskInfo>getUnfinishedTasks(TaskType taskType)voidmarkAsUpdated(long taskId)longnewTask(String taskType, String description)longnewTask(TaskType taskType, String description)voidrecreatePersistTasksStorageMonitor(long delay)voidsetStage(long taskId, PersistTaskStage stage)voidsetTimeService(TimeService timeService) 
 - 
 
- 
- 
Constructor Detail
- 
PersistTasksStorage
public PersistTasksStorage(@NotNull SQLRunnerEx sqlRunner, @NotNull ServerResponsibility serverResponsibility, @NotNull Heartbeat heartbeat, @NotNull EventDispatcher<BuildServerListener> eventDispatcher, @NotNull ServerMetrics serverMetrics) 
 - 
 
- 
Method Detail
- 
recreatePersistTasksStorageMonitor
public void recreatePersistTasksStorageMonitor(long delay)
 
- 
setTimeService
public void setTimeService(@NotNull TimeService timeService) 
- 
setStage
public void setStage(long taskId, @NotNull PersistTaskStage stage) 
- 
markAsUpdated
public void markAsUpdated(long taskId)
 
- 
getNextReadyForExecutionTasks
@NotNull public List<TaskInfo> getNextReadyForExecutionTasks(@NotNull TaskType taskType, int maxTasksToReturn)
Searches for the next task with statesPersistTaskStage.PREPARE,PersistTaskStage.TASK_WITH_METADATA_READYorPersistTaskStage.TASK_READYand returns its info if such a task should be processed by the current node ornullotherwise. 
- 
getNextReadyForExecutionTasks
@NotNull public List<TaskInfo> getNextReadyForExecutionTasks(@NotNull String taskType, int maxTasksToReturn)
 
- 
getTasksInfo
@NotNull public Map<Long,TaskInfo> getTasksInfo(@NotNull Collection<Long> ids)
 
- 
afterCleanup
public void afterCleanup(@NotNull CleanupProcessState cleanupState)Description copied from interface:AfterBuildsCleanupExtensionInvoked upon finishing of the main cleanup process. At this point all data for specific builds is deleted.
Note: This extension might not be called for every cleanup run as cleanup process can be interrupted earlier. Extension must check cleanup process state and if it is interrupted, complete its operations and return as quick as possible.- Specified by:
 afterCleanupin interfaceAfterBuildsCleanupExtension- Parameters:
 cleanupState- cleanup process state
 
- 
getStageIndex
public static int getStageIndex(@NotNull PersistTaskStage stage) 
 - 
 
 -