public abstract class FederationCache extends Object
Modifier and Type | Class and Description |
---|---|
class |
FederationCache.ApplicationHomeSubClusterCacheResponse |
class |
FederationCache.CacheRequest<K,V>
Internal class that encapsulates the cache key and a function that returns
the value for the specified key.
|
class |
FederationCache.CacheResponse<R> |
class |
FederationCache.SubClusterInfoCacheResponse |
class |
FederationCache.SubClusterPolicyConfigurationCacheResponse |
Modifier and Type | Field and Description |
---|---|
protected static String |
GET_APPLICATION_HOME_SUBCLUSTER_CACHEID |
protected static String |
GET_POLICIES_CONFIGURATIONS_CACHEID |
protected static String |
GET_SUBCLUSTERS_CACHEID |
protected static String |
POINT |
Constructor and Description |
---|
FederationCache() |
Modifier and Type | Method and Description |
---|---|
protected String |
buildCacheKey(String className,
String methodName)
Build CacheKey.
|
protected String |
buildCacheKey(String className,
String methodName,
String argName)
Build CacheKey.
|
protected FederationCache.CacheRequest<String,FederationCache.CacheResponse<SubClusterId>> |
buildGetApplicationHomeSubClusterRequest(String cacheKey,
org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
Build GetApplicationHomeSubCluster CacheRequest.
|
protected FederationCache.CacheRequest<String,FederationCache.CacheResponse<SubClusterPolicyConfiguration>> |
buildGetPoliciesConfigurationsCacheRequest(String cacheKey)
Build GetPoliciesConfigurations CacheRequest.
|
protected FederationCache.CacheRequest<String,FederationCache.CacheResponse<SubClusterInfo>> |
buildGetSubClustersCacheRequest(String cacheKey,
boolean filterInactiveSubClusters)
Build GetSubClusters CacheRequest.
|
static Map<String,SubClusterPolicyConfiguration> |
buildPolicyConfigMap(FederationCache.CacheRequest<String,?> cacheRequest)
According to the cacheRequest, build PolicyConfigMap.
|
static Map<String,SubClusterPolicyConfiguration> |
buildPolicyConfigMap(GetSubClusterPoliciesConfigurationsResponse response)
According to the response, build PolicyConfigMap.
|
static Map<SubClusterId,SubClusterInfo> |
buildSubClusterInfoMap(FederationCache.CacheRequest<String,?> cacheRequest)
According to the cacheRequest, build SubClusterInfoMap.
|
static Map<SubClusterId,SubClusterInfo> |
buildSubClusterInfoMap(GetSubClustersInfoResponse response)
According to the response, build SubClusterInfoMap.
|
abstract void |
clearCache()
clear cache.
|
abstract SubClusterId |
getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId)
Returns the home
SubClusterId for the specified
ApplicationId . |
abstract Map<String,SubClusterPolicyConfiguration> |
getPoliciesConfigurations()
Get the policies that is represented as
SubClusterPolicyConfiguration for all currently active queues in
the system. |
FederationStateStore |
getStateStore() |
abstract Map<SubClusterId,SubClusterInfo> |
getSubClusters(boolean filterInactiveSubClusters)
Returns the
SubClusterInfo of all active sub cluster(s). |
abstract void |
initCache(org.apache.hadoop.conf.Configuration pConf,
FederationStateStore pStateStore)
Initialize the cache.
|
abstract boolean |
isCachingEnabled()
Determine whether to enable cache.
|
abstract void |
removeSubCluster(boolean filterInactiveSubClusters)
Remove SubCluster from cache.
|
void |
setStateStore(FederationStateStore stateStore) |
protected static final String GET_SUBCLUSTERS_CACHEID
protected static final String GET_POLICIES_CONFIGURATIONS_CACHEID
protected static final String GET_APPLICATION_HOME_SUBCLUSTER_CACHEID
protected static final String POINT
public abstract boolean isCachingEnabled()
public abstract void initCache(org.apache.hadoop.conf.Configuration pConf, FederationStateStore pStateStore)
pConf
- Configuration.pStateStore
- FederationStateStore.public abstract void clearCache()
protected String buildCacheKey(String className, String methodName)
className
- Cache Class Name.methodName
- Method Name.protected String buildCacheKey(String className, String methodName, String argName)
className
- Cache Class Name.methodName
- Method Name.argName
- ArgName.public abstract Map<SubClusterId,SubClusterInfo> getSubClusters(boolean filterInactiveSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException
SubClusterInfo
of all active sub cluster(s).filterInactiveSubClusters
- whether to filter out inactive
sub-clustersorg.apache.hadoop.yarn.exceptions.YarnException
- if the call to the state store is unsuccessfulpublic abstract Map<String,SubClusterPolicyConfiguration> getPoliciesConfigurations() throws Exception
SubClusterPolicyConfiguration
for all currently active queues in
the system.org.apache.hadoop.yarn.exceptions.YarnException
- if the call to the state store is unsuccessfulException
public abstract SubClusterId getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws Exception
SubClusterId
for the specified
ApplicationId
.appId
- the identifier of the applicationorg.apache.hadoop.yarn.exceptions.YarnException
- if the call to the state store is unsuccessfulException
public abstract void removeSubCluster(boolean filterInactiveSubClusters)
filterInactiveSubClusters
- whether to filter out inactive
sub-clusters.protected FederationCache.CacheRequest<String,FederationCache.CacheResponse<SubClusterInfo>> buildGetSubClustersCacheRequest(String cacheKey, boolean filterInactiveSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException
cacheKey
- cacheKey.filterInactiveSubClusters
- filter Inactive SubClusters.org.apache.hadoop.yarn.exceptions.YarnException
- exceptions from yarn servers.public static Map<SubClusterId,SubClusterInfo> buildSubClusterInfoMap(GetSubClustersInfoResponse response)
response
- GetSubClustersInfoResponse.public static Map<SubClusterId,SubClusterInfo> buildSubClusterInfoMap(FederationCache.CacheRequest<String,?> cacheRequest)
cacheRequest
- CacheRequest.protected FederationCache.CacheRequest<String,FederationCache.CacheResponse<SubClusterId>> buildGetApplicationHomeSubClusterRequest(String cacheKey, org.apache.hadoop.yarn.api.records.ApplicationId applicationId) throws org.apache.hadoop.yarn.exceptions.YarnException
cacheKey
- cacheKey.applicationId
- applicationId.org.apache.hadoop.yarn.exceptions.YarnException
- exceptions from yarn servers.protected FederationCache.CacheRequest<String,FederationCache.CacheResponse<SubClusterPolicyConfiguration>> buildGetPoliciesConfigurationsCacheRequest(String cacheKey) throws org.apache.hadoop.yarn.exceptions.YarnException
cacheKey
- cacheKey.org.apache.hadoop.yarn.exceptions.YarnException
- exceptions from yarn servers.public static Map<String,SubClusterPolicyConfiguration> buildPolicyConfigMap(GetSubClusterPoliciesConfigurationsResponse response)
response
- GetSubClusterPoliciesConfigurationsResponse.public static Map<String,SubClusterPolicyConfiguration> buildPolicyConfigMap(FederationCache.CacheRequest<String,?> cacheRequest)
cacheRequest
- CacheRequest.public FederationStateStore getStateStore()
public void setStateStore(FederationStateStore stateStore)
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.