public class FederationJCache extends FederationCache
FederationCache.ApplicationHomeSubClusterCacheResponse, FederationCache.CacheRequest<K,V>, FederationCache.CacheResponse<R>, FederationCache.SubClusterInfoCacheResponse, FederationCache.SubClusterPolicyConfigurationCacheResponse
GET_APPLICATION_HOME_SUBCLUSTER_CACHEID, GET_POLICIES_CONFIGURATIONS_CACHEID, GET_SUBCLUSTERS_CACHEID, POINT
Constructor and Description |
---|
FederationJCache() |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
clear cache.
|
String |
getAppHomeSubClusterCacheKey(org.apache.hadoop.yarn.api.records.ApplicationId appId) |
SubClusterId |
getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId)
Returns the home
SubClusterId for the specified
ApplicationId . |
javax.cache.Cache<String,FederationCache.CacheRequest<String,?>> |
getCache() |
Map<String,SubClusterPolicyConfiguration> |
getPoliciesConfigurations()
Get the policies that is represented as
SubClusterPolicyConfiguration for all currently active queues in
the system. |
Map<SubClusterId,SubClusterInfo> |
getSubClusters(boolean filterInactiveSubClusters)
Returns the
SubClusterInfo of all active sub cluster(s). |
void |
initCache(org.apache.hadoop.conf.Configuration pConf,
FederationStateStore pStateStore)
Initialize the cache.
|
boolean |
isCachingEnabled()
Determine whether to enable cache.
|
void |
removeSubCluster(boolean flushCache)
Remove SubCluster from cache.
|
buildCacheKey, buildCacheKey, buildGetApplicationHomeSubClusterRequest, buildGetPoliciesConfigurationsCacheRequest, buildGetSubClustersCacheRequest, buildPolicyConfigMap, buildPolicyConfigMap, buildSubClusterInfoMap, buildSubClusterInfoMap, getStateStore, setStateStore
public boolean isCachingEnabled()
FederationCache
isCachingEnabled
in class FederationCache
public void initCache(org.apache.hadoop.conf.Configuration pConf, FederationStateStore pStateStore)
FederationCache
initCache
in class FederationCache
pConf
- Configuration.pStateStore
- FederationStateStore.public void clearCache()
FederationCache
clearCache
in class FederationCache
public Map<SubClusterId,SubClusterInfo> getSubClusters(boolean filterInactiveSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationCache
SubClusterInfo
of all active sub cluster(s).getSubClusters
in class FederationCache
filterInactiveSubClusters
- whether to filter out inactive
sub-clustersorg.apache.hadoop.yarn.exceptions.YarnException
- if the call to the state store is unsuccessfulpublic Map<String,SubClusterPolicyConfiguration> getPoliciesConfigurations() throws Exception
FederationCache
SubClusterPolicyConfiguration
for all currently active queues in
the system.getPoliciesConfigurations
in class FederationCache
org.apache.hadoop.yarn.exceptions.YarnException
- if the call to the state store is unsuccessfulException
public SubClusterId getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws Exception
FederationCache
SubClusterId
for the specified
ApplicationId
.getApplicationHomeSubCluster
in class FederationCache
appId
- the identifier of the applicationorg.apache.hadoop.yarn.exceptions.YarnException
- if the call to the state store is unsuccessfulException
public void removeSubCluster(boolean flushCache)
FederationCache
removeSubCluster
in class FederationCache
flushCache
- whether to filter out inactive
sub-clusters.@VisibleForTesting public javax.cache.Cache<String,FederationCache.CacheRequest<String,?>> getCache()
@VisibleForTesting public String getAppHomeSubClusterCacheKey(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnException
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.