Class FederationStateStoreFacade
java.lang.Object
org.apache.hadoop.yarn.server.federation.utils.FederationStateStoreFacade
The FederationStateStoreFacade is an utility wrapper that provides singleton
access to the Federation state store. It abstracts out retries and in
addition, it also implements the caching for various objects.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, ApplicationHomeSubCluster homeSubCluster) Add ApplicationHomeSubCluster to FederationStateStore.addApplicationHomeSubCluster(ApplicationHomeSubCluster appHomeSubCluster) Adds the homeSubClusterIdfor the specifiedApplicationId.voidaddOrUpdateApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, SubClusterId subClusterId, int retryCount, org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext) Add or Update ApplicationHomeSubCluster.voidaddOrUpdateReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId, SubClusterId subClusterId, int retryCount) Add or Update ReservationHomeSubCluster.voidaddReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId, ReservationHomeSubCluster homeSubCluster) Save Reservation And HomeSubCluster Mapping.addReservationHomeSubCluster(ReservationHomeSubCluster appHomeSubCluster) Adds the homeSubClusterIdfor the specifiedReservationId.static <T> TcreateInstance(org.apache.hadoop.conf.Configuration conf, String configuredClassName, String defaultValue, Class<T> type) Helper method to create instances of Object using the class name specified in the configuration object.static <T> ObjectcreateRetryInstance(org.apache.hadoop.conf.Configuration conf, String configuredClassName, String defaultValue, Class<T> type, org.apache.hadoop.io.retry.RetryPolicy retryPolicy) Helper method to create instances of Object using the class name defined in the configuration object.static org.apache.hadoop.io.retry.RetryPolicycreateRetryPolicy(org.apache.hadoop.conf.Configuration conf) Create a RetryPolicy forFederationStateStoreFacade.voidvoiddeleteApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) Delete the mapping of homeSubClusterIdof a previously submittedApplicationId.voiddeletePolicyConfigurations(List<String> queuesList) voiddeleteReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId) Delete the homeSubClusterIdfor the specifiedReservationId.voidbooleanderegisterSubCluster(SubClusterId subClusterId, SubClusterState subClusterState) Deregister subCluster, Update the subCluster state to SC_LOST、SC_DECOMMISSIONED etc.booleanexistsApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) Query SubClusterId By applicationId.booleanexistsReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId) Exists ReservationHomeSubCluster Mapping.Get active subclusters.intGet the number of active cluster nodes.getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId) Returns the homeSubClusterIdfor the specifiedApplicationId.Get theApplicationHomeSubClusterlist representing the mapping of all submitted applications to it's home sub-cluster.org.apache.hadoop.yarn.api.records.ApplicationSubmissionContextgetApplicationSubmissionContext(org.apache.hadoop.yarn.api.records.ApplicationId appId) Get ApplicationSubmissionContext according to ApplicationId.org.apache.hadoop.conf.ConfigurationgetConf()Get the configuration.intGet CurrentKeyId from stateStore.intGet SeqNum from stateStore.static FederationStateStoreFacadeReturns the singleton instance of the FederationStateStoreFacade object.static FederationStateStoreFacadegetInstance(org.apache.hadoop.conf.Configuration conf) Returns the singleton instance of the FederationStateStoreFacade object.getMasterKeyByDelegationKey(org.apache.hadoop.security.token.delegation.DelegationKey newKey) The Router Supports GetMasterKeyByDelegationKey.Get the policies that is represented asSubClusterPolicyConfigurationfor all currently active queues in the system.getPolicyConfiguration(String queue) Returns theSubClusterPolicyConfigurationfor the specified queue.static SubClusterIdgetRandomActiveSubCluster(Map<SubClusterId, SubClusterInfo> activeSubClusters, List<SubClusterId> blackList) Randomly pick ActiveSubCluster.getReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId) Returns the homeSubClusterIdfor the specifiedReservationId.intgetRetryNumbers(int configRetries) Get the number of retries.getSubCluster(SubClusterId subClusterId) Returns theSubClusterInfofor the specifiedSubClusterId.getSubCluster(SubClusterId subClusterId, boolean flushCache) Updates the cache with the centralFederationStateStoreand returns theSubClusterInfofor the specifiedSubClusterId.Get the singleton instance of SubClusterResolver.getSubClusters(boolean filterInactiveSubClusters) Returns theSubClusterInfoof all active sub cluster(s).getSubClusters(boolean filterInactiveSubClusters, boolean flushCache) Updates the cache with the centralFederationStateStoreand returns theSubClusterInfoof all active sub cluster(s).getTokenByRouterStoreToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier) The Router Supports GetTokenByRouterStoreTokenRMDelegationTokenIdentifier.intstateStore provides CurrentKeyId increase.intstateStore provides DelegationTokenSeqNum increase.voidreinitialize(FederationStateStore store, org.apache.hadoop.conf.Configuration config) Delete and re-initialize the cache, to force it to use the given configuration.voidremoveStoredMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey newKey) The Router Supports Remove MasterKey (RouterMasterKeyRouterMasterKey).voidremoveStoredToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier) The Router Supports Remove RMDelegationTokenIdentifierRMDelegationTokenIdentifier.voidsetDelegationTokenSeqNum(int seqNum) Set SeqNum from stateStore.voidsetPolicyConfiguration(SubClusterPolicyConfiguration policyConf) Set a policy configuration into the state store.storeNewMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey newKey) The Router Supports Store NewMasterKey (RouterMasterKeyRouterMasterKey).voidstoreNewToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier, long renewDate) The Router Supports Store RMDelegationTokenIdentifierRMDelegationTokenIdentifier.voidstoreNewToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier, long renewDate, String tokenInfo) The Router Supports Store RMDelegationTokenIdentifierRMDelegationTokenIdentifier.voidupdateApplicationHomeSubCluster(ApplicationHomeSubCluster appHomeSubCluster) Updates the homeSubClusterIdfor the specifiedApplicationId.voidupdateApplicationHomeSubCluster(SubClusterId subClusterId, org.apache.hadoop.yarn.api.records.ApplicationId applicationId, ApplicationHomeSubCluster homeSubCluster) Update ApplicationHomeSubCluster to FederationStateStore.voidupdateReservationHomeSubCluster(ReservationHomeSubCluster appHomeSubCluster) Updates the homeSubClusterIdfor the specifiedReservationId.voidupdateReservationHomeSubCluster(SubClusterId subClusterId, org.apache.hadoop.yarn.api.records.ReservationId reservationId, ReservationHomeSubCluster homeSubCluster) Update Reservation And HomeSubCluster Mapping.voidupdateStoredToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier, long renewDate) The Router Supports Update RMDelegationTokenIdentifierRMDelegationTokenIdentifier.voidupdateStoredToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier, long renewDate, String tokenInfo) The Router Supports Update RMDelegationTokenIdentifierRMDelegationTokenIdentifier.
-
Method Details
-
reinitialize
@VisibleForTesting public void reinitialize(FederationStateStore store, org.apache.hadoop.conf.Configuration config) Delete and re-initialize the cache, to force it to use the given configuration.- Parameters:
store- theFederationStateStoreinstance to reinitialize withconfig- the updated configuration to reinitialize with
-
createRetryPolicy
public static org.apache.hadoop.io.retry.RetryPolicy createRetryPolicy(org.apache.hadoop.conf.Configuration conf) Create a RetryPolicy forFederationStateStoreFacade. In case of failure, it retries for:FederationStateStoreRetriableExceptionCacheLoaderException
- Parameters:
conf- the updated configuration- Returns:
- the RetryPolicy for FederationStateStoreFacade
-
getInstance
Returns the singleton instance of the FederationStateStoreFacade object.- Returns:
- the singleton
FederationStateStoreFacadeinstance
-
getInstance
Returns the singleton instance of the FederationStateStoreFacade object.- Parameters:
conf- configuration.- Returns:
- the singleton
FederationStateStoreFacadeinstance
-
getSubCluster
public SubClusterInfo getSubCluster(SubClusterId subClusterId) throws org.apache.hadoop.yarn.exceptions.YarnException Returns theSubClusterInfofor the specifiedSubClusterId.- Parameters:
subClusterId- the identifier of the sub-cluster- Returns:
- the sub cluster information, or
nullif there is no mapping for the subClusterId - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
getSubCluster
public SubClusterInfo getSubCluster(SubClusterId subClusterId, boolean flushCache) throws org.apache.hadoop.yarn.exceptions.YarnException Updates the cache with the centralFederationStateStoreand returns theSubClusterInfofor the specifiedSubClusterId.- Parameters:
subClusterId- the identifier of the sub-clusterflushCache- flag to indicate if the cache should be flushed or not- Returns:
- the sub cluster information
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
getSubClusters
public Map<SubClusterId,SubClusterInfo> getSubClusters(boolean filterInactiveSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException Returns theSubClusterInfoof all active sub cluster(s).- 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
-
getSubClusters
public Map<SubClusterId,SubClusterInfo> getSubClusters(boolean filterInactiveSubClusters, boolean flushCache) throws org.apache.hadoop.yarn.exceptions.YarnException Updates the cache with the centralFederationStateStoreand returns theSubClusterInfoof all active sub cluster(s).- Parameters:
filterInactiveSubClusters- whether to filter out inactive sub-clustersflushCache- flag to indicate if the cache should be flushed or not- Returns:
- the sub cluster information
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
getPolicyConfiguration
public SubClusterPolicyConfiguration getPolicyConfiguration(String queue) throws org.apache.hadoop.yarn.exceptions.YarnException Returns theSubClusterPolicyConfigurationfor the specified queue.- Parameters:
queue- the queue whose policy is required- Returns:
- the corresponding configured policy, or
nullif there is no mapping for the queue - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
setPolicyConfiguration
public void setPolicyConfiguration(SubClusterPolicyConfiguration policyConf) throws org.apache.hadoop.yarn.exceptions.YarnException Set a policy configuration into the state store.- Parameters:
policyConf- the policy configuration to set- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the request is invalid/fails
-
getPoliciesConfigurations
public Map<String,SubClusterPolicyConfiguration> getPoliciesConfigurations() throws org.apache.hadoop.yarn.exceptions.YarnExceptionGet the policies that is represented asSubClusterPolicyConfigurationfor all currently active queues in the system.- 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
-
addApplicationHomeSubCluster
public SubClusterId addApplicationHomeSubCluster(ApplicationHomeSubCluster appHomeSubCluster) throws org.apache.hadoop.yarn.exceptions.YarnException Adds the homeSubClusterIdfor the specifiedApplicationId.- Parameters:
appHomeSubCluster- the mapping of the application to it's home sub-cluster- Returns:
- the stored Subcluster from StateStore
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
updateApplicationHomeSubCluster
public void updateApplicationHomeSubCluster(ApplicationHomeSubCluster appHomeSubCluster) throws org.apache.hadoop.yarn.exceptions.YarnException Updates the homeSubClusterIdfor the specifiedApplicationId.- Parameters:
appHomeSubCluster- the mapping of the application to it's home sub-cluster- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
getApplicationHomeSubCluster
public SubClusterId getApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws org.apache.hadoop.yarn.exceptions.YarnException Returns the homeSubClusterIdfor the specifiedApplicationId.- 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
-
getSubClusterResolver
Get the singleton instance of SubClusterResolver.- Returns:
- SubClusterResolver instance
-
getConf
public org.apache.hadoop.conf.Configuration getConf()Get the configuration.- Returns:
- configuration object
-
addReservationHomeSubCluster
public SubClusterId addReservationHomeSubCluster(ReservationHomeSubCluster appHomeSubCluster) throws org.apache.hadoop.yarn.exceptions.YarnException Adds the homeSubClusterIdfor the specifiedReservationId.- Parameters:
appHomeSubCluster- the mapping of the reservation to it's home sub-cluster- Returns:
- the stored subCluster from StateStore
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
getReservationHomeSubCluster
public SubClusterId getReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId) throws org.apache.hadoop.yarn.exceptions.YarnException Returns the homeSubClusterIdfor the specifiedReservationId.- Parameters:
reservationId- the identifier of the reservation- Returns:
- the home subCluster identifier
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
updateReservationHomeSubCluster
public void updateReservationHomeSubCluster(ReservationHomeSubCluster appHomeSubCluster) throws org.apache.hadoop.yarn.exceptions.YarnException Updates the homeSubClusterIdfor the specifiedReservationId.- Parameters:
appHomeSubCluster- the mapping of the reservation to it's home sub-cluster- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
deleteReservationHomeSubCluster
public void deleteReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId) throws org.apache.hadoop.yarn.exceptions.YarnException Delete the homeSubClusterIdfor the specifiedReservationId.- Parameters:
reservationId- the identifier of the reservation- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful
-
createRetryInstance
public static <T> Object createRetryInstance(org.apache.hadoop.conf.Configuration conf, String configuredClassName, String defaultValue, Class<T> type, org.apache.hadoop.io.retry.RetryPolicy retryPolicy) Helper method to create instances of Object using the class name defined in the configuration object. The instances createsRetryProxyusing the specificRetryPolicy.- Type Parameters:
T- The type of the instance.- Parameters:
conf- the yarn configurationconfiguredClassName- the configuration provider keydefaultValue- the default implementation for fallbacktype- the class for which a retry proxy is requiredretryPolicy- the policy for retrying method call failures- Returns:
- a retry proxy for the specified interface
-
createInstance
public static <T> T createInstance(org.apache.hadoop.conf.Configuration conf, String configuredClassName, String defaultValue, Class<T> type) Helper method to create instances of Object using the class name specified in the configuration object.- Type Parameters:
T- The type of the instance to create- Parameters:
conf- the yarn configurationconfiguredClassName- the configuration provider keydefaultValue- the default implementation classtype- the required interface/base class- Returns:
- the instances created
-
getStateStore
-
storeNewMasterKey
public RouterMasterKeyResponse storeNewMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey newKey) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports Store NewMasterKey (RouterMasterKeyRouterMasterKey).- Parameters:
newKey- Key used for generating and verifying delegation tokens- Returns:
- RouterMasterKeyResponse
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessfulIOException- An IO Error occurred
-
removeStoredMasterKey
public void removeStoredMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey newKey) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports Remove MasterKey (RouterMasterKeyRouterMasterKey).- Parameters:
newKey- Key used for generating and verifying delegation tokens- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessfulIOException- An IO Error occurred
-
getMasterKeyByDelegationKey
public RouterMasterKeyResponse getMasterKeyByDelegationKey(org.apache.hadoop.security.token.delegation.DelegationKey newKey) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports GetMasterKeyByDelegationKey.- Parameters:
newKey- Key used for generating and verifying delegation tokens- Returns:
- RouterMasterKeyResponse
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessfulIOException- An IO Error occurred
-
storeNewToken
public void storeNewToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier, long renewDate) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports Store RMDelegationTokenIdentifierRMDelegationTokenIdentifier.- Parameters:
identifier- delegation tokens from the RMrenewDate- renewDate- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessfulIOException- An IO Error occurred
-
storeNewToken
public void storeNewToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier, long renewDate, String tokenInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports Store RMDelegationTokenIdentifierRMDelegationTokenIdentifier.- Parameters:
identifier- delegation tokens from the RM.renewDate- renewDate.tokenInfo- tokenInfo.- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful.IOException- An IO Error occurred.
-
updateStoredToken
public void updateStoredToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier, long renewDate) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports Update RMDelegationTokenIdentifierRMDelegationTokenIdentifier.- Parameters:
identifier- delegation tokens from the RMrenewDate- renewDate- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessfulIOException- An IO Error occurred
-
updateStoredToken
public void updateStoredToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier, long renewDate, String tokenInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports Update RMDelegationTokenIdentifierRMDelegationTokenIdentifier.- Parameters:
identifier- delegation tokens from the RMrenewDate- renewDatetokenInfo- tokenInfo.- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful.IOException- An IO Error occurred.
-
removeStoredToken
public void removeStoredToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports Remove RMDelegationTokenIdentifierRMDelegationTokenIdentifier.- Parameters:
identifier- delegation tokens from the RM- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessfulIOException- An IO Error occurred
-
getTokenByRouterStoreToken
public RouterRMTokenResponse getTokenByRouterStoreToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier identifier) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException The Router Supports GetTokenByRouterStoreTokenRMDelegationTokenIdentifier.- Parameters:
identifier- delegation tokens from the RM- Returns:
- RouterStoreToken
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessfulIOException- An IO Error occurred
-
incrementDelegationTokenSeqNum
public int incrementDelegationTokenSeqNum()stateStore provides DelegationTokenSeqNum increase.- Returns:
- delegationTokenSequenceNumber.
-
getDelegationTokenSeqNum
public int getDelegationTokenSeqNum()Get SeqNum from stateStore.- Returns:
- delegationTokenSequenceNumber.
-
setDelegationTokenSeqNum
public void setDelegationTokenSeqNum(int seqNum) Set SeqNum from stateStore.- Parameters:
seqNum- delegationTokenSequenceNumber.
-
getCurrentKeyId
public int getCurrentKeyId()Get CurrentKeyId from stateStore.- Returns:
- currentKeyId.
-
incrementCurrentKeyId
public int incrementCurrentKeyId()stateStore provides CurrentKeyId increase.- Returns:
- currentKeyId.
-
getActiveSubClustersCount
public int getActiveSubClustersCount() throws org.apache.hadoop.yarn.exceptions.YarnExceptionGet the number of active cluster nodes.- Returns:
- number of active cluster nodes.
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the call to the state store is unsuccessful.
-
getRandomActiveSubCluster
public static SubClusterId getRandomActiveSubCluster(Map<SubClusterId, SubClusterInfo> activeSubClusters, List<SubClusterId> blackList) throws org.apache.hadoop.yarn.exceptions.YarnExceptionRandomly pick ActiveSubCluster. During the selection process, we will exclude SubClusters from the blacklist.- Parameters:
activeSubClusters- List of active subClusters.blackList- blacklist.- Returns:
- Active SubClusterId.
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- When there is no Active SubCluster, an exception will be thrown (No active SubCluster available to submit the request.)
-
getRetryNumbers
public int getRetryNumbers(int configRetries) throws org.apache.hadoop.yarn.exceptions.YarnException Get the number of retries.- Parameters:
configRetries- User-configured number of retries.- Returns:
- number of retries.
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- yarn exception.
-
existsApplicationHomeSubCluster
public boolean existsApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) Query SubClusterId By applicationId. If SubClusterId is not empty, it means it exists and returns true; if SubClusterId is empty, it means it does not exist and returns false.- Parameters:
applicationId- applicationId- Returns:
- true, SubClusterId exists; false, SubClusterId not exists.
-
addApplicationHomeSubCluster
public void addApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, ApplicationHomeSubCluster homeSubCluster) throws org.apache.hadoop.yarn.exceptions.YarnException Add ApplicationHomeSubCluster to FederationStateStore.- Parameters:
applicationId- applicationId.homeSubCluster- homeSubCluster, homeSubCluster selected according to policy.- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- yarn exception.
-
getApplicationsHomeSubCluster
public List<ApplicationHomeSubCluster> getApplicationsHomeSubCluster() throws org.apache.hadoop.yarn.exceptions.YarnExceptionGet theApplicationHomeSubClusterlist representing the mapping of all submitted applications to it's home sub-cluster.- Returns:
- the mapping of all submitted application to it's home sub-cluster
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the request is invalid/fails
-
deleteApplicationHomeSubCluster
public void deleteApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId) throws org.apache.hadoop.yarn.exceptions.YarnException Delete the mapping of homeSubClusterIdof a previously submittedApplicationId. Currently response is empty if the operation is successful, if not an exception reporting reason for a failure.- Parameters:
applicationId- the application to delete the home sub-cluster of- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the request is invalid/fails
-
updateApplicationHomeSubCluster
public void updateApplicationHomeSubCluster(SubClusterId subClusterId, org.apache.hadoop.yarn.api.records.ApplicationId applicationId, ApplicationHomeSubCluster homeSubCluster) throws org.apache.hadoop.yarn.exceptions.YarnException Update ApplicationHomeSubCluster to FederationStateStore.- Parameters:
subClusterId- homeSubClusterIdapplicationId- applicationId.homeSubCluster- homeSubCluster, homeSubCluster selected according to policy.- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- yarn exception.
-
addOrUpdateApplicationHomeSubCluster
public void addOrUpdateApplicationHomeSubCluster(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, SubClusterId subClusterId, int retryCount, org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext) throws org.apache.hadoop.yarn.exceptions.YarnException Add or Update ApplicationHomeSubCluster.- Parameters:
applicationId- applicationId, is the id of the application.subClusterId- homeSubClusterId, this is selected by strategy.retryCount- number of retries.appSubmissionContext- appSubmissionContext.- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- yarn exception.
-
existsReservationHomeSubCluster
public boolean existsReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId) Exists ReservationHomeSubCluster Mapping.- Parameters:
reservationId- reservationId- Returns:
- true - exist, false - not exist
-
addReservationHomeSubCluster
public void addReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId, ReservationHomeSubCluster homeSubCluster) throws org.apache.hadoop.yarn.exceptions.YarnException Save Reservation And HomeSubCluster Mapping.- Parameters:
reservationId- reservationIdhomeSubCluster- homeSubCluster- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- on failure
-
updateReservationHomeSubCluster
public void updateReservationHomeSubCluster(SubClusterId subClusterId, org.apache.hadoop.yarn.api.records.ReservationId reservationId, ReservationHomeSubCluster homeSubCluster) throws org.apache.hadoop.yarn.exceptions.YarnException Update Reservation And HomeSubCluster Mapping.- Parameters:
subClusterId- subClusterIdreservationId- reservationIdhomeSubCluster- homeSubCluster- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- on failure
-
addOrUpdateReservationHomeSubCluster
public void addOrUpdateReservationHomeSubCluster(org.apache.hadoop.yarn.api.records.ReservationId reservationId, SubClusterId subClusterId, int retryCount) throws org.apache.hadoop.yarn.exceptions.YarnException Add or Update ReservationHomeSubCluster.- Parameters:
reservationId- reservationId.subClusterId- homeSubClusterId, this is selected by strategy.retryCount- number of retries.- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- yarn exception.
-
deregisterSubCluster
public boolean deregisterSubCluster(SubClusterId subClusterId, SubClusterState subClusterState) throws org.apache.hadoop.yarn.exceptions.YarnException Deregister subCluster, Update the subCluster state to SC_LOST、SC_DECOMMISSIONED etc.- Parameters:
subClusterId- subClusterId.subClusterState- The state of the subCluster to be updated.- Returns:
- If Deregister subCluster is successful, return true, otherwise, return false.
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- yarn exception.
-
getActiveSubClusters
public Collection<SubClusterInfo> getActiveSubClusters() throws org.apache.hadoop.yarn.webapp.NotFoundExceptionGet active subclusters.- Returns:
- We will return a list of active subclusters as a Collection.
- Throws:
org.apache.hadoop.yarn.webapp.NotFoundException
-
getApplicationSubmissionContext
public org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getApplicationSubmissionContext(org.apache.hadoop.yarn.api.records.ApplicationId appId) Get ApplicationSubmissionContext according to ApplicationId. We don't throw exceptions. If the application cannot be found, we return null.- Parameters:
appId- ApplicationId- Returns:
- ApplicationSubmissionContext of ApplicationId
-
deleteAllPoliciesConfigurations
- Throws:
Exception
-
getFederationCache
-
deleteStore
- Throws:
Exception
-
deletePolicyConfigurations
public void deletePolicyConfigurations(List<String> queuesList) throws org.apache.hadoop.yarn.exceptions.YarnException - Throws:
org.apache.hadoop.yarn.exceptions.YarnException
-