Package com.github.ambry.config
Class StorageQuotaConfig
- java.lang.Object
-
- com.github.ambry.config.StorageQuotaConfig
-
public class StorageQuotaConfig extends java.lang.Object
Config for Storage Quota service.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BACKUP_FILE_DIR
java.lang.String
backupFileDir
The directory to store quota related backup files.static java.lang.String
CONTAINER_STORAGE_QUOTA_IN_JSON
java.lang.String
containerStorageQuotaInJson
A JSON string representing storage quota for all containers.static java.lang.String
ENFORCER_MODE
QuotaMode
enforcerMode
The quota mode to set for enforcer.static java.lang.String
MYSQL_MONTHLY_BASE_FETCH_OFFSET_SEC
static java.lang.String
MYSQL_STORE_RETRY_BACKOFF_MS
static java.lang.String
MYSQL_STORE_RETRY_MAX_COUNT
long
mysqlMonthlyBaseFetchOffsetSec
Offset in seconds to fetch container usage monthly base.long
mysqlStoreRetryBackoffMs
Duration in milliseconds to backoff if the mysql database query failed.int
mysqlStoreRetryMaxCount
Maximum retry times to execute a mysql database query.static java.lang.String
REFRESHER_POLLING_INTERVAL_MS
int
refresherPollingIntervalMs
The interval in milliseconds for refresher to refresh storage usage from its source.static java.lang.String
SOURCE_FACTORY
static java.lang.String
SOURCE_POLLING_INTERVAL_MS
java.lang.String
sourceFactory
int
sourcePollingIntervalMs
The interval in milliseconds for quota source to refresh each container's storage quota.static java.lang.String
STORAGE_QUOTA_PREFIX
-
Constructor Summary
Constructors Constructor Description StorageQuotaConfig(VerifiableProperties verifiableProperties)
Constructor to create aStorageQuotaConfig
.
-
-
-
Field Detail
-
STORAGE_QUOTA_PREFIX
public static final java.lang.String STORAGE_QUOTA_PREFIX
- See Also:
- Constant Field Values
-
REFRESHER_POLLING_INTERVAL_MS
public static final java.lang.String REFRESHER_POLLING_INTERVAL_MS
- See Also:
- Constant Field Values
-
SOURCE_FACTORY
public static final java.lang.String SOURCE_FACTORY
- See Also:
- Constant Field Values
-
CONTAINER_STORAGE_QUOTA_IN_JSON
public static final java.lang.String CONTAINER_STORAGE_QUOTA_IN_JSON
- See Also:
- Constant Field Values
-
SOURCE_POLLING_INTERVAL_MS
public static final java.lang.String SOURCE_POLLING_INTERVAL_MS
- See Also:
- Constant Field Values
-
BACKUP_FILE_DIR
public static final java.lang.String BACKUP_FILE_DIR
- See Also:
- Constant Field Values
-
MYSQL_MONTHLY_BASE_FETCH_OFFSET_SEC
public static final java.lang.String MYSQL_MONTHLY_BASE_FETCH_OFFSET_SEC
- See Also:
- Constant Field Values
-
MYSQL_STORE_RETRY_BACKOFF_MS
public static final java.lang.String MYSQL_STORE_RETRY_BACKOFF_MS
- See Also:
- Constant Field Values
-
MYSQL_STORE_RETRY_MAX_COUNT
public static final java.lang.String MYSQL_STORE_RETRY_MAX_COUNT
- See Also:
- Constant Field Values
-
ENFORCER_MODE
public static final java.lang.String ENFORCER_MODE
- See Also:
- Constant Field Values
-
refresherPollingIntervalMs
@Config("storage.quota.refresher.polling.interval.ms") @Default("30 * 60 * 1000") public final int refresherPollingIntervalMs
The interval in milliseconds for refresher to refresh storage usage from its source.
-
sourceFactory
@Config("storage.quota.source.factory") @Default("com.github.ambry.quota.storage.JSONStringStorageQuotaSourceFactory") public final java.lang.String sourceFactory
-
containerStorageQuotaInJson
@Config("storage.quota.container.storage.quota.in.json") @Default("") public final java.lang.String containerStorageQuotaInJson
A JSON string representing storage quota for all containers. eg: { "101": { "1": 1024000000, "2": 258438456 }, "102": { "1": 10737418240 } } The key of the top object is the acount id and the key of the inner object is the container id. The value of the each container id is the storage quota in bytes for this container. If the targeted container doesn't have a storage quota in this JSON string, it's up to StorageQuotaEnforcer to decide whether to allow uploads or not.
-
sourcePollingIntervalMs
@Config("storage.quota.source.polling.interval.ms") @Default("30 * 60 * 1000") public final int sourcePollingIntervalMs
The interval in milliseconds for quota source to refresh each container's storage quota.
-
backupFileDir
@Config("storage.quota.backup.file.dir") @Default("") public final java.lang.String backupFileDir
The directory to store quota related backup files. If empty, then backup files will be disabled.
-
mysqlStoreRetryBackoffMs
@Config("storage.quota.mysql.store.retry.backoff.ms") @Default("10*60*1000") public final long mysqlStoreRetryBackoffMs
Duration in milliseconds to backoff if the mysql database query failed.
-
mysqlStoreRetryMaxCount
@Config("storage.quota.mysql.store.retry.max.count") @Default("1") public final int mysqlStoreRetryMaxCount
Maximum retry times to execute a mysql database query.
-
mysqlMonthlyBaseFetchOffsetSec
@Config("storage.quota.mysql.monthly.base.fetch.offset.sec") @Default("60 * 60") public final long mysqlMonthlyBaseFetchOffsetSec
Offset in seconds to fetch container usage monthly base.
-
-
Constructor Detail
-
StorageQuotaConfig
public StorageQuotaConfig(VerifiableProperties verifiableProperties)
Constructor to create aStorageQuotaConfig
.- Parameters:
verifiableProperties
- TheVerifiableProperties
that contains all the properties.
-
-