Class FederationJCache
java.lang.Object
org.apache.hadoop.yarn.server.federation.cache.FederationCache
org.apache.hadoop.yarn.server.federation.cache.FederationJCache
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.yarn.server.federation.cache.FederationCache
FederationCache.ApplicationHomeSubClusterCacheResponse, FederationCache.CacheRequest<K,V>, FederationCache.CacheResponse<R>, FederationCache.SubClusterInfoCacheResponse, FederationCache.SubClusterPolicyConfigurationCacheResponse -
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.federation.cache.FederationCache
GET_APPLICATION_HOME_SUBCLUSTER_CACHEID, GET_POLICIES_CONFIGURATIONS_CACHEID, GET_SUBCLUSTERS_CACHEID, POINT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear cache.getAppHomeSubClusterCacheKey(org.apache.hadoop.yarn.api.records.ApplicationId appId) getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId) Returns the homeSubClusterIdfor the specifiedApplicationId.org.ehcache.Cache<String,FederationCache.CacheRequest> getCache()Get the policies that is represented asSubClusterPolicyConfigurationfor all currently active queues in the system.getSubClusters(boolean filterInactiveSubClusters) Returns theSubClusterInfoof all active sub cluster(s).voidinitCache(org.apache.hadoop.conf.Configuration pConf, FederationStateStore pStateStore) Initialize the cache.booleanDetermine whether to enable cache.voidremoveSubCluster(boolean flushCache) Remove SubCluster from cache.Methods inherited from class org.apache.hadoop.yarn.server.federation.cache.FederationCache
buildCacheKey, buildCacheKey, buildGetApplicationHomeSubClusterRequest, buildGetPoliciesConfigurationsCacheRequest, buildGetSubClustersCacheRequest, buildPolicyConfigMap, buildPolicyConfigMap, buildSubClusterInfoMap, buildSubClusterInfoMap, getStateStore, setStateStore
-
Constructor Details
-
FederationJCache
public FederationJCache()
-
-
Method Details
-
isCachingEnabled
public boolean isCachingEnabled()Description copied from class:FederationCacheDetermine 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:
isCachingEnabledin classFederationCache- Returns:
- true, enable cache; false, not enable cache.
-
initCache
Description copied from class:FederationCacheInitialize the cache.- Specified by:
initCachein classFederationCache- Parameters:
pConf- Configuration.pStateStore- FederationStateStore.
-
clearCache
public void clearCache()Description copied from class:FederationCacheclear cache.- Specified by:
clearCachein classFederationCache
-
getSubClusters
public Map<SubClusterId,SubClusterInfo> getSubClusters(boolean filterInactiveSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:FederationCacheReturns theSubClusterInfoof all active sub cluster(s).- Specified by:
getSubClustersin classFederationCache- 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
Description copied from class:FederationCacheGet the policies that is represented asSubClusterPolicyConfigurationfor all currently active queues in the system.- Specified by:
getPoliciesConfigurationsin classFederationCache- 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 unsuccessfulException
-
getApplicationHomeSubCluster
public SubClusterId getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws Exception Description copied from class:FederationCacheReturns the homeSubClusterIdfor the specifiedApplicationId.- Specified by:
getApplicationHomeSubClusterin classFederationCache- 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 unsuccessfulException
-
removeSubCluster
public void removeSubCluster(boolean flushCache) Description copied from class:FederationCacheRemove SubCluster from cache.- Specified by:
removeSubClusterin classFederationCache- Parameters:
flushCache- whether to filter out inactive sub-clusters.
-
getCache
-
getAppHomeSubClusterCacheKey
@VisibleForTesting public String getAppHomeSubClusterCacheKey(org.apache.hadoop.yarn.api.records.ApplicationId appId)
-