Class FederationJCache

java.lang.Object
org.apache.hadoop.yarn.server.federation.cache.FederationCache
org.apache.hadoop.yarn.server.federation.cache.FederationJCache

public class FederationJCache extends FederationCache
  • Constructor Details

    • FederationJCache

      public FederationJCache()
  • Method Details

    • isCachingEnabled

      public boolean isCachingEnabled()
      Description copied from class: FederationCache
      Determine whether to enable cache. We judge whether to enable the cache according to the cache time. If the cache time is greater than 0, the cache is enabled. If the cache time is less than or equal 0, the cache is not enabled.
      Specified by:
      isCachingEnabled in class FederationCache
      Returns:
      true, enable cache; false, not enable cache.
    • initCache

      public void initCache(org.apache.hadoop.conf.Configuration pConf, FederationStateStore pStateStore)
      Description copied from class: FederationCache
      Initialize the cache.
      Specified by:
      initCache in class FederationCache
      Parameters:
      pConf - Configuration.
      pStateStore - FederationStateStore.
    • clearCache

      public void clearCache()
      Description copied from class: FederationCache
      clear cache.
      Specified by:
      clearCache in class FederationCache
    • getSubClusters

      public Map<SubClusterId,SubClusterInfo> getSubClusters(boolean filterInactiveSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from class: FederationCache
      Returns the SubClusterInfo of all active sub cluster(s).
      Specified by:
      getSubClusters in class FederationCache
      Parameters:
      filterInactiveSubClusters - whether to filter out inactive sub-clusters
      Returns:
      the information of all active sub cluster(s)
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful
    • getPoliciesConfigurations

      public Map<String,SubClusterPolicyConfiguration> getPoliciesConfigurations() throws Exception
      Description copied from class: FederationCache
      Get the policies that is represented as SubClusterPolicyConfiguration for all currently active queues in the system.
      Specified by:
      getPoliciesConfigurations in class FederationCache
      Returns:
      the policies for all currently active queues in the system
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful
      Exception
    • getApplicationHomeSubCluster

      public SubClusterId getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws Exception
      Description copied from class: FederationCache
      Returns the home SubClusterId for the specified ApplicationId.
      Specified by:
      getApplicationHomeSubCluster in class FederationCache
      Parameters:
      appId - the identifier of the application
      Returns:
      the home sub cluster identifier
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful
      Exception
    • removeSubCluster

      public void removeSubCluster(boolean flushCache)
      Description copied from class: FederationCache
      Remove SubCluster from cache.
      Specified by:
      removeSubCluster in class FederationCache
      Parameters:
      flushCache - whether to filter out inactive sub-clusters.
    • getCache

      @VisibleForTesting public org.ehcache.Cache<String,FederationCache.CacheRequest> getCache()
    • getAppHomeSubClusterCacheKey

      @VisibleForTesting public String getAppHomeSubClusterCacheKey(org.apache.hadoop.yarn.api.records.ApplicationId appId)