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
HELIX_PROPERTY_ROOT_PATH
java.lang.String
helixPropertyRootPath
The root path of helix property store in ZooKeeper for HelixStorageUsageRefresher.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_POLLING_INTERVAL_MS
int
sourcePollingIntervalMs
The interval in milliseconds for quota source to refresh each container's storage quota.static java.lang.String
STORAGE_QUOTA_PREFIX
static java.lang.String
ZK_CLIENT_CONNECT_ADDRESS
java.lang.String
zkClientConnectAddress
The ZooKeeper server address to connect to.
-
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
-
HELIX_PROPERTY_ROOT_PATH
public static final java.lang.String HELIX_PROPERTY_ROOT_PATH
- See Also:
- Constant Field Values
-
ZK_CLIENT_CONNECT_ADDRESS
public static final java.lang.String ZK_CLIENT_CONNECT_ADDRESS
- See Also:
- Constant Field Values
-
REFRESHER_POLLING_INTERVAL_MS
public static final java.lang.String REFRESHER_POLLING_INTERVAL_MS
- 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
-
helixPropertyRootPath
@Config("storage.quota.helix.property.root.path") @Default("") public final java.lang.String helixPropertyRootPath
The root path of helix property store in ZooKeeper for HelixStorageUsageRefresher. Must start with/
, and must not end with/
. The root path should be/{clustername}/PROPERTYSTORE
-
zkClientConnectAddress
@Config("storage.quota.zk.client.connect.address") @Default("") public final java.lang.String zkClientConnectAddress
The ZooKeeper server address to connect to. This config is required.
-
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.
-
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.
-
-