Package com.atlassian.bamboo.storage
Class StorageCappingServiceImpl
java.lang.Object
com.atlassian.bamboo.storage.StorageCappingServiceImpl
- All Implemented Interfaces:
StorageCappingService
-
Field Summary
Fields inherited from interface com.atlassian.bamboo.storage.StorageCappingService
ARTIFACT_WITH_UNKNOWN_SIZE_REMOVED
-
Constructor 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 artifactSize) Invalidate disk usage values, check soft/hard limit boundaries and send notifications.
-
Constructor Details
-
StorageCappingServiceImpl
public StorageCappingServiceImpl()
-
-
Method Details
-
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
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
-