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 void
afterCleanup(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_READY
orPersistTaskStage.TASK_READY
and returns its info if such a task should be processed by the current node ornull
otherwise.static int
getStageIndex(PersistTaskStage stage)
TaskInfo
getTaskInfo(Long taskId)
Map<Long,TaskInfo>
getTasksInfo(Collection<Long> ids)
List<TaskInfo>
getUnfinishedTasks(TaskType taskType)
void
markAsUpdated(long taskId)
long
newTask(String taskType, String description)
long
newTask(TaskType taskType, String description)
void
recreatePersistTasksStorageMonitor(long delay)
void
setStage(long taskId, PersistTaskStage stage)
void
setTimeService(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_READY
orPersistTaskStage.TASK_READY
and returns its info if such a task should be processed by the current node ornull
otherwise.
-
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:AfterBuildsCleanupExtension
Invoked 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:
afterCleanup
in interfaceAfterBuildsCleanupExtension
- Parameters:
cleanupState
- cleanup process state
-
getStageIndex
public static int getStageIndex(@NotNull PersistTaskStage stage)
-
-