Interface CleanupProcessStateEx
-
- All Superinterfaces:
CleanupProcessState
- All Known Implementing Classes:
ServerCleanupState
public interface CleanupProcessStateEx extends CleanupProcessState
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
collectMetrics()
Returns true if cleanup process is expected to collect metrics.int
getCleanedByExtensionsBuildsCount()
Returns the total number of builds processed by all extensions withBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
methods.long
getCleanedFilesSize()
Returns the amount of bytes cleaned byBuildArtifactsCleaner
.CleanupDecisionListener
getCleanupDecisionListener()
Returns a listener for build-related clean-up reports.Set<String>
getDryRunBuildTypesIds()
NavigableMap<ExtensionError,Map<String,Pair<List<Long>,List<Long>>>>
getExtensionErrorsMap()
Returns an information about all exceptions that happened during cleanup extension call and about affected builds:
Error data -> affected build type id -> (ids of partly cleaned builds, ids of removed from history builds).
Map<BuildsCleanupExtension,Long>
getPerExtensionCleanupBuildsDataTime()
Returns the total time that was taken by all extensionsBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
methods.long
getStartTime()
Returns cleanup start time in millis.boolean
hasExtensionErrors()
Returnstrue
if there is an error happened during cleanup extensions call.boolean
isAnyProcessedBuildForLevel(CleanupLevel cleanupLevel)
Returnstrue
if there is at least one processed build at specified level,false
otherwise.boolean
isMainCleanupProcess()
Returns true if cleanup process is running as a part of the main cleanup process - which can be used by extensions to optimise cleanup behaviour.void
onCleanedFilesSize(long cleanedSize)
Adds the amount of bytes of cleaned files.void
onExtensionCleanupBuildsDataFinish(BuildsCleanupExtension extension, long cleanupTime)
Adds the time in milliseconds that was taken by theBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
method of this extension.void
onExtensionError(String extensionName, Collection<? extends SBuild> builds, String errorMessage, CleanupLevel level)
Stores an information about an error happened during the cleanup extension call and about affected builds.void
onExtensionPrepareBuildsDataFinish(BuildsCleanupExtension extension, long cleanupTime)
Adds the time in milliseconds that was taken by theBuildsCleanupExtension.prepareBuildsData(BuildCleanupContext)
method of this extension.void
onExtensionsCleanupBuildsDataFinish(int buildsCount)
Adds the number of builds processed by all enabled cleanup extensionsBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
method calls.void
reportBuildsProcessed(List<Long> buildIds, CleanupLevel cleanupLevel)
Sets ids of builds already processed by cleanupvoid
reportBuildsToProcess(int buildsCount)
Adds count of the builds scheduled for cleanup operationvoid
setCurrentStage(String stageDescription)
Sets description of current cleanup stagevoid
setInterrupted(InterruptReason reason)
Marks cleanup process is interrupted with specified reason.
ForInterruptReason.STOPPED_BY_USER
use methodsetInterruptedByUser(SUser)
!void
setInterruptedByUser(SUser user)
Marks cleanup process as interrupted by specified userboolean
useArtifactPatternsCache()
Returns true if cleanup process is expected to use cache of applied keep artifact patterns for particular builds.-
Methods inherited from interface jetbrains.buildServer.serverSide.cleanup.CleanupProcessState
getBuildsToProcess, getCurrentStage, getElapsedTime, getInterruptReason, getInterruptUser, getProcessedBuilds, getProcessedBuilds, getRemovedBuildTypesIds, getRemovedProjectsIds, isInProgress, isInterrupted, throwIfInterrupted
-
-
-
-
Method Detail
-
reportBuildsToProcess
void reportBuildsToProcess(int buildsCount)
Adds count of the builds scheduled for cleanup operation- Parameters:
buildsCount
- count of the builds scheduled for cleanup operation
-
reportBuildsProcessed
void reportBuildsProcessed(@NotNull List<Long> buildIds, @NotNull CleanupLevel cleanupLevel)
Sets ids of builds already processed by cleanup- Parameters:
buildIds
- ids of builds already processed by cleanup
-
isAnyProcessedBuildForLevel
boolean isAnyProcessedBuildForLevel(@NotNull CleanupLevel cleanupLevel)
Returnstrue
if there is at least one processed build at specified level,false
otherwise.
-
setCurrentStage
void setCurrentStage(@NotNull String stageDescription)
Sets description of current cleanup stage- Parameters:
stageDescription
- cleanup stage description
-
setInterrupted
void setInterrupted(@NotNull InterruptReason reason)
Marks cleanup process is interrupted with specified reason.
ForInterruptReason.STOPPED_BY_USER
use methodsetInterruptedByUser(SUser)
!- Parameters:
reason
- reason
-
setInterruptedByUser
void setInterruptedByUser(@NotNull SUser user)
Marks cleanup process as interrupted by specified user- Parameters:
user
- user who interrupted cleanup
-
isMainCleanupProcess
boolean isMainCleanupProcess()
Returns true if cleanup process is running as a part of the main cleanup process - which can be used by extensions to optimise cleanup behaviour.
-
useArtifactPatternsCache
boolean useArtifactPatternsCache()
Returns true if cleanup process is expected to use cache of applied keep artifact patterns for particular builds.
-
collectMetrics
boolean collectMetrics()
Returns true if cleanup process is expected to collect metrics.
-
getStartTime
long getStartTime()
Returns cleanup start time in millis.
-
onExtensionError
void onExtensionError(@NotNull String extensionName, @NotNull Collection<? extends SBuild> builds, @NotNull String errorMessage, @NotNull CleanupLevel level)
Stores an information about an error happened during the cleanup extension call and about affected builds.
-
hasExtensionErrors
boolean hasExtensionErrors()
Returnstrue
if there is an error happened during cleanup extensions call.- See Also:
getExtensionErrorsMap()
-
getExtensionErrorsMap
@NotNull NavigableMap<ExtensionError,Map<String,Pair<List<Long>,List<Long>>>> getExtensionErrorsMap()
Returns an information about all exceptions that happened during cleanup extension call and about affected builds:
Error data -> affected build type id -> (ids of partly cleaned builds, ids of removed from history builds).
-
onCleanedFilesSize
void onCleanedFilesSize(long cleanedSize)
Adds the amount of bytes of cleaned files.
-
getCleanedFilesSize
long getCleanedFilesSize()
Returns the amount of bytes cleaned byBuildArtifactsCleaner
. Artifacts cleaned in external repositories (like S3, Docker) are not taken into account.
-
onExtensionPrepareBuildsDataFinish
void onExtensionPrepareBuildsDataFinish(@NotNull BuildsCleanupExtension extension, long cleanupTime)
Adds the time in milliseconds that was taken by theBuildsCleanupExtension.prepareBuildsData(BuildCleanupContext)
method of this extension.
-
onExtensionCleanupBuildsDataFinish
void onExtensionCleanupBuildsDataFinish(@NotNull BuildsCleanupExtension extension, long cleanupTime)
Adds the time in milliseconds that was taken by theBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
method of this extension.
-
getPerExtensionCleanupBuildsDataTime
@NotNull Map<BuildsCleanupExtension,Long> getPerExtensionCleanupBuildsDataTime()
Returns the total time that was taken by all extensionsBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
methods.
-
onExtensionsCleanupBuildsDataFinish
void onExtensionsCleanupBuildsDataFinish(int buildsCount)
Adds the number of builds processed by all enabled cleanup extensionsBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
method calls. Expected to be "pack size" or lesser when we skip some builds that were processed during previous clean-up processes.
-
getCleanedByExtensionsBuildsCount
int getCleanedByExtensionsBuildsCount()
Returns the total number of builds processed by all extensions withBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)
methods.
-
getCleanupDecisionListener
CleanupDecisionListener getCleanupDecisionListener()
Returns a listener for build-related clean-up reports.
-
-