Package com.atlassian.bamboo.storage
Interface StorageCappingService
- All Known Implementing Classes:
StorageCappingServiceImpl
@Internal
public interface StorageCappingService
- Since:
- 5.9
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Check if current disk space used by artifacts fits soft/hard limits.boolean
Check if hard limit fromAdministrationConfiguration.getStorageLimit()
is exceeded by local disk space usage.boolean
Check if soft limit fromAdministrationConfiguration.getStorageLimit()
is exceeded by local disk space usage.void
onArtifactUpdated
(@Nullable PlanResultKey cause, long artifactSizeDiff) Invalidate disk usage values, check soft/hard limit boundaries and send notifications.
-
Field Details
-
ARTIFACT_WITH_UNKNOWN_SIZE_REMOVED
static final long ARTIFACT_WITH_UNKNOWN_SIZE_REMOVED- See Also:
-
-
Method Details
-
isHardLimitExceeded
boolean isHardLimitExceeded()Check if hard limit fromAdministrationConfiguration.getStorageLimit()
is exceeded by local disk space usage.- Returns:
- false if feature is disabled or S3 artifact handler is enabled or disk usage is lower than hard limit
-
isSoftLimitExceeded
boolean isSoftLimitExceeded()Check if soft limit fromAdministrationConfiguration.getStorageLimit()
is exceeded by local disk space usage.- Returns:
- false if feature is disabled or S3 artifact handler is enabled or disk usage is lower than soft limit
-
onArtifactUpdated
Invalidate disk usage values, check soft/hard limit boundaries and send notifications. Call of this method can be expensive if artifact table is large.- Parameters:
cause
- planResultKey which caused artifact storage size recalculation. It will be ignored when cancel running plansartifactSizeDiff
- 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 useARTIFACT_WITH_UNKNOWN_SIZE_REMOVED
if size is unknown.
-
initializeStorageLimits
void initializeStorageLimits()Check if current disk space used by artifacts fits soft/hard limits.
-