public class SQLFederationStateStore extends Object implements FederationStateStore
FederationStateStore
.Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
SQLFederationStateStore() |
Modifier and Type | Method and Description |
---|---|
AddApplicationHomeSubClusterResponse |
addApplicationHomeSubCluster(AddApplicationHomeSubClusterRequest request)
Register the home
SubClusterId of the newly submitted
ApplicationId . |
void |
close()
Perform any cleanup operations of the StateStore.
|
DeleteApplicationHomeSubClusterResponse |
deleteApplicationHomeSubCluster(DeleteApplicationHomeSubClusterRequest request)
Delete the mapping of home
SubClusterId of a previously submitted
ApplicationId . |
SubClusterDeregisterResponse |
deregisterSubCluster(SubClusterDeregisterRequest subClusterDeregisterRequest)
Deregister a subcluster identified by
SubClusterId to
change state in federation. |
GetApplicationHomeSubClusterResponse |
getApplicationHomeSubCluster(GetApplicationHomeSubClusterRequest request)
Get information about the application identified by the input
ApplicationId . |
GetApplicationsHomeSubClusterResponse |
getApplicationsHomeSubCluster(GetApplicationsHomeSubClusterRequest request)
Get the
ApplicationHomeSubCluster list representing the mapping of
all submitted applications to it's home sub-cluster. |
Connection |
getConnection()
Get a connection from the DataSource pool.
|
Version |
getCurrentVersion()
Get the
Version of the underlying federation state store client. |
GetSubClusterPoliciesConfigurationsResponse |
getPoliciesConfigurations(GetSubClusterPoliciesConfigurationsRequest request)
Get a map of all queue-to-policy configurations.
|
GetSubClusterPolicyConfigurationResponse |
getPolicyConfiguration(GetSubClusterPolicyConfigurationRequest request)
Get the policy configuration for a given queue.
|
GetSubClusterInfoResponse |
getSubCluster(GetSubClusterInfoRequest subClusterRequest)
Get the membership information of subcluster as identified by
SubClusterId . |
GetSubClustersInfoResponse |
getSubClusters(GetSubClustersInfoRequest subClustersRequest)
Get the membership information of all the subclusters that are
currently participating in federation.
|
void |
init(org.apache.hadoop.conf.Configuration conf)
Initialize the FederationStore.
|
Version |
loadVersion()
Load the version information from the federation state store.
|
SubClusterRegisterResponse |
registerSubCluster(SubClusterRegisterRequest registerSubClusterRequest)
Register a subcluster by publishing capabilities as represented by
SubClusterInfo to indicate participation in federation. |
SetSubClusterPolicyConfigurationResponse |
setPolicyConfiguration(SetSubClusterPolicyConfigurationRequest request)
Set the policy configuration for a given queue.
|
SubClusterHeartbeatResponse |
subClusterHeartbeat(SubClusterHeartbeatRequest subClusterHeartbeatRequest)
Periodic heartbeat from a
ResourceManager participating in
federation to indicate liveliness. |
UpdateApplicationHomeSubClusterResponse |
updateApplicationHomeSubCluster(UpdateApplicationHomeSubClusterRequest request)
Update the home
SubClusterId of a previously submitted
ApplicationId . |
public void init(org.apache.hadoop.conf.Configuration conf) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationStateStore
init
in interface FederationStateStore
conf
- the cluster configurationorg.apache.hadoop.yarn.exceptions.YarnException
- if initialization failspublic SubClusterRegisterResponse registerSubCluster(SubClusterRegisterRequest registerSubClusterRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationMembershipStateStore
SubClusterInfo
to indicate participation in federation. This is
typically done during initialization or restart/failover of the
subcluster's ResourceManager
. Upon successful registration, an
identifier for the subcluster which is unique across the federated
cluster is returned. The identifier is static, i.e. preserved across
restarts and failover.registerSubCluster
in interface FederationMembershipStateStore
registerSubClusterRequest
- the capabilities of the subcluster that
wants to participate in federation. The subcluster id is also
specified in case registration is triggered by restart/failoverorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic SubClusterDeregisterResponse deregisterSubCluster(SubClusterDeregisterRequest subClusterDeregisterRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationMembershipStateStore
SubClusterId
to
change state in federation. This can be done to mark the sub cluster lost,
deregistered, or decommissioned.deregisterSubCluster
in interface FederationMembershipStateStore
subClusterDeregisterRequest
- - the request to deregister the
sub-cluster from federation.org.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic SubClusterHeartbeatResponse subClusterHeartbeat(SubClusterHeartbeatRequest subClusterHeartbeatRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationMembershipStateStore
ResourceManager
participating in
federation to indicate liveliness. The heartbeat publishes the current
capabilities as represented by SubClusterInfo
of the subcluster.
Currently response is empty if the operation was successful, if not an
exception reporting reason for a failure.subClusterHeartbeat
in interface FederationMembershipStateStore
subClusterHeartbeatRequest
- the capabilities of the subcluster that
wants to keep alive its participation in federationorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic GetSubClusterInfoResponse getSubCluster(GetSubClusterInfoRequest subClusterRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationMembershipStateStore
SubClusterId
. The membership information includes the cluster
endpoint and current capabilities as represented by SubClusterInfo
.getSubCluster
in interface FederationMembershipStateStore
subClusterRequest
- the subcluster whose information is requiredSubClusterInfo
, or null
if there is no mapping
for the subclusterorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic GetSubClustersInfoResponse getSubClusters(GetSubClustersInfoRequest subClustersRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationMembershipStateStore
SubClusterInfo
.getSubClusters
in interface FederationMembershipStateStore
subClustersRequest
- request for sub-clusters informationSubClusterInfo
keyed by the SubClusterId
org.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic AddApplicationHomeSubClusterResponse addApplicationHomeSubCluster(AddApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationApplicationHomeSubClusterStore
SubClusterId
of the newly submitted
ApplicationId
. Currently response is empty if the operation was
successful, if not an exception reporting reason for a failure. If a
mapping for the application already existed, the SubClusterId
in
this response will return the existing mapping which might be different
from that in the AddApplicationHomeSubClusterRequest
.addApplicationHomeSubCluster
in interface FederationApplicationHomeSubClusterStore
request
- the request to register a new application with its home
sub-clusterAddApplicationHomeSubClusterRequest
containing the home
sub-cluster of the application. Otherwise, an exception reporting
reason for a failureorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic UpdateApplicationHomeSubClusterResponse updateApplicationHomeSubCluster(UpdateApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationApplicationHomeSubClusterStore
SubClusterId
of a previously submitted
ApplicationId
. Currently response is empty if the operation was
successful, if not an exception reporting reason for a failure.updateApplicationHomeSubCluster
in interface FederationApplicationHomeSubClusterStore
request
- the request to update the home sub-cluster of an
application.org.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic GetApplicationHomeSubClusterResponse getApplicationHomeSubCluster(GetApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationApplicationHomeSubClusterStore
ApplicationId
.getApplicationHomeSubCluster
in interface FederationApplicationHomeSubClusterStore
request
- contains the application queriedApplicationHomeSubCluster
containing the application's home
subclusterorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic GetApplicationsHomeSubClusterResponse getApplicationsHomeSubCluster(GetApplicationsHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationApplicationHomeSubClusterStore
ApplicationHomeSubCluster
list representing the mapping of
all submitted applications to it's home sub-cluster.getApplicationsHomeSubCluster
in interface FederationApplicationHomeSubClusterStore
request
- empty representing all applicationsorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic DeleteApplicationHomeSubClusterResponse deleteApplicationHomeSubCluster(DeleteApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationApplicationHomeSubClusterStore
SubClusterId
of a previously submitted
ApplicationId
. Currently response is empty if the operation was
successful, if not an exception reporting reason for a failure.deleteApplicationHomeSubCluster
in interface FederationApplicationHomeSubClusterStore
request
- the request to delete the home sub-cluster of an
application.org.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic GetSubClusterPolicyConfigurationResponse getPolicyConfiguration(GetSubClusterPolicyConfigurationRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationPolicyStore
getPolicyConfiguration
in interface FederationPolicyStore
request
- the queue whose SubClusterPolicyConfiguration
is
requiredSubClusterPolicyConfiguration
for the specified queue,
or null
if there is no mapping for the queueorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic SetSubClusterPolicyConfigurationResponse setPolicyConfiguration(SetSubClusterPolicyConfigurationRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationPolicyStore
setPolicyConfiguration
in interface FederationPolicyStore
request
- the SubClusterPolicyConfiguration
with the
corresponding queueSubClusterPolicyConfiguration
for the specified queueorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic GetSubClusterPoliciesConfigurationsResponse getPoliciesConfigurations(GetSubClusterPoliciesConfigurationsRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationPolicyStore
getPoliciesConfigurations
in interface FederationPolicyStore
request
- empty to represent all configured queues in the systemorg.apache.hadoop.yarn.exceptions.YarnException
- if the request is invalid/failspublic Version getCurrentVersion()
FederationStateStore
Version
of the underlying federation state store client.getCurrentVersion
in interface FederationStateStore
Version
of the underlying federation store clientpublic Version loadVersion()
FederationStateStore
loadVersion
in interface FederationStateStore
Version
of the federation state storepublic void close() throws Exception
FederationStateStore
close
in interface FederationStateStore
Exception
- if cleanup failspublic Connection getConnection() throws SQLException
SQLException
- on failureCopyright © 2008–2018 Apache Software Foundation. All rights reserved.