FederationGuavaCache, FederationJCachepublic abstract class FederationCache
extends java.lang.Object
| Modifier and Type | Class | 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 | Description |
|---|---|---|
protected static java.lang.String |
GET_APPLICATION_HOME_SUBCLUSTER_CACHEID |
|
protected static java.lang.String |
GET_POLICIES_CONFIGURATIONS_CACHEID |
|
protected static java.lang.String |
GET_SUBCLUSTERS_CACHEID |
|
protected static java.lang.String |
POINT |
| Constructor | Description |
|---|---|
FederationCache() |
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.String |
buildCacheKey(java.lang.String className,
java.lang.String methodName) |
Build CacheKey.
|
protected java.lang.String |
buildCacheKey(java.lang.String className,
java.lang.String methodName,
java.lang.String argName) |
Build CacheKey.
|
protected FederationCache.CacheRequest<java.lang.String,FederationCache.CacheResponse<SubClusterId>> |
buildGetApplicationHomeSubClusterRequest(java.lang.String cacheKey,
org.apache.hadoop.yarn.api.records.ApplicationId applicationId) |
Build GetApplicationHomeSubCluster CacheRequest.
|
protected FederationCache.CacheRequest<java.lang.String,FederationCache.CacheResponse<SubClusterPolicyConfiguration>> |
buildGetPoliciesConfigurationsCacheRequest(java.lang.String cacheKey) |
Build GetPoliciesConfigurations CacheRequest.
|
protected FederationCache.CacheRequest<java.lang.String,FederationCache.CacheResponse<SubClusterInfo>> |
buildGetSubClustersCacheRequest(java.lang.String cacheKey,
boolean filterInactiveSubClusters) |
Build GetSubClusters CacheRequest.
|
static java.util.Map<java.lang.String,SubClusterPolicyConfiguration> |
buildPolicyConfigMap(FederationCache.CacheRequest<java.lang.String,?> cacheRequest) |
According to the cacheRequest, build PolicyConfigMap.
|
static java.util.Map<java.lang.String,SubClusterPolicyConfiguration> |
buildPolicyConfigMap(GetSubClusterPoliciesConfigurationsResponse response) |
According to the response, build PolicyConfigMap.
|
static java.util.Map<SubClusterId,SubClusterInfo> |
buildSubClusterInfoMap(FederationCache.CacheRequest<java.lang.String,?> cacheRequest) |
According to the cacheRequest, build SubClusterInfoMap.
|
static java.util.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 java.util.Map<java.lang.String,SubClusterPolicyConfiguration> |
getPoliciesConfigurations() |
Get the policies that is represented as
SubClusterPolicyConfiguration for all currently active queues in
the system. |
FederationStateStore |
getStateStore() |
|
abstract java.util.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 java.lang.String GET_SUBCLUSTERS_CACHEID
protected static final java.lang.String GET_POLICIES_CONFIGURATIONS_CACHEID
protected static final java.lang.String GET_APPLICATION_HOME_SUBCLUSTER_CACHEID
protected static final java.lang.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 java.lang.String buildCacheKey(java.lang.String className,
java.lang.String methodName)
className - Cache Class Name.methodName - Method Name.protected java.lang.String buildCacheKey(java.lang.String className,
java.lang.String methodName,
java.lang.String argName)
className - Cache Class Name.methodName - Method Name.argName - ArgName.public abstract java.util.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 java.util.Map<java.lang.String,SubClusterPolicyConfiguration> getPoliciesConfigurations() throws java.lang.Exception
SubClusterPolicyConfiguration for all currently active queues in
the system.org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessfuljava.lang.Exceptionpublic abstract SubClusterId getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws java.lang.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 unsuccessfuljava.lang.Exceptionpublic abstract void removeSubCluster(boolean filterInactiveSubClusters)
filterInactiveSubClusters - whether to filter out inactive
sub-clusters.protected FederationCache.CacheRequest<java.lang.String,FederationCache.CacheResponse<SubClusterInfo>> buildGetSubClustersCacheRequest(java.lang.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 java.util.Map<SubClusterId,SubClusterInfo> buildSubClusterInfoMap(GetSubClustersInfoResponse response)
response - GetSubClustersInfoResponse.public static java.util.Map<SubClusterId,SubClusterInfo> buildSubClusterInfoMap(FederationCache.CacheRequest<java.lang.String,?> cacheRequest)
cacheRequest - CacheRequest.protected FederationCache.CacheRequest<java.lang.String,FederationCache.CacheResponse<SubClusterId>> buildGetApplicationHomeSubClusterRequest(java.lang.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<java.lang.String,FederationCache.CacheResponse<SubClusterPolicyConfiguration>> buildGetPoliciesConfigurationsCacheRequest(java.lang.String cacheKey) throws org.apache.hadoop.yarn.exceptions.YarnException
cacheKey - cacheKey.org.apache.hadoop.yarn.exceptions.YarnException - exceptions from yarn servers.public static java.util.Map<java.lang.String,SubClusterPolicyConfiguration> buildPolicyConfigMap(GetSubClusterPoliciesConfigurationsResponse response)
response - GetSubClusterPoliciesConfigurationsResponse.public static java.util.Map<java.lang.String,SubClusterPolicyConfiguration> buildPolicyConfigMap(FederationCache.CacheRequest<java.lang.String,?> cacheRequest)
cacheRequest - CacheRequest.public FederationStateStore getStateStore()
public void setStateStore(FederationStateStore stateStore)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.