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
Exceptionpublic void createCluster(ClusterRequest request) throws AmbariException
AmbariManagementControllercreateCluster in interface AmbariManagementControllerrequest - the request object which defines the cluster to be createdAmbariException - thrown if the cluster cannot be createdpublic void createHostComponents(Set<ServiceComponentHostRequest> requests) throws AmbariException
AmbariManagementControllercreateHostComponents in interface AmbariManagementControllerrequests - 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
AmbariManagementControllercreateConfiguration in interface AmbariManagementControllerrequest - the request object which defines the configuration.AmbariException - when the configuration cannot be created.public void createUsers(Set<UserRequest> requests) throws AmbariException
AmbariManagementControllercreateUsers in interface AmbariManagementControllerrequests - the request objects which defines the user.AmbariException - when the user cannot be created.public MaintenanceState getEffectiveMaintenanceState(ServiceComponentHost sch) throws AmbariException
AmbariManagementControllergetEffectiveMaintenanceState in interface AmbariManagementControllersch - the service component hostAmbariExceptionpublic RequestStatusResponse updateClusters(Set<ClusterRequest> requests, Map<String,String> requestProperties) throws AmbariException
AmbariManagementControllerupdateClusters in interface AmbariManagementControllerrequests - 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)
AmbariManagementControllergetJobTrackerHost in interface AmbariManagementControllerpublic Map<String,Map<String,String>> findConfigurationTagsWithOverrides(Cluster cluster, String hostName) throws AmbariException
AmbariManagementControllerfindConfigurationTagsWithOverrides in interface AmbariManagementControllercluster - the clusterhostName - the host nameAmbariException - if configuration tags can not be obtainedpublic RequestExecutionFactory getRequestExecutionFactory()
AmbariManagementControllergetRequestExecutionFactory in interface AmbariManagementControllerpublic ExecutionScheduleManager getExecutionScheduleManager()
AmbariManagementControllergetExecutionScheduleManager in interface AmbariManagementControllerpublic 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
AmbariManagementControllercreateAndPersistStages in interface AmbariManagementControllercluster - 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
AmbariManagementControlleraddStages in interface AmbariManagementControllerrequestStages - 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
AmbariManagementControllerupdateHostComponents in interface AmbariManagementControllerrequests - 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
AmbariManagementControllerupdateUsers in interface AmbariManagementControllerrequests - the users to modifyAmbariException - if the resources cannot be updatedpublic void deleteCluster(ClusterRequest request) throws AmbariException
AmbariManagementControllerdeleteCluster in interface AmbariManagementControllerrequest - the request object which identifies which cluster to deleteAmbariException - thrown if the resource cannot be deletedpublic RequestStatusResponse deleteHostComponents(Set<ServiceComponentHostRequest> requests) throws AmbariException
AmbariManagementControllerdeleteHostComponents in interface AmbariManagementControllerrequests - the request object which identifies which host component to deleteAmbariException - thrown if the resource cannot be deletedpublic void deleteUsers(Set<UserRequest> requests) throws AmbariException
AmbariManagementControllerdeleteUsers in interface AmbariManagementControllerrequests - the users to deleteAmbariException - if the resources cannot be deletedpublic Set<TaskStatusResponse> getTaskStatus(Set<TaskStatusRequest> requests) throws AmbariException
AmbariManagementControllergetTaskStatus in interface AmbariManagementControllerrequests - the request objectsAmbariException - if the configurations could not be readpublic Set<ClusterResponse> getClusters(Set<ClusterRequest> requests) throws AmbariException
AmbariManagementControllergetClusters in interface AmbariManagementControllerrequests - 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
AmbariManagementControllergetHostComponents in interface AmbariManagementControllerrequests - 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
AmbariManagementControllergetConfigurations in interface AmbariManagementControllerrequests - the request objectsAmbariException - if the configurations could not be readpublic Set<UserResponse> getUsers(Set<UserRequest> requests) throws AmbariException
AmbariManagementControllergetUsers in interface AmbariManagementControllerrequests - the request objectsAmbariException - if the users could not be readpublic String getHealthyHost(Set<String> hostList) throws AmbariException
AmbariManagementControllergetHealthyHost in interface AmbariManagementControllerAmbariExceptionpublic RequestStatusResponse createAction(ExecuteActionRequest actionRequest, Map<String,String> requestProperties) throws AmbariException
AmbariManagementControllercreateAction in interface AmbariManagementControlleractionRequest - 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
AmbariManagementControllergetStacks in interface AmbariManagementControllerrequests - the stacksAmbariException - if the resources cannot be readpublic RequestStatusResponse updateStacks() throws AmbariException
AmbariManagementControllerupdateStacks in interface AmbariManagementControllerAmbariException - ifpublic Set<RepositoryResponse> getRepositories(Set<RepositoryRequest> requests) throws AmbariException
AmbariManagementControllergetRepositories in interface AmbariManagementControllerrequests - the repositoriesAmbariException - if the resources cannot be readpublic void updateRespositories(Set<RepositoryRequest> requests) throws AmbariException
AmbariManagementControllerupdateRespositories in interface AmbariManagementControllerrequests - the repositoriesAmbariExceptionpublic Set<StackVersionResponse> getStackVersions(Set<StackVersionRequest> requests) throws AmbariException
AmbariManagementControllergetStackVersions in interface AmbariManagementControllerrequests - the stacks versionsAmbariException - if the resources cannot be readpublic Set<StackServiceResponse> getStackServices(Set<StackServiceRequest> requests) throws AmbariException
AmbariManagementControllergetStackServices in interface AmbariManagementControllerrequests - the servicesAmbariException - if the resources cannot be readpublic Set<StackConfigurationResponse> getStackConfigurations(Set<StackConfigurationRequest> requests) throws AmbariException
AmbariManagementControllergetStackConfigurations in interface AmbariManagementControllerrequests - the configurationsAmbariException - if the resources cannot be readpublic Set<StackServiceComponentResponse> getStackComponents(Set<StackServiceComponentRequest> requests) throws AmbariException
AmbariManagementControllergetStackComponents in interface AmbariManagementControllerrequests - the componentsAmbariException - if the resources cannot be readpublic Set<OperatingSystemResponse> getStackOperatingSystems(Set<OperatingSystemRequest> requests) throws AmbariException
AmbariManagementControllergetStackOperatingSystems in interface AmbariManagementControllerrequests - the operating systemsAmbariException - if the resources cannot be readpublic String getAuthName()
AmbariManagementControllergetAuthName in interface AmbariManagementControllerpublic Set<RootServiceResponse> getRootServices(Set<RootServiceRequest> requests) throws AmbariException
AmbariManagementControllergetRootServices in interface AmbariManagementControllerrequests - the top-level servicesAmbariException - if the resources cannot be readpublic Set<RootServiceComponentResponse> getRootServiceComponents(Set<RootServiceComponentRequest> requests) throws AmbariException
AmbariManagementControllergetRootServiceComponents in interface AmbariManagementControllerrequests - the components of top-level servicesAmbariException - if the resources cannot be readpublic Clusters getClusters()
AmbariManagementControllergetClusters in interface AmbariManagementControllerpublic AmbariMetaInfo getAmbariMetaInfo()
AmbariManagementControllergetAmbariMetaInfo in interface AmbariManagementControllerpublic ServiceFactory getServiceFactory()
AmbariManagementControllergetServiceFactory in interface AmbariManagementControllerpublic ServiceComponentFactory getServiceComponentFactory()
AmbariManagementControllergetServiceComponentFactory in interface AmbariManagementControllerpublic ConfigGroupFactory getConfigGroupFactory()
AmbariManagementControllergetConfigGroupFactory in interface AmbariManagementControllerpublic AbstractRootServiceResponseFactory getRootServiceResponseFactory()
AmbariManagementControllergetRootServiceResponseFactory in interface AmbariManagementControllerpublic ActionManager getActionManager()
AmbariManagementControllergetActionManager in interface AmbariManagementControllerpublic String getJdkResourceUrl()
AmbariManagementControllergetJdkResourceUrl in interface AmbariManagementControllerpublic String getJavaHome()
AmbariManagementControllergetJavaHome in interface AmbariManagementControllerpublic String getJDKName()
AmbariManagementControllergetJDKName in interface AmbariManagementControllerpublic String getJCEName()
AmbariManagementControllergetJCEName in interface AmbariManagementControllerpublic String getServerDB()
AmbariManagementControllergetServerDB in interface AmbariManagementControllerpublic String getOjdbcUrl()
AmbariManagementControllergetOjdbcUrl in interface AmbariManagementControllerpublic String getMysqljdbcUrl()
AmbariManagementControllergetMysqljdbcUrl in interface AmbariManagementControllerpublic Map<String,String> getRcaParameters()
AmbariManagementControllergetRcaParameters in interface AmbariManagementControllerCopyright © 2016. All rights reserved.