Package com.atlassian.bamboo.storage
Class StorageCappingServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.storage.StorageCappingServiceImpl
-
- All Implemented Interfaces:
StorageCappingService
@Component public class StorageCappingServiceImpl extends Object implements StorageCappingService
-
-
Field Summary
-
Fields inherited from interface com.atlassian.bamboo.storage.StorageCappingService
ARTIFACT_WITH_UNKNOWN_SIZE_REMOVED
-
-
Constructor Summary
Constructors Constructor Description StorageCappingServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initializeStorageLimits()
Check if current disk space used by artifacts fits soft/hard limits.boolean
isHardLimitExceeded()
Check if hard limit fromAdministrationConfiguration.getStorageLimit()
is exceeded by local disk space usage.boolean
isSoftLimitExceeded()
Check if soft limit fromAdministrationConfiguration.getStorageLimit()
is exceeded by local disk space usage.void
onArtifactUpdated(@Nullable PlanResultKey cause, long artifactSize)
Invalidate disk usage values, check soft/hard limit boundaries and send notifications.
-
-
-
Method Detail
-
isHardLimitExceeded
public boolean isHardLimitExceeded()
Description copied from interface:StorageCappingService
Check if hard limit fromAdministrationConfiguration.getStorageLimit()
is exceeded by local disk space usage.- Specified by:
isHardLimitExceeded
in interfaceStorageCappingService
- Returns:
- false if feature is disabled or S3 artifact handler is enabled or disk usage is lower than hard limit
-
isSoftLimitExceeded
public boolean isSoftLimitExceeded()
Description copied from interface:StorageCappingService
Check if soft limit fromAdministrationConfiguration.getStorageLimit()
is exceeded by local disk space usage.- Specified by:
isSoftLimitExceeded
in interfaceStorageCappingService
- Returns:
- false if feature is disabled or S3 artifact handler is enabled or disk usage is lower than soft limit
-
onArtifactUpdated
public void onArtifactUpdated(@Nullable @Nullable PlanResultKey cause, long artifactSize)
Description copied from interface:StorageCappingService
Invalidate disk usage values, check soft/hard limit boundaries and send notifications. Call of this method can be expensive if artifact table is large.- Specified by:
onArtifactUpdated
in interfaceStorageCappingService
- Parameters:
cause
- planResultKey which caused artifact storage size recalculation. It will be ignored when cancel running plansartifactSize
- can be positive or negative. If artifact was created, use it's size. If size is unknown, use 0. If artifact was removed then use negative size (artifact_size*-1) or useStorageCappingService.ARTIFACT_WITH_UNKNOWN_SIZE_REMOVED
if size is unknown.
-
initializeStorageLimits
public void initializeStorageLimits()
Description copied from interface:StorageCappingService
Check if current disk space used by artifacts fits soft/hard limits.- Specified by:
initializeStorageLimits
in interfaceStorageCappingService
-
-