public class AmbariManagementControllerImpl extends Object implements AmbariManagementController
Modifier and Type | Field and Description |
---|---|
static Pattern |
CLUSTER_NAME_PTRN |
static String |
CLUSTER_NAME_VALIDATION_REGEXP |
static String |
CLUSTER_PHASE_INITIAL_INSTALL |
static String |
CLUSTER_PHASE_INITIAL_START |
static String |
CLUSTER_PHASE_PROPERTY |
protected OsFamily |
osFamily |
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,
boolean useGeneratedConfigs)
Add stages to the request.
|
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,
boolean useGeneratedConfigs,
boolean useClusterHostInfo)
Add stages to the request.
|
boolean |
checkLdapConfigured()
Performs a test if LDAP server is reachable.
|
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.
|
Config |
createConfig(Cluster cluster,
StackId stackId,
String type,
Map<String,String> properties,
String versionTag,
Map<String,Map<String,String>> propertiesAttributes)
Create cluster config
TODO move this method to Cluster? doesn't seem to be on its place
|
ConfigurationResponse |
createConfiguration(ConfigurationRequest request)
Creates a configuration.
|
void |
createExtensionLink(ExtensionLinkRequest request)
This method will create a link between an extension version and a stack version (Extension Link).
|
void |
createGroups(Set<GroupRequest> requests)
Creates groups.
|
void |
createHostComponents(Set<ServiceComponentHostRequest> requests)
Create the host component defined by the attributes in the given request object.
|
void |
createHostComponents(Set<ServiceComponentHostRequest> requests,
boolean isBlueprintProvisioned)
Create the host component defined by the attributes in the given request object.
|
void |
createMembers(Set<MemberRequest> requests)
Creates members of the group.
|
Set<ServiceConfigVersionResponse> |
createServiceConfigVersion(Set<ServiceConfigVersionRequest> requests)
Creates serviceconfigversions and corresponding new configurations if it is an initial request
OR
Rollbacks to an existing serviceconfigversion if request specifies.
|
void |
deleteCluster(ClusterRequest request)
Delete the cluster identified by the given request object.
|
void |
deleteExtensionLink(ExtensionLinkRequest request)
This method will delete a link between an extension version and a stack version (Extension Link).
|
void |
deleteGroups(Set<GroupRequest> requests)
Deletes the user groups specified.
|
DeleteStatusMetaData |
deleteHostComponents(Set<ServiceComponentHostRequest> requests)
Delete the host component identified by the given request object.
|
void |
deleteMembers(Set<MemberRequest> requests)
Deletes the group members specified.
|
protected RequestStageContainer |
doStageCreation(RequestStageContainer requestStages,
Cluster cluster,
Map<State,List<Service>> changedServices,
Map<State,List<ServiceComponent>> changedComps,
Map<String,Map<State,List<ServiceComponentHost>>> changedScHosts,
Map<String,String> requestParameters,
Map<String,String> requestProperties,
boolean runSmokeTest,
boolean reconfigureClients,
boolean useLatestConfigs,
boolean useClusterHostInfo) |
protected void |
filterHostsForAction(Set<String> candidateHosts,
Service service,
Cluster cluster,
Resource.Type level)
Utility method that filters out hosts from set based on their maintenance
state status.
|
Map<String,Map<String,String>> |
findConfigurationTagsWithOverrides(Cluster cluster,
String hostName)
Find configuration tags with applied overrides
|
String |
findServiceName(Cluster cluster,
String componentName)
Get service name by cluster instance and component name
|
ActionManager |
getActionManager()
Get the action manager for this management controller.
|
TopologyUpdateEvent |
getAddedComponentsTopologyEvent(Set<ServiceComponentHostRequest> requests) |
AmbariEventPublisher |
getAmbariEventPublisher()
Gets an
AmbariEventPublisher which can be used to send and receive
AmbariEvent s. |
AmbariMetaInfo |
getAmbariMetaInfo()
Get the meta info for this management controller.
|
String |
getAmbariServerURI(String path)
Get an Ambari endpoint URI for the given path.
|
int |
getAuthId()
Get the authenticated user's id.
|
String |
getAuthName()
Get the authenticated user's name.
|
Map<String,BlueprintProvisioningState> |
getBlueprintProvisioningStates(Long clusterId,
Long hostId) |
protected ServiceComponent |
getClientComponentForRunningAction(Cluster cluster,
Service service) |
protected String |
getClientHostForRunningAction(Cluster cluster,
Service service,
ServiceComponent serviceComponent) |
MetadataUpdateEvent |
getClusterMetadata(Cluster cl) |
MetadataUpdateEvent |
getClusterMetadataOnConfigsUpdate(Cluster cl) |
MetadataUpdateEvent |
getClusterMetadataOnRepoUpdate(Cluster cl) |
MetadataUpdateEvent |
getClusterMetadataOnServiceCredentialStoreUpdate(Cluster cl,
String serviceName) |
MetadataUpdateEvent |
getClusterMetadataOnServiceInstall(Cluster cl,
String serviceName) |
Clusters |
getClusters()
Get the clusters for this management controller.
|
Set<ClusterResponse> |
getClusters(Set<ClusterRequest> requests)
Get the clusters identified by the given request objects.
|
MetadataUpdateEvent |
getClustersMetadata()
Collects full metadata info about clusters for agent.
|
ClusterResponse |
getClusterUpdateResults(ClusterRequest clusterRequest)
Get cached clusterUpdateResults, used only for service config versions currently
|
ConfigGroupFactory |
getConfigGroupFactory()
Get the config group factory for this management controller.
|
ConfigGroupResponse |
getConfigGroupUpdateResults(ConfigGroupRequest configGroupRequest) |
ConfigHelper |
getConfigHelper()
Get config helper
|
Set<ConfigurationResponse> |
getConfigurations(Set<ConfigurationRequest> requests)
Gets the configurations identified by the given request objects.
|
CredentialStoreService |
getCredentialStoreService()
Returns the CredentialStoreService implementation associated with this
controller
|
Map<String,String> |
getCredentialStoreServiceProperties()
Queries the CredentialStoreService to gather properties about it.
|
MaintenanceState |
getEffectiveMaintenanceState(ServiceComponentHost sch)
Gets the effective maintenance state for a host component
|
ExecutionCommand |
getExecutionCommand(Cluster cluster,
ServiceComponentHost scHost,
RoleCommand roleCommand)
Gets an execution command for host component life cycle command
|
ExecutionScheduleManager |
getExecutionScheduleManager()
Get Execution Schedule Manager
|
Set<ExtensionResponse> |
getExtensions(Set<ExtensionRequest> requests)
Get supported extensions.
|
Set<ExtensionVersionResponse> |
getExtensionVersions(Set<ExtensionVersionRequest> requests)
Get supported extension versions.
|
Set<GroupResponse> |
getGroups(Set<GroupRequest> requests)
Gets the user groups identified by the given request objects.
|
String |
getHealthyHost(Set<String> hostList)
Chooses a healthy host from the list of candidate hosts randomly.
|
Set<ServiceComponentHostResponse> |
getHostComponents(Set<ServiceComponentHostRequest> requests)
Get the host components identified by the given request objects.
|
Set<ServiceComponentHostResponse> |
getHostComponents(Set<ServiceComponentHostRequest> requests,
boolean statusOnly) |
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
HDP-1.x is not supported anymore
|
KerberosHelper |
getKerberosHelper()
Returns KerberosHelper instance
|
LdapSyncDto |
getLdapSyncInfo()
Retrieves groups and users from external LDAP.
|
LoggingSearchPropertyProvider |
getLoggingSearchPropertyProvider()
Gets the LoggingSearchPropertyProvider instance.
|
LoggingService |
getLoggingService(String clusterName)
Gets the LoggingService instance from the dependency injection framework.
|
Set<MemberResponse> |
getMembers(Set<MemberRequest> requests)
Gets the group members identified by the given request objects.
|
SortedMap<String,SortedMap<String,String>> |
getMetadataAgentConfigs() |
TreeMap<String,String> |
getMetadataAmbariLevelParams() |
TreeMap<String,String> |
getMetadataClusterLevelParams(Cluster cluster,
StackId stackId) |
TreeMap<String,MetadataServiceInfo> |
getMetadataServiceLevelParams(Cluster cluster) |
TreeMap<String,MetadataServiceInfo> |
getMetadataServiceLevelParams(Service service) |
MetricPropertyProviderFactory |
getMetricPropertyProviderFactory()
Gets the
MetricPropertyProviderFactory that was injected into this
class. |
MetricsCollectorHAManager |
getMetricsCollectorHAManager()
Gets an
MetricsCollectorHAManager which can be used to get/add collector host for a cluster |
List<Module> |
getModules(Long mpackId)
Fetch the module info for a given mpack.
|
MpackResponse |
getMpack(Long mpackId)
Fetch an mpack based on id
|
Set<MpackResponse> |
getMpacks()
Fetch all mpacks
|
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
|
Set<OperatingSystemResponse> |
getOperatingSystems(Set<OperatingSystemRequest> requests)
Get operating systems by stack name, version.
|
List<ServiceOsSpecific.Package> |
getPackagesForServiceHost(ServiceInfo serviceInfo,
Map<String,String> hostParams,
String osFamily) |
QuickLinkVisibilityController |
getQuicklinkVisibilityController() |
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
|
RoleCommandOrder |
getRoleCommandOrder(Cluster cluster)
Get Role Command Order
|
RoleGraphFactory |
getRoleGraphFactory()
Get the role graph factory for this management controller.
|
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.
|
Set<ServiceConfigVersionResponse> |
getServiceConfigVersions(Set<ServiceConfigVersionRequest> requests)
Get service config version history
|
Set<StackServiceComponentResponse> |
getStackComponents(Set<StackServiceComponentRequest> requests)
Get components by stack name, version and service.
|
Set<StackConfigurationDependencyResponse> |
getStackConfigurationDependencies(Set<StackConfigurationDependencyRequest> requests)
Get configuration dependencies which are specific for a specific service configuration property
|
Set<StackConfigurationResponse> |
getStackConfigurations(Set<StackConfigurationRequest> requests)
Get configurations by stack name, version and service.
|
Set<StackConfigurationResponse> |
getStackLevelConfigurations(Set<StackLevelConfigurationRequest> requests)
Get configurations which are specific for a cluster (!not a service).
|
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.
|
TimelineMetricCacheProvider |
getTimelineMetricCacheProvider() |
TreeMap<String,String> |
getTopologyCommandParams(Long clusterId,
String serviceName,
String componentName,
ServiceComponentHost sch) |
TreeMap<String,String> |
getTopologyComponentLevelParams(Long clusterId,
String serviceName,
String componentName,
SecurityType clusterSecurityType) |
void |
initializeWidgetsAndLayouts(Cluster cluster,
Service service)
Initialize cluster scoped widgets and widgetLayouts for different stack
components.
|
boolean |
isAttributeMapsEqual(Map<String,Map<String,String>> requestConfigAttributes,
Map<String,Map<String,String>> clusterConfigAttributes)
Comparison of two attributes maps
|
boolean |
isLdapSyncInProgress()
Checks if LDAP sync process is running.
|
protected ServiceOsSpecific |
populateServicePackagesInfo(ServiceInfo serviceInfo,
Map<String,String> hostParams,
String osFamily)
Computes os-dependent packages for service/host.
|
MpackResponse |
registerMpack(MpackRequest request)
Register the mpack defined by the attributes in the given request object.
|
void |
registerRackChange(String clusterName)
Register a change in rack information for the hosts of the given cluster.
|
void |
removeMpack(MpackEntity mpackEntity,
StackEntity stackEntity)
Remove Mpack from the mpackMap and stackMap which is used to power the Mpack and Stack APIs.
|
void |
saveClusterUpdate(ClusterRequest clusterRequest,
ClusterResponse clusterResponse)
Save cluster update results to retrieve later
|
void |
saveConfigGroupUpdate(ConfigGroupRequest configGroupRequest,
ConfigGroupResponse configGroupResponse) |
List<String> |
selectHealthyHosts(Set<String> hostList)
Filters hosts to only select healthy ones that are heartbeating.
|
LdapBatchDto |
synchronizeLdapUsersAndGroups(LdapSyncRequest userRequest,
LdapSyncRequest groupRequest)
Synchronizes local users and groups with given data.
|
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 |
updateClusters(Set<ClusterRequest> requests,
Map<String,String> requestProperties,
boolean fireAgentUpdates)
Update the cluster identified by the given request object with the
values carried by the given request object.
|
void |
updateExtensionLink(ExtensionLinkEntity oldLinkEntity,
ExtensionLinkRequest newLinkRequest)
Update a link - switch the link's extension version while keeping the same stack version and extension name
|
void |
updateExtensionLink(ExtensionLinkRequest request)
Update a link - switch the link's extension version while keeping the same stack version and extension name
|
void |
updateGroups(Set<GroupRequest> requests)
Updates the groups specified.
|
void |
updateMembers(Set<MemberRequest> requests)
Updates the members of the group specified.
|
RequestStatusResponse |
updateStacks()
Update stacks from the files at stackRoot.
|
protected void |
validateAuthorizationToManageServiceAutoStartConfiguration(Cluster cluster,
String configType,
Map<String,String[]> propertyChanges)
Validates that the authenticated user can manage the cluster-wide configuration for a service's
ability to be set to auto-start.
|
protected void |
validateAuthorizationToUpdateServiceUsersAndGroups(Cluster cluster,
String configType,
Map<String,String[]> propertyChanges)
Validates that the authenticated user can set a service's (run-as) user and group.
|
static void |
validateClusterName(String clusterName)
validate cluster name character and length requirements and throw IllegalArgumentException if not valid.
|
void |
validateServiceComponentHostRequest(ServiceComponentHostRequest request) |
void |
verifyRepositories(Set<RepositoryRequest> requests)
Verifies repositories' base urls.
|
public static final String CLUSTER_PHASE_PROPERTY
public static final String CLUSTER_PHASE_INITIAL_INSTALL
public static final String CLUSTER_PHASE_INITIAL_START
public static final String CLUSTER_NAME_VALIDATION_REGEXP
public static final Pattern CLUSTER_NAME_PTRN
@Inject protected OsFamily osFamily
@Inject public AmbariManagementControllerImpl(ActionManager actionManager, Clusters clusters, com.google.inject.Injector injector) throws Exception
Exception
public String getAmbariServerURI(String path)
AmbariManagementController
getAmbariServerURI
in interface AmbariManagementController
path
- the path (e.g. /api/v1/users)public RoleCommandOrder getRoleCommandOrder(Cluster cluster)
AmbariManagementController
getRoleCommandOrder
in interface AmbariManagementController
public void createCluster(ClusterRequest request) throws org.apache.ambari.server.AmbariException
AmbariManagementController
createCluster
in interface AmbariManagementController
request
- the request object which defines the cluster to be createdorg.apache.ambari.server.AmbariException
- thrown if the cluster cannot be createdpublic void createHostComponents(Set<ServiceComponentHostRequest> requests) throws org.apache.ambari.server.AmbariException, AuthorizationException
AmbariManagementController
createHostComponents
in interface AmbariManagementController
requests
- the request object which defines the host component to be createdorg.apache.ambari.server.AmbariException
- thrown if the host component cannot be createdAuthorizationException
public MpackResponse registerMpack(MpackRequest request) throws IOException, AuthorizationException, ResourceAlreadyExistsException
registerMpack
in interface AmbariManagementController
request
- the request object which defines the mpack to be createdorg.apache.ambari.server.AmbariException
- thrown if the mpack cannot be createdAuthorizationException
- thrown if the authenticated user is not authorized to perform this operationIOException
ResourceAlreadyExistsException
public Set<MpackResponse> getMpacks()
AmbariManagementController
getMpacks
in interface AmbariManagementController
public MpackResponse getMpack(Long mpackId)
AmbariManagementController
getMpack
in interface AmbariManagementController
public List<Module> getModules(Long mpackId)
AmbariManagementController
getModules
in interface AmbariManagementController
public void createHostComponents(Set<ServiceComponentHostRequest> requests, boolean isBlueprintProvisioned) throws org.apache.ambari.server.AmbariException, AuthorizationException
AmbariManagementController
createHostComponents
in interface AmbariManagementController
requests
- the request object which defines the host component to be createdisBlueprintProvisioned
- means host components will be created during blueprint deployorg.apache.ambari.server.AmbariException
- thrown if the host component cannot be createdAuthorizationException
public TopologyUpdateEvent getAddedComponentsTopologyEvent(Set<ServiceComponentHostRequest> requests) throws org.apache.ambari.server.AmbariException
getAddedComponentsTopologyEvent
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
public void registerRackChange(String clusterName) throws org.apache.ambari.server.AmbariException
AmbariManagementController
registerRackChange
in interface AmbariManagementController
clusterName
- the name of the clusterorg.apache.ambari.server.AmbariException
- if an error occurs during the rack change registrationpublic ConfigurationResponse createConfiguration(ConfigurationRequest request) throws org.apache.ambari.server.AmbariException, AuthorizationException
This implementation ensures the authenticated user is authorized to create the new configuration based on the details of what properties are being changed and the authorizations the authenticated user has been granted.
Example
SERVICE_MODIFY_CONFIGS
privilege (authorization)
cluster-env/recovery_enabled
), that user must be granted the
CLUSTER_MANAGE_AUTO_START
privilege (authorization)
createConfiguration
in interface AmbariManagementController
request
- the request object which defines the configuration.org.apache.ambari.server.AmbariException
- when the configuration cannot be created.AuthorizationException
public Config createConfig(Cluster cluster, StackId stackId, String type, Map<String,String> properties, String versionTag, Map<String,Map<String,String>> propertiesAttributes)
AmbariManagementController
createConfig
in interface AmbariManagementController
public void createGroups(Set<GroupRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
createGroups
in interface AmbariManagementController
requests
- the request objects which define the groups.org.apache.ambari.server.AmbariException
- when the groups cannot be created.public void createMembers(Set<MemberRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
createMembers
in interface AmbariManagementController
requests
- the request objects which define the members.org.apache.ambari.server.AmbariException
- when the members cannot be created.public Set<MemberResponse> getMembers(Set<MemberRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getMembers
in interface AmbariManagementController
requests
- the request objectsorg.apache.ambari.server.AmbariException
- if the members could not be readpublic void updateMembers(Set<MemberRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
updateMembers
in interface AmbariManagementController
requests
- the members to be set for this grouporg.apache.ambari.server.AmbariException
- if the resources cannot be updatedpublic MaintenanceState getEffectiveMaintenanceState(ServiceComponentHost sch) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getEffectiveMaintenanceState
in interface AmbariManagementController
sch
- the service component hostorg.apache.ambari.server.AmbariException
public RequestStatusResponse updateClusters(Set<ClusterRequest> requests, Map<String,String> requestProperties) throws org.apache.ambari.server.AmbariException, AuthorizationException
AmbariManagementController
updateClusters
in interface AmbariManagementController
requests
- request objects which define which cluster to
update and the values to setrequestProperties
- request specific properties independent of resourceorg.apache.ambari.server.AmbariException
- thrown if the resource cannot be updatedAuthorizationException
- thrown if the authenticated user is not authorized to perform this operationpublic RequestStatusResponse updateClusters(Set<ClusterRequest> requests, Map<String,String> requestProperties, boolean fireAgentUpdates) throws org.apache.ambari.server.AmbariException, AuthorizationException
AmbariManagementController
updateClusters
in interface AmbariManagementController
requests
- request objects which define which cluster to
update and the values to setrequestProperties
- request specific properties independent of resourcefireAgentUpdates
- should agent updates (configurations, metadata etc.) be fired insideorg.apache.ambari.server.AmbariException
- thrown if the resource cannot be updatedAuthorizationException
- thrown if the authenticated user is not authorized to perform this operationpublic static void validateClusterName(String clusterName)
Character Requirements
A through Z a through z 0 through 9 _ (underscore) - (dash) Length Requirements
Minimum: 1 character Maximum: 100 characters
clusterName
- name to validateIllegalArgumentException
- if validation resultCLUSTER_NAME_VALIDATION_REGEXP
public boolean isAttributeMapsEqual(Map<String,Map<String,String>> requestConfigAttributes, Map<String,Map<String,String>> clusterConfigAttributes)
requestConfigAttributes
- - attribute map sent from APIclusterConfigAttributes
- - existed attribute mappublic void saveClusterUpdate(ClusterRequest clusterRequest, ClusterResponse clusterResponse)
clusterRequest
- cluster request infoclusterResponse
- cluster response infopublic ClusterResponse getClusterUpdateResults(ClusterRequest clusterRequest)
AmbariManagementController
getClusterUpdateResults
in interface AmbariManagementController
public ConfigGroupResponse getConfigGroupUpdateResults(ConfigGroupRequest configGroupRequest)
getConfigGroupUpdateResults
in interface AmbariManagementController
public void saveConfigGroupUpdate(ConfigGroupRequest configGroupRequest, ConfigGroupResponse configGroupResponse)
saveConfigGroupUpdate
in interface AmbariManagementController
public String getJobTrackerHost(Cluster cluster)
AmbariManagementController
getJobTrackerHost
in interface AmbariManagementController
public Map<String,Map<String,String>> findConfigurationTagsWithOverrides(Cluster cluster, String hostName) throws org.apache.ambari.server.AmbariException
AmbariManagementController
findConfigurationTagsWithOverrides
in interface AmbariManagementController
cluster
- the clusterhostName
- the host nameorg.apache.ambari.server.AmbariException
- if configuration tags can not be obtainedpublic RequestExecutionFactory getRequestExecutionFactory()
AmbariManagementController
getRequestExecutionFactory
in interface AmbariManagementController
public ExecutionScheduleManager getExecutionScheduleManager()
AmbariManagementController
getExecutionScheduleManager
in interface AmbariManagementController
protected ServiceOsSpecific populateServicePackagesInfo(ServiceInfo serviceInfo, Map<String,String> hostParams, String osFamily)
hostParams
- may be modified (appended SERVICE_REPO_INFO)public List<ServiceOsSpecific.Package> getPackagesForServiceHost(ServiceInfo serviceInfo, Map<String,String> hostParams, String osFamily)
getPackagesForServiceHost
in interface AmbariManagementController
serviceInfo
- service info for a given servicehostParams
- parameter map. May be changed during method executionosFamily
- os family for hostprotected RequestStageContainer doStageCreation(RequestStageContainer requestStages, Cluster cluster, Map<State,List<Service>> changedServices, Map<State,List<ServiceComponent>> changedComps, Map<String,Map<State,List<ServiceComponentHost>>> changedScHosts, Map<String,String> requestParameters, Map<String,String> requestProperties, boolean runSmokeTest, boolean reconfigureClients, boolean useLatestConfigs, boolean useClusterHostInfo) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public ExecutionCommand getExecutionCommand(Cluster cluster, ServiceComponentHost scHost, RoleCommand roleCommand) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getExecutionCommand
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
public Set<StackConfigurationDependencyResponse> getStackConfigurationDependencies(Set<StackConfigurationDependencyRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getStackConfigurationDependencies
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
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 org.apache.ambari.server.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 reconfiguredorg.apache.ambari.server.AmbariException
- 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, boolean useGeneratedConfigs) throws org.apache.ambari.server.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 reconfiguredorg.apache.ambari.server.AmbariException
- if stages can't 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, boolean useGeneratedConfigs, boolean useClusterHostInfo) throws org.apache.ambari.server.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 reconfigureduseGeneratedConfigs
- indicates whether or not the actual configs should be a part of the stageuseClusterHostInfo
- indicates whether or not the cluster topology info should be a part of the stageorg.apache.ambari.server.AmbariException
- if stages can't be createdpublic void validateServiceComponentHostRequest(ServiceComponentHostRequest request)
public String findServiceName(Cluster cluster, String componentName) throws org.apache.ambari.server.AmbariException
AmbariManagementController
findServiceName
in interface AmbariManagementController
cluster
- the cluster instancecomponentName
- the component name in String typeorg.apache.ambari.server.AmbariException
- if service name is null or emptypublic void deleteCluster(ClusterRequest request) throws org.apache.ambari.server.AmbariException
AmbariManagementController
deleteCluster
in interface AmbariManagementController
request
- the request object which identifies which cluster to deleteorg.apache.ambari.server.AmbariException
- thrown if the resource cannot be deletedpublic DeleteStatusMetaData deleteHostComponents(Set<ServiceComponentHostRequest> requests) throws org.apache.ambari.server.AmbariException, AuthorizationException
AmbariManagementController
deleteHostComponents
in interface AmbariManagementController
requests
- the request object which identifies which host component to deleteorg.apache.ambari.server.AmbariException
- thrown if the resource cannot be deletedAuthorizationException
public void deleteGroups(Set<GroupRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
deleteGroups
in interface AmbariManagementController
requests
- the groups to deleteorg.apache.ambari.server.AmbariException
- if the resources cannot be deletedpublic void deleteMembers(Set<MemberRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
deleteMembers
in interface AmbariManagementController
requests
- the members to deleteorg.apache.ambari.server.AmbariException
- if the resources cannot be deletedpublic void removeMpack(MpackEntity mpackEntity, StackEntity stackEntity) throws IOException
removeMpack
in interface AmbariManagementController
IOException
public Set<ServiceConfigVersionResponse> createServiceConfigVersion(Set<ServiceConfigVersionRequest> requests) throws org.apache.ambari.server.AmbariException, AuthorizationException
AmbariManagementController
createServiceConfigVersion
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
AuthorizationException
public Set<ClusterResponse> getClusters(Set<ClusterRequest> requests) throws org.apache.ambari.server.AmbariException, AuthorizationException
AmbariManagementController
getClusters
in interface AmbariManagementController
requests
- the request objects which identify the clusters to be returnedorg.apache.ambari.server.AmbariException
- thrown if the resource cannot be readAuthorizationException
- thrown if the authenticated user is not authorized to perform this operationpublic Set<ServiceComponentHostResponse> getHostComponents(Set<ServiceComponentHostRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getHostComponents
in interface AmbariManagementController
requests
- the request objects which identify the host components
to be returnedorg.apache.ambari.server.AmbariException
- thrown if the resource cannot be readpublic Set<ServiceComponentHostResponse> getHostComponents(Set<ServiceComponentHostRequest> requests, boolean statusOnly) throws org.apache.ambari.server.AmbariException
getHostComponents
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
public Set<ConfigurationResponse> getConfigurations(Set<ConfigurationRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getConfigurations
in interface AmbariManagementController
requests
- the request objectsorg.apache.ambari.server.AmbariException
- if the configurations could not be readpublic Set<ServiceConfigVersionResponse> getServiceConfigVersions(Set<ServiceConfigVersionRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getServiceConfigVersions
in interface AmbariManagementController
requests
- service config version requestsorg.apache.ambari.server.AmbariException
public Set<GroupResponse> getGroups(Set<GroupRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getGroups
in interface AmbariManagementController
requests
- the request objectsorg.apache.ambari.server.AmbariException
- if the groups could not be readpublic void updateGroups(Set<GroupRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
updateGroups
in interface AmbariManagementController
requests
- the groups to modifyorg.apache.ambari.server.AmbariException
- if the resources cannot be updatedprotected String getClientHostForRunningAction(Cluster cluster, Service service, ServiceComponent serviceComponent) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
protected ServiceComponent getClientComponentForRunningAction(Cluster cluster, Service service) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
protected void filterHostsForAction(Set<String> candidateHosts, Service service, Cluster cluster, Resource.Type level) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public List<String> selectHealthyHosts(Set<String> hostList) throws org.apache.ambari.server.AmbariException
HostState
is used to determine if a host is healthy.selectHealthyHosts
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
HostState#HEALTHY}
public String getHealthyHost(Set<String> hostList) throws org.apache.ambari.server.AmbariException
null
.
The host's HostState
is used to determine if a host is healthy.getHealthyHost
in interface AmbariManagementController
null
.org.apache.ambari.server.AmbariException
HostState#HEALTHY}
public RequestStatusResponse createAction(ExecuteActionRequest actionRequest, Map<String,String> requestProperties) throws org.apache.ambari.server.AmbariException
AmbariManagementController
createAction
in interface AmbariManagementController
actionRequest
- the request object which defines the action to be createdrequestProperties
- the request propertiesorg.apache.ambari.server.AmbariException
- thrown if the action cannot be createdpublic Set<StackResponse> getStacks(Set<StackRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getStacks
in interface AmbariManagementController
requests
- the stacksorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic RequestStatusResponse updateStacks() throws org.apache.ambari.server.AmbariException
AmbariManagementController
updateStacks
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
- ifpublic Set<ExtensionResponse> getExtensions(Set<ExtensionRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getExtensions
in interface AmbariManagementController
requests
- the extensionsorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic Set<ExtensionVersionResponse> getExtensionVersions(Set<ExtensionVersionRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getExtensionVersions
in interface AmbariManagementController
requests
- the extension versionsorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic Set<RepositoryResponse> getRepositories(Set<RepositoryRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getRepositories
in interface AmbariManagementController
requests
- the repositoriesorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic void verifyRepositories(Set<RepositoryRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
verifyRepositories
in interface AmbariManagementController
requests
- the repositoriesorg.apache.ambari.server.AmbariException
- if verification of any of urls failspublic Set<StackVersionResponse> getStackVersions(Set<StackVersionRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getStackVersions
in interface AmbariManagementController
requests
- the stacks versionsorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic Set<StackServiceResponse> getStackServices(Set<StackServiceRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getStackServices
in interface AmbariManagementController
requests
- the servicesorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic Set<StackConfigurationResponse> getStackLevelConfigurations(Set<StackLevelConfigurationRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getStackLevelConfigurations
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
public Set<StackConfigurationResponse> getStackConfigurations(Set<StackConfigurationRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getStackConfigurations
in interface AmbariManagementController
requests
- the configurationsorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic Set<StackServiceComponentResponse> getStackComponents(Set<StackServiceComponentRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getStackComponents
in interface AmbariManagementController
requests
- the componentsorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic Set<OperatingSystemResponse> getOperatingSystems(Set<OperatingSystemRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getOperatingSystems
in interface AmbariManagementController
requests
- the operating systemsorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic String getAuthName()
AmbariManagementController
getAuthName
in interface AmbariManagementController
public int getAuthId()
AmbariManagementController
getAuthId
in interface AmbariManagementController
public Set<RootServiceResponse> getRootServices(Set<RootServiceRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getRootServices
in interface AmbariManagementController
requests
- the top-level servicesorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic Set<RootServiceComponentResponse> getRootServiceComponents(Set<RootServiceComponentRequest> requests) throws org.apache.ambari.server.AmbariException
AmbariManagementController
getRootServiceComponents
in interface AmbariManagementController
requests
- the components of top-level servicesorg.apache.ambari.server.AmbariException
- if the resources cannot be readpublic Clusters getClusters()
AmbariManagementController
getClusters
in interface AmbariManagementController
public ConfigHelper getConfigHelper()
AmbariManagementController
getConfigHelper
in interface AmbariManagementController
public AmbariMetaInfo getAmbariMetaInfo()
AmbariManagementController
getAmbariMetaInfo
in interface AmbariManagementController
public ServiceComponentFactory getServiceComponentFactory()
AmbariManagementController
getServiceComponentFactory
in interface AmbariManagementController
public ConfigGroupFactory getConfigGroupFactory()
AmbariManagementController
getConfigGroupFactory
in interface AmbariManagementController
public RoleGraphFactory getRoleGraphFactory()
AmbariManagementController
getRoleGraphFactory
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
public boolean checkLdapConfigured()
AmbariManagementController
checkLdapConfigured
in interface AmbariManagementController
public LdapSyncDto getLdapSyncInfo() throws org.apache.ambari.server.AmbariException
AmbariManagementController
getLdapSyncInfo
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
- if LDAP is configured incorrectlypublic boolean isLdapSyncInProgress()
AmbariManagementController
isLdapSyncInProgress
in interface AmbariManagementController
public LdapBatchDto synchronizeLdapUsersAndGroups(LdapSyncRequest userRequest, LdapSyncRequest groupRequest) throws org.apache.ambari.server.AmbariException
AmbariManagementController
synchronizeLdapUsersAndGroups
in interface AmbariManagementController
userRequest
- users to be synchronizedgroupRequest
- groups to be synchronizedorg.apache.ambari.server.AmbariException
- if synchronization data was invalidpublic void initializeWidgetsAndLayouts(Cluster cluster, Service service) throws org.apache.ambari.server.AmbariException
AmbariManagementController
initializeWidgetsAndLayouts
in interface AmbariManagementController
cluster
- @Cluster objectservice
- @Service objectorg.apache.ambari.server.AmbariException
public TimelineMetricCacheProvider getTimelineMetricCacheProvider()
getTimelineMetricCacheProvider
in interface AmbariManagementController
public MetricPropertyProviderFactory getMetricPropertyProviderFactory()
MetricPropertyProviderFactory
that was injected into this
class. This is a terrible pattern.getMetricPropertyProviderFactory
in interface AmbariManagementController
MetricPropertyProviderFactory
public LoggingSearchPropertyProvider getLoggingSearchPropertyProvider()
AmbariManagementController
getLoggingSearchPropertyProvider
in interface AmbariManagementController
LoggingSearchPropertyProvider
public LoggingService getLoggingService(String clusterName)
AmbariManagementController
getLoggingService
in interface AmbariManagementController
clusterName
- the cluster name associated with this LoggingService instancepublic AmbariEventPublisher getAmbariEventPublisher()
AmbariEventPublisher
which can be used to send and receive
AmbariEvent
s.getAmbariEventPublisher
in interface AmbariManagementController
public KerberosHelper getKerberosHelper()
AmbariManagementController
getKerberosHelper
in interface AmbariManagementController
public CredentialStoreService getCredentialStoreService()
AmbariManagementController
getCredentialStoreService
in interface AmbariManagementController
public Map<String,String> getCredentialStoreServiceProperties()
public MetricsCollectorHAManager getMetricsCollectorHAManager()
AmbariManagementController
MetricsCollectorHAManager
which can be used to get/add collector host for a clustergetMetricsCollectorHAManager
in interface AmbariManagementController
MetricsCollectorHAManager
protected void validateAuthorizationToUpdateServiceUsersAndGroups(Cluster cluster, String configType, Map<String,String[]> propertyChanges) throws AuthorizationException
cluster
- the relevant clusterconfigType
- the changed configuration typepropertyChanges
- a map of the property changes for the relevant configuration typeAuthorizationException
- if the user is not authorized to perform this operationprotected void validateAuthorizationToManageServiceAutoStartConfiguration(Cluster cluster, String configType, Map<String,String[]> propertyChanges) throws AuthorizationException
cluster-env/recovery_enabled
is not changed. If it was, an
AuthorizationException
is thrown.cluster
- the relevant clusterconfigType
- the changed configuration typepropertyChanges
- a map of the property changes for the relevant configuration typeAuthorizationException
- if the user is not authorized to perform this operationpublic void deleteExtensionLink(ExtensionLinkRequest request) throws org.apache.ambari.server.AmbariException
deleteExtensionLink
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
- if we fail to unlink the extension from the stackpublic void createExtensionLink(ExtensionLinkRequest request) throws org.apache.ambari.server.AmbariException
createExtensionLink
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
- if we fail to link the extension to the stackpublic void updateExtensionLink(ExtensionLinkRequest request) throws org.apache.ambari.server.AmbariException
updateExtensionLink
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
- if we fail to link the extension to the stackpublic void updateExtensionLink(ExtensionLinkEntity oldLinkEntity, ExtensionLinkRequest newLinkRequest) throws org.apache.ambari.server.AmbariException
updateExtensionLink
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
- if we fail to link the extension to the stackpublic QuickLinkVisibilityController getQuicklinkVisibilityController()
getQuicklinkVisibilityController
in interface AmbariManagementController
public MetadataUpdateEvent getClustersMetadata() throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public MetadataUpdateEvent getClusterMetadata(Cluster cl) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public MetadataUpdateEvent getClusterMetadataOnConfigsUpdate(Cluster cl) throws org.apache.ambari.server.AmbariException
getClusterMetadataOnConfigsUpdate
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
public MetadataUpdateEvent getClusterMetadataOnRepoUpdate(Cluster cl) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public MetadataUpdateEvent getClusterMetadataOnServiceInstall(Cluster cl, String serviceName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public MetadataUpdateEvent getClusterMetadataOnServiceCredentialStoreUpdate(Cluster cl, String serviceName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public TreeMap<String,String> getTopologyComponentLevelParams(Long clusterId, String serviceName, String componentName, SecurityType clusterSecurityType) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Map<String,BlueprintProvisioningState> getBlueprintProvisioningStates(Long clusterId, Long hostId) throws org.apache.ambari.server.AmbariException
getBlueprintProvisioningStates
in interface AmbariManagementController
org.apache.ambari.server.AmbariException
public TreeMap<String,String> getTopologyCommandParams(Long clusterId, String serviceName, String componentName, ServiceComponentHost sch) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public TreeMap<String,String> getMetadataClusterLevelParams(Cluster cluster, StackId stackId) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public TreeMap<String,MetadataServiceInfo> getMetadataServiceLevelParams(Cluster cluster) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public TreeMap<String,MetadataServiceInfo> getMetadataServiceLevelParams(Service service) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
Copyright © 2022 Apache Software Foundation. All rights reserved.