public class AmbariManagementControllerImpl extends Object implements AmbariManagementController
Constructor and Description |
---|
AmbariManagementControllerImpl(ActionManager actionManager,
Clusters clusters,
com.google.inject.Injector injector) |
Modifier and Type | Method and Description |
---|---|
RequestStageContainer |
addStages(RequestStageContainer requestStages,
Cluster cluster,
Map<String,String> requestProperties,
Map<String,String> requestParameters,
Map<State,List<Service>> changedServices,
Map<State,List<ServiceComponent>> changedComponents,
Map<String,Map<State,List<ServiceComponentHost>>> changedHosts,
Collection<ServiceComponentHost> ignoredHosts,
boolean runSmokeTest,
boolean reconfigureClients)
Add stages to the request.
|
RequestStatusResponse |
createAction(ExecuteActionRequest actionRequest,
Map<String,String> requestProperties)
Create the action defined by the attributes in the given request object.
|
RequestStatusResponse |
createAndPersistStages(Cluster cluster,
Map<String,String> requestProperties,
Map<String,String> requestParameters,
Map<State,List<Service>> changedServices,
Map<State,List<ServiceComponent>> changedComponents,
Map<String,Map<State,List<ServiceComponentHost>>> changedHosts,
Collection<ServiceComponentHost> ignoredHosts,
boolean runSmokeTest,
boolean reconfigureClients)
Create and persist the request stages and return a response containing the
associated request and resulting tasks.
|
void |
createCluster(ClusterRequest request)
Create the cluster defined by the attributes in the given request object.
|
void |
createConfiguration(ConfigurationRequest request)
Creates a configuration.
|
void |
createHostComponents(Set<ServiceComponentHostRequest> requests)
Create the host component defined by the attributes in the given request object.
|
void |
createUsers(Set<UserRequest> requests)
Creates users.
|
void |
deleteCluster(ClusterRequest request)
Delete the cluster identified by the given request object.
|
RequestStatusResponse |
deleteHostComponents(Set<ServiceComponentHostRequest> requests)
Delete the host component identified by the given request object.
|
void |
deleteUsers(Set<UserRequest> requests)
Deletes the users specified.
|
Map<String,Map<String,String>> |
findConfigurationTagsWithOverrides(Cluster cluster,
String hostName)
Find configuration tags with applied overrides
|
ActionManager |
getActionManager()
Get the action manager for this management controller.
|
AmbariMetaInfo |
getAmbariMetaInfo()
Get the meta info for this management controller.
|
String |
getAmbariServerURI(String path) |
String |
getAuthName()
Get the authenticated user's name.
|
Clusters |
getClusters()
Get the clusters for this management controller.
|
Set<ClusterResponse> |
getClusters(Set<ClusterRequest> requests)
Get the clusters identified by the given request objects.
|
ConfigGroupFactory |
getConfigGroupFactory()
Get the config group factory for this management controller.
|
Set<ConfigurationResponse> |
getConfigurations(Set<ConfigurationRequest> requests)
Gets the configurations identified by the given request objects.
|
MaintenanceState |
getEffectiveMaintenanceState(ServiceComponentHost sch)
Gets the effective maintenance state for a host component
|
ExecutionScheduleManager |
getExecutionScheduleManager()
Get Execution Schedule Manager
|
String |
getHealthyHost(Set<String> hostList)
Return a healthy host if found otherwise any random host
|
Set<ServiceComponentHostResponse> |
getHostComponents(Set<ServiceComponentHostRequest> requests)
Get the host components identified by the given request objects.
|
String |
getJavaHome()
Getter for the java home, stored in ambari.properties
|
String |
getJCEName()
Getter for the jce name, stored in ambari.properties
|
String |
getJDKName()
Getter for the jdk name, stored in ambari.properties
|
String |
getJdkResourceUrl()
Getter for the url of JDK, stored at server resources folder
|
String |
getJobTrackerHost(Cluster cluster)
Get JobTracker hostname
|
String |
getMysqljdbcUrl()
Getter for the url of MySQL JDBC driver, stored at server resources folder
|
String |
getOjdbcUrl()
Getter for the url of Oracle JDBC driver, stored at server resources folder
|
Map<String,String> |
getRcaParameters()
Returns parameters for RCA database
|
Set<RepositoryResponse> |
getRepositories(Set<RepositoryRequest> requests)
Get repositories by stack name, version and operating system.
|
RequestExecutionFactory |
getRequestExecutionFactory()
Get the Factory to create Request schedules
|
Set<RootServiceComponentResponse> |
getRootServiceComponents(Set<RootServiceComponentRequest> requests)
Get all components of top-level services of Ambari, not related to certain cluster.
|
AbstractRootServiceResponseFactory |
getRootServiceResponseFactory()
Get the root service response factory for this management controller.
|
Set<RootServiceResponse> |
getRootServices(Set<RootServiceRequest> requests)
Get all top-level services of Ambari, not related to certain cluster.
|
String |
getServerDB()
Getter for the name of server database
|
ServiceComponentFactory |
getServiceComponentFactory()
Get the service component factory for this management controller.
|
ServiceFactory |
getServiceFactory()
Get the service factory for this management controller.
|
Set<StackServiceComponentResponse> |
getStackComponents(Set<StackServiceComponentRequest> requests)
Get components by stack name, version and service.
|
Set<StackConfigurationResponse> |
getStackConfigurations(Set<StackConfigurationRequest> requests)
Get configurations by stack name, version and service.
|
Set<OperatingSystemResponse> |
getStackOperatingSystems(Set<OperatingSystemRequest> requests)
Get operating systems by stack name, version.
|
Set<StackResponse> |
getStacks(Set<StackRequest> requests)
Get supported stacks.
|
Set<StackServiceResponse> |
getStackServices(Set<StackServiceRequest> requests)
Get repositories by stack name, version.
|
Set<StackVersionResponse> |
getStackVersions(Set<StackVersionRequest> requests)
Get supported stacks versions.
|
Set<TaskStatusResponse> |
getTaskStatus(Set<TaskStatusRequest> requests)
Gets the task status identified by the given request objects.
|
Set<UserResponse> |
getUsers(Set<UserRequest> requests)
Gets the users identified by the given request objects.
|
RequestStatusResponse |
updateClusters(Set<ClusterRequest> requests,
Map<String,String> requestProperties)
Update the cluster identified by the given request object with the
values carried by the given request object.
|
RequestStatusResponse |
updateHostComponents(Set<ServiceComponentHostRequest> requests,
Map<String,String> requestProperties,
boolean runSmokeTest)
Update the host component identified by the given request object with the
values carried by the given request object.
|
void |
updateRespositories(Set<RepositoryRequest> requests)
Updates repositories by stack name, version and operating system.
|
RequestStatusResponse |
updateStacks()
Update stacks from the files at stackRoot.
|
void |
updateUsers(Set<UserRequest> requests)
Updates the users specified.
|
@Inject public AmbariManagementControllerImpl(ActionManager actionManager, Clusters clusters, com.google.inject.Injector injector) throws Exception
Exception
public void createCluster(ClusterRequest request) throws AmbariException
AmbariManagementController
createCluster
in interface AmbariManagementController
request
- the request object which defines the cluster to be createdAmbariException
- thrown if the cluster cannot be createdpublic void createHostComponents(Set<ServiceComponentHostRequest> requests) throws AmbariException
AmbariManagementController
createHostComponents
in interface AmbariManagementController
requests
- the request object which defines the host component to be createdAmbariException
- thrown if the host component cannot be createdpublic void createConfiguration(ConfigurationRequest request) throws AmbariException
AmbariManagementController
createConfiguration
in interface AmbariManagementController
request
- the request object which defines the configuration.AmbariException
- when the configuration cannot be created.public void createUsers(Set<UserRequest> requests) throws AmbariException
AmbariManagementController
createUsers
in interface AmbariManagementController
requests
- the request objects which defines the user.AmbariException
- when the user cannot be created.public MaintenanceState getEffectiveMaintenanceState(ServiceComponentHost sch) throws AmbariException
AmbariManagementController
getEffectiveMaintenanceState
in interface AmbariManagementController
sch
- the service component hostAmbariException
public RequestStatusResponse updateClusters(Set<ClusterRequest> requests, Map<String,String> requestProperties) throws AmbariException
AmbariManagementController
updateClusters
in interface AmbariManagementController
requests
- request objects which define which cluster to
update and the values to setrequestProperties
- request specific properties independent of resourceAmbariException
- thrown if the resource cannot be updatedpublic String getJobTrackerHost(Cluster cluster)
AmbariManagementController
getJobTrackerHost
in interface AmbariManagementController
public Map<String,Map<String,String>> findConfigurationTagsWithOverrides(Cluster cluster, String hostName) throws AmbariException
AmbariManagementController
findConfigurationTagsWithOverrides
in interface AmbariManagementController
cluster
- the clusterhostName
- the host nameAmbariException
- if configuration tags can not be obtainedpublic RequestExecutionFactory getRequestExecutionFactory()
AmbariManagementController
getRequestExecutionFactory
in interface AmbariManagementController
public ExecutionScheduleManager getExecutionScheduleManager()
AmbariManagementController
getExecutionScheduleManager
in interface AmbariManagementController
public RequestStatusResponse createAndPersistStages(Cluster cluster, Map<String,String> requestProperties, Map<String,String> requestParameters, Map<State,List<Service>> changedServices, Map<State,List<ServiceComponent>> changedComponents, Map<String,Map<State,List<ServiceComponentHost>>> changedHosts, Collection<ServiceComponentHost> ignoredHosts, boolean runSmokeTest, boolean reconfigureClients) throws AmbariException
AmbariManagementController
createAndPersistStages
in interface AmbariManagementController
cluster
- the clusterrequestProperties
- the request propertiesrequestParameters
- the request parameters; may be nullchangedServices
- the services being changed; may be nullchangedComponents
- the components being changedchangedHosts
- the hosts being changedignoredHosts
- the hosts to be ignoredrunSmokeTest
- indicates whether or not the smoke tests should be runreconfigureClients
- indicates whether or not the clients should be reconfiguredAmbariException
- is thrown if the stages can not be createdpublic RequestStageContainer addStages(RequestStageContainer requestStages, Cluster cluster, Map<String,String> requestProperties, Map<String,String> requestParameters, Map<State,List<Service>> changedServices, Map<State,List<ServiceComponent>> changedComponents, Map<String,Map<State,List<ServiceComponentHost>>> changedHosts, Collection<ServiceComponentHost> ignoredHosts, boolean runSmokeTest, boolean reconfigureClients) throws AmbariException
AmbariManagementController
addStages
in interface AmbariManagementController
requestStages
- Stages currently associated with requestcluster
- cluster being acted onrequestProperties
- the request propertiesrequestParameters
- the request parameters; may be nullchangedServices
- the services being changed; may be nullchangedComponents
- the components being changedchangedHosts
- the hosts being changedignoredHosts
- the hosts to be ignoredrunSmokeTest
- indicates whether or not the smoke tests should be runreconfigureClients
- indicates whether or not the clients should be reconfiguredAmbariException
- if stages can't be createdpublic RequestStatusResponse updateHostComponents(Set<ServiceComponentHostRequest> requests, Map<String,String> requestProperties, boolean runSmokeTest) throws AmbariException
AmbariManagementController
updateHostComponents
in interface AmbariManagementController
requests
- the request object which defines which host component to
update and the values to setrequestProperties
- the request propertiesrunSmokeTest
- indicates whether or not to run a smoke testAmbariException
- thrown if the resource cannot be updatedpublic void updateUsers(Set<UserRequest> requests) throws AmbariException
AmbariManagementController
updateUsers
in interface AmbariManagementController
requests
- the users to modifyAmbariException
- if the resources cannot be updatedpublic void deleteCluster(ClusterRequest request) throws AmbariException
AmbariManagementController
deleteCluster
in interface AmbariManagementController
request
- the request object which identifies which cluster to deleteAmbariException
- thrown if the resource cannot be deletedpublic RequestStatusResponse deleteHostComponents(Set<ServiceComponentHostRequest> requests) throws AmbariException
AmbariManagementController
deleteHostComponents
in interface AmbariManagementController
requests
- the request object which identifies which host component to deleteAmbariException
- thrown if the resource cannot be deletedpublic void deleteUsers(Set<UserRequest> requests) throws AmbariException
AmbariManagementController
deleteUsers
in interface AmbariManagementController
requests
- the users to deleteAmbariException
- if the resources cannot be deletedpublic Set<TaskStatusResponse> getTaskStatus(Set<TaskStatusRequest> requests) throws AmbariException
AmbariManagementController
getTaskStatus
in interface AmbariManagementController
requests
- the request objectsAmbariException
- if the configurations could not be readpublic Set<ClusterResponse> getClusters(Set<ClusterRequest> requests) throws AmbariException
AmbariManagementController
getClusters
in interface AmbariManagementController
requests
- the request objects which identify the clusters to be returnedAmbariException
- thrown if the resource cannot be readpublic Set<ServiceComponentHostResponse> getHostComponents(Set<ServiceComponentHostRequest> requests) throws AmbariException
AmbariManagementController
getHostComponents
in interface AmbariManagementController
requests
- the request objects which identify the host components
to be returnedAmbariException
- thrown if the resource cannot be readpublic Set<ConfigurationResponse> getConfigurations(Set<ConfigurationRequest> requests) throws AmbariException
AmbariManagementController
getConfigurations
in interface AmbariManagementController
requests
- the request objectsAmbariException
- if the configurations could not be readpublic Set<UserResponse> getUsers(Set<UserRequest> requests) throws AmbariException
AmbariManagementController
getUsers
in interface AmbariManagementController
requests
- the request objectsAmbariException
- if the users could not be readpublic String getHealthyHost(Set<String> hostList) throws AmbariException
AmbariManagementController
getHealthyHost
in interface AmbariManagementController
AmbariException
public RequestStatusResponse createAction(ExecuteActionRequest actionRequest, Map<String,String> requestProperties) throws AmbariException
AmbariManagementController
createAction
in interface AmbariManagementController
actionRequest
- the request object which defines the action to be createdrequestProperties
- the request propertiesAmbariException
- thrown if the action cannot be createdpublic Set<StackResponse> getStacks(Set<StackRequest> requests) throws AmbariException
AmbariManagementController
getStacks
in interface AmbariManagementController
requests
- the stacksAmbariException
- if the resources cannot be readpublic RequestStatusResponse updateStacks() throws AmbariException
AmbariManagementController
updateStacks
in interface AmbariManagementController
AmbariException
- ifpublic Set<RepositoryResponse> getRepositories(Set<RepositoryRequest> requests) throws AmbariException
AmbariManagementController
getRepositories
in interface AmbariManagementController
requests
- the repositoriesAmbariException
- if the resources cannot be readpublic void updateRespositories(Set<RepositoryRequest> requests) throws AmbariException
AmbariManagementController
updateRespositories
in interface AmbariManagementController
requests
- the repositoriesAmbariException
public Set<StackVersionResponse> getStackVersions(Set<StackVersionRequest> requests) throws AmbariException
AmbariManagementController
getStackVersions
in interface AmbariManagementController
requests
- the stacks versionsAmbariException
- if the resources cannot be readpublic Set<StackServiceResponse> getStackServices(Set<StackServiceRequest> requests) throws AmbariException
AmbariManagementController
getStackServices
in interface AmbariManagementController
requests
- the servicesAmbariException
- if the resources cannot be readpublic Set<StackConfigurationResponse> getStackConfigurations(Set<StackConfigurationRequest> requests) throws AmbariException
AmbariManagementController
getStackConfigurations
in interface AmbariManagementController
requests
- the configurationsAmbariException
- if the resources cannot be readpublic Set<StackServiceComponentResponse> getStackComponents(Set<StackServiceComponentRequest> requests) throws AmbariException
AmbariManagementController
getStackComponents
in interface AmbariManagementController
requests
- the componentsAmbariException
- if the resources cannot be readpublic Set<OperatingSystemResponse> getStackOperatingSystems(Set<OperatingSystemRequest> requests) throws AmbariException
AmbariManagementController
getStackOperatingSystems
in interface AmbariManagementController
requests
- the operating systemsAmbariException
- if the resources cannot be readpublic String getAuthName()
AmbariManagementController
getAuthName
in interface AmbariManagementController
public Set<RootServiceResponse> getRootServices(Set<RootServiceRequest> requests) throws AmbariException
AmbariManagementController
getRootServices
in interface AmbariManagementController
requests
- the top-level servicesAmbariException
- if the resources cannot be readpublic Set<RootServiceComponentResponse> getRootServiceComponents(Set<RootServiceComponentRequest> requests) throws AmbariException
AmbariManagementController
getRootServiceComponents
in interface AmbariManagementController
requests
- the components of top-level servicesAmbariException
- if the resources cannot be readpublic Clusters getClusters()
AmbariManagementController
getClusters
in interface AmbariManagementController
public AmbariMetaInfo getAmbariMetaInfo()
AmbariManagementController
getAmbariMetaInfo
in interface AmbariManagementController
public ServiceFactory getServiceFactory()
AmbariManagementController
getServiceFactory
in interface AmbariManagementController
public ServiceComponentFactory getServiceComponentFactory()
AmbariManagementController
getServiceComponentFactory
in interface AmbariManagementController
public ConfigGroupFactory getConfigGroupFactory()
AmbariManagementController
getConfigGroupFactory
in interface AmbariManagementController
public AbstractRootServiceResponseFactory getRootServiceResponseFactory()
AmbariManagementController
getRootServiceResponseFactory
in interface AmbariManagementController
public ActionManager getActionManager()
AmbariManagementController
getActionManager
in interface AmbariManagementController
public String getJdkResourceUrl()
AmbariManagementController
getJdkResourceUrl
in interface AmbariManagementController
public String getJavaHome()
AmbariManagementController
getJavaHome
in interface AmbariManagementController
public String getJDKName()
AmbariManagementController
getJDKName
in interface AmbariManagementController
public String getJCEName()
AmbariManagementController
getJCEName
in interface AmbariManagementController
public String getServerDB()
AmbariManagementController
getServerDB
in interface AmbariManagementController
public String getOjdbcUrl()
AmbariManagementController
getOjdbcUrl
in interface AmbariManagementController
public String getMysqljdbcUrl()
AmbariManagementController
getMysqljdbcUrl
in interface AmbariManagementController
public Map<String,String> getRcaParameters()
AmbariManagementController
getRcaParameters
in interface AmbariManagementController
Copyright © 2017. All rights reserved.