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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck if current disk space used by artifacts fits soft/hard limits.booleanCheck if hard limit fromAdministrationConfiguration.getStorageLimit()is exceeded by local disk space usage.booleanCheck if soft limit fromAdministrationConfiguration.getStorageLimit()is exceeded by local disk space usage.voidonArtifactUpdated(@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:StorageCappingServiceCheck if hard limit fromAdministrationConfiguration.getStorageLimit()is exceeded by local disk space usage.- Specified by:
isHardLimitExceededin 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:StorageCappingServiceCheck if soft limit fromAdministrationConfiguration.getStorageLimit()is exceeded by local disk space usage.- Specified by:
isSoftLimitExceededin 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:StorageCappingServiceInvalidate 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:
onArtifactUpdatedin 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_REMOVEDif size is unknown.
-
initializeStorageLimits
public void initializeStorageLimits()Description copied from interface:StorageCappingServiceCheck if current disk space used by artifacts fits soft/hard limits.- Specified by:
initializeStorageLimitsin interfaceStorageCappingService
-