Package fr.gouv.vitam.common.storage
Class StorageThresholdsConfiguration
java.lang.Object
fr.gouv.vitam.common.storage.StorageThresholdsConfiguration
Storage saturation thresholds (platform-wide and per-tenant). The
sizeUnit applies to both
platformCapacity and every per-tenant threshold (defaults to BinarySizePlatformThreshold.SizeUnit.GIGABYTE).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglonglonglonglonglongsetCacheRefreshIntervalSeconds(long cacheRefreshIntervalSeconds) setDefaultTenantThreshold(long defaultTenantThreshold) setPlatformCapacity(long platformCapacity) setPlatformThresholdPercent(long platformThresholdPercent) setTenantThresholds(List<TenantThresholdConfiguration> tenantThresholds) longtoBytes(long size) Resolves a size expressed in the configuredsizeUnitto bytes.
-
Constructor Details
-
StorageThresholdsConfiguration
public StorageThresholdsConfiguration()
-
-
Method Details
-
getSizeUnit
-
setSizeUnit
-
getPlatformCapacity
public long getPlatformCapacity()- Returns:
- the configured platform capacity, expressed in
sizeUnit
-
setPlatformCapacity
- Parameters:
platformCapacity- the platform capacity, expressed insizeUnit- Returns:
- this
-
getPlatformCapacityBytes
public long getPlatformCapacityBytes()- Returns:
- the configured platform capacity resolved to bytes (
0when unset / saturation check disabled)
-
getPlatformThresholdPercent
public long getPlatformThresholdPercent() -
setPlatformThresholdPercent
-
getCacheRefreshIntervalSeconds
public long getCacheRefreshIntervalSeconds() -
setCacheRefreshIntervalSeconds
public StorageThresholdsConfiguration setCacheRefreshIntervalSeconds(long cacheRefreshIntervalSeconds) -
getDefaultTenantThreshold
public long getDefaultTenantThreshold()- Returns:
- the default per-tenant threshold, expressed in
sizeUnit
-
setDefaultTenantThreshold
-
getDefaultTenantThresholdBytes
public long getDefaultTenantThresholdBytes()- Returns:
- the default per-tenant threshold resolved to bytes (
0when unset / per-tenant default disabled)
-
getTenantThresholds
- Returns:
- the explicit per-tenant overrides (expressed in
sizeUnit), or null when none is configured
-
setTenantThresholds
public StorageThresholdsConfiguration setTenantThresholds(List<TenantThresholdConfiguration> tenantThresholds) -
toBytes
public long toBytes(long size) Resolves a size expressed in the configuredsizeUnitto bytes.- Parameters:
size- the size insizeUnit- Returns:
- the size resolved to bytes
-