Class RouterQuotaManager
java.lang.Object
org.apache.hadoop.hdfs.server.federation.router.RouterQuotaManager
Router quota manager in Router. The manager maintains
RouterQuotaUsage cache of mount tables and do management
for the quota caches.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clean up the cache.getAll()Get all the mount quota paths.Get children paths (can include itself) under specified federation path.getQuotaUsage(String path) Get the nearest ancestor's quota usage, and meanwhile its quota was set.static booleanisQuotaSet(org.apache.hadoop.fs.QuotaUsage quota) Check if the quota was set.voidput(String path, RouterQuotaUsage quotaUsage) Put new entity into cache.voidRemove the entity from cache.voidupdateQuota(String path, RouterQuotaUsage quota) Update quota in cache.
-
Constructor Details
-
RouterQuotaManager
public RouterQuotaManager()
-
-
Method Details
-
getAll
Get all the mount quota paths.- Returns:
- All the mount quota paths.
-
getQuotaUsage
Get the nearest ancestor's quota usage, and meanwhile its quota was set.- Parameters:
path- The path being written.- Returns:
- RouterQuotaUsage Quota usage.
-
getPaths
Get children paths (can include itself) under specified federation path.- Parameters:
parentPath- Federated path.- Returns:
- Set of children paths.
-
put
Put new entity into cache.- Parameters:
path- Mount table path.quotaUsage- Corresponding cache value.
-
updateQuota
Update quota in cache. The usage will be preserved.- Parameters:
path- Mount table path.quota- Corresponding quota value.
-
remove
Remove the entity from cache.- Parameters:
path- Mount table path.
-
clear
public void clear()Clean up the cache. -
isQuotaSet
public static boolean isQuotaSet(org.apache.hadoop.fs.QuotaUsage quota) Check if the quota was set.- Parameters:
quota- the quota usage.- Returns:
- True if the quota is set.
-