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 booleancollectMetrics()Returns true if cleanup process is expected to collect metrics.intgetCleanedByExtensionsBuildsCount()Returns the total number of builds processed by all extensions withBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)methods.longgetCleanedFilesSize()Returns the amount of bytes cleaned byBuildArtifactsCleaner.CleanupDecisionListenergetCleanupDecisionListener()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.longgetStartTime()Returns cleanup start time in millis.booleanhasExtensionErrors()Returnstrueif there is an error happened during cleanup extensions call.booleanisAnyProcessedBuildForLevel(CleanupLevel cleanupLevel)Returnstrueif there is at least one processed build at specified level,falseotherwise.booleanisMainCleanupProcess()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.voidonCleanedFilesSize(long cleanedSize)Adds the amount of bytes of cleaned files.voidonExtensionCleanupBuildsDataFinish(BuildsCleanupExtension extension, long cleanupTime)Adds the time in milliseconds that was taken by theBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)method of this extension.voidonExtensionError(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.voidonExtensionPrepareBuildsDataFinish(BuildsCleanupExtension extension, long cleanupTime)Adds the time in milliseconds that was taken by theBuildsCleanupExtension.prepareBuildsData(BuildCleanupContext)method of this extension.voidonExtensionsCleanupBuildsDataFinish(int buildsCount)Adds the number of builds processed by all enabled cleanup extensionsBuildsCleanupExtension.cleanupBuildsData(jetbrains.buildServer.serverSide.cleanup.BuildCleanupContext)method calls.voidreportBuildsProcessed(List<Long> buildIds, CleanupLevel cleanupLevel)Sets ids of builds already processed by cleanupvoidreportBuildsToProcess(int buildsCount)Adds count of the builds scheduled for cleanup operationvoidsetCurrentStage(String stageDescription)Sets description of current cleanup stagevoidsetInterrupted(InterruptReason reason)Marks cleanup process is interrupted with specified reason.
ForInterruptReason.STOPPED_BY_USERuse methodsetInterruptedByUser(SUser)!voidsetInterruptedByUser(SUser user)Marks cleanup process as interrupted by specified userbooleanuseArtifactPatternsCache()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)Returnstrueif there is at least one processed build at specified level,falseotherwise.
-
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_USERuse 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()
Returnstrueif 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.
-
-