Class RouterQuotaManager

java.lang.Object
org.apache.hadoop.hdfs.server.federation.router.RouterQuotaManager

public class RouterQuotaManager extends Object
Router quota manager in Router. The manager maintains RouterQuotaUsage cache of mount tables and do management for the quota caches.
  • Constructor Details

    • RouterQuotaManager

      public RouterQuotaManager()
  • Method Details

    • getAll

      public Set<String> getAll()
      Get all the mount quota paths.
      Returns:
      All the mount quota paths.
    • getQuotaUsage

      public RouterQuotaUsage getQuotaUsage(String path)
      Get the nearest ancestor's quota usage, and meanwhile its quota was set.
      Parameters:
      path - The path being written.
      Returns:
      RouterQuotaUsage Quota usage.
    • getPaths

      public Set<String> getPaths(String parentPath)
      Get children paths (can include itself) under specified federation path.
      Parameters:
      parentPath - Federated path.
      Returns:
      Set of children paths.
    • put

      public void put(String path, RouterQuotaUsage quotaUsage)
      Put new entity into cache.
      Parameters:
      path - Mount table path.
      quotaUsage - Corresponding cache value.
    • updateQuota

      public void updateQuota(String path, RouterQuotaUsage quota)
      Update quota in cache. The usage will be preserved.
      Parameters:
      path - Mount table path.
      quota - Corresponding quota value.
    • remove

      public void remove(String path)
      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.