| Constructor and Description |
|---|
ClusterImpl(ClusterEntity clusterEntity,
com.google.inject.Injector injector,
AmbariEventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfig(Config config)
Sets a specific config.
|
void |
addConfigGroup(ConfigGroup configGroup)
Add a new config group to the set of Config groups associated with this
cluster
|
ServiceConfigVersionResponse |
addDesiredConfig(String user,
Set<Config> configs)
Adds and sets a DESIRED configuration to be applied to a cluster.
|
ServiceConfigVersionResponse |
addDesiredConfig(String user,
Set<Config> configs,
String serviceConfigVersionNote)
Adds and sets a DESIRED configuration to be applied to a cluster.
|
void |
addRequestExecution(RequestExecution requestExecution)
Add a @RequestExecution to the cluster
|
void |
addService(Service service)
Add a service to a cluster
|
Service |
addService(String serviceName,
RepositoryVersionEntity repositoryVersion)
Add service to the cluster
|
void |
addServiceComponentHost(ServiceComponentHost svcCompHost) |
void |
addServiceComponentHosts(Collection<ServiceComponentHost> serviceComponentHosts)
Adds schs to cluster AND persists them
TODO consider making persisting optional
|
void |
addSessionAttributes(Map<String,Object> attributes)
Add the given map of attributes to the session for this cluster.
|
void |
addSuspendedUpgradeParameters(Map<String,String> commandParams,
Map<String,String> roleParams)
Adds upgrade specific command and role parameters to the command maps if
there is a suspended upgrade.
|
void |
applyLatestConfigurations(StackId stackId,
String serviceName)
Makes the most recent configurations for the specified stack current.
|
org.apache.ambari.spi.ClusterInformation |
buildClusterInformation()
Builds a
ClusterInformation instance from a Cluster. |
boolean |
canBeRemoved()
Gets if the cluster can be deleted
|
boolean |
checkPermission(PrivilegeEntity privilegeEntity,
boolean readOnly)
Determine whether or not access to this cluster resource should be allowed based
on the given privilege.
|
ClusterResponse |
convertToResponse()
Creates a cluster response based on the current cluster definition
|
ServiceConfigVersionResponse |
createServiceConfigVersion(String serviceName,
String user,
String note,
ConfigGroup configGroup) |
void |
debugDump(StringBuilder sb)
Creates a debug dump based on the current cluster state
|
void |
delete()
Delete the cluster
|
void |
deleteAllServices()
Delete all the services associated with this cluster
|
void |
deleteConfigGroup(Long id)
Delete this config group identified by the config group id
|
void |
deleteRequestExecution(Long id)
Delete a @RequestExecution associated with the cluster
|
void |
deleteService(String serviceName,
DeleteHostComponentStatusMetaData deleteMetaData)
Delete the named service associated with this cluster
|
List<ServiceConfigVersionResponse> |
getActiveServiceConfigVersionResponse(String serviceName)
Get active service config version responses for all config groups of a service
|
Map<String,Collection<ServiceConfigVersionResponse>> |
getActiveServiceConfigVersions()
Get currently active service config versions for stack services
|
Collection<Config> |
getAllConfigs()
Gets all configurations defined for a cluster.
|
Map<String,Set<DesiredConfig>> |
getAllDesiredConfigVersions()
Gets all versions of the desired configurations for the cluster.
|
Map<Long,Map<String,DesiredConfig>> |
getAllHostsDesiredConfigs()
Fetch desired configs for all hosts in cluster
|
Map<Long,RequestExecution> |
getAllRequestExecutions()
Get all @RequestExecution objects associated with the cluster
|
ClusterEntity |
getClusterEntity()
|
long |
getClusterId()
Get the cluster ID
|
String |
getClusterName()
Get the Cluster Name
|
String |
getClusterProperty(String propertyName,
String defaultValue)
Gets the most recent value of
cluster-env/propertyName where
propertyName is the paramter specified to the method. |
int |
getClusterSize()
Returns the number of hosts that form the cluster.
|
Map<String,Map<String,String>> |
getComponentVersionMap()
Gets a mapping of service to component/version for every installed
component in the cluster which advertises a version and for which the
repository has been resolved.
|
Config |
getConfig(String configType,
String versionTag)
Gets the specific config that matches the specified type and tag.
|
Config |
getConfigByVersion(String configType,
Long configVersion)
Gets the specific config that matches the specified type and version.
|
Map<Long,ConfigGroup> |
getConfigGroups()
Get config groups associated with this cluster
|
Map<Long,ConfigGroup> |
getConfigGroupsByHostname(String hostname)
Find all config groups associated with the give hostname
|
ConfigGroup |
getConfigGroupsById(Long configId)
Find config group by config group id
|
Map<Long,ConfigGroup> |
getConfigGroupsByServiceName(String serviceName)
Find all config groups associated with the give service name
|
Map<PropertyInfo.PropertyType,Set<String>> |
getConfigPropertiesTypes(String configType)
Gets all properties types that matches the specified type for the current stack.
|
Map<PropertyInfo.PropertyType,Set<String>> |
getConfigPropertiesTypes(String configType,
StackId stackId)
Gets all properties types that matches the specified type for the given stack.
|
Map<String,Config> |
getConfigsByType(String configType)
Gets all configs that match the specified type.
|
StackId |
getCurrentStackVersion()
Get current stack version
|
Config |
getDesiredConfigByType(String configType)
Gets the desired (and selected) config by type.
|
Map<String,DesiredConfig> |
getDesiredConfigs()
Gets the active desired configurations for the cluster.
|
Map<String,DesiredConfig> |
getDesiredConfigs(boolean cachedConfigEntities)
Gets the active desired configurations for the cluster.
|
StackId |
getDesiredStackVersion()
Get desired stack version
|
Host |
getHost(Long hostId)
Get specific host info using host id.
|
Host |
getHost(String hostName)
Get specific host info using host name.
|
Collection<Host> |
getHosts()
Get all hosts associated with this cluster.
|
Set<String> |
getHosts(String serviceName,
String componentName)
Get all of the hosts running the provided service and component.
|
Map<Long,Map<String,DesiredConfig>> |
getHostsDesiredConfigs(Collection<Long> hostIds)
Fetch desired configs for list of hosts in cluster
|
List<Config> |
getLatestConfigsWithTypes(Collection<String> types)
Get latest (including inactive ones) configurations with any of the given types.
|
Long |
getNextConfigVersion(String type)
Get next version of specified config type
|
State |
getProvisioningState()
Gets whether the cluster is still initializing or has finished with its
deployment requests.
|
Long |
getResourceId()
Gets the Cluster's resource ID
|
RoleCommandOrder |
getRoleCommandOrder()
Gets a new instance of a
RoleCommandOrder for this cluster. |
SecurityType |
getSecurityType()
Gets the cluster's security type.
|
Service |
getService(String serviceName)
Get a service
|
Service |
getServiceByComponentName(String componentName)
Gets a service from the given component name.
|
String |
getServiceByConfigType(String configType)
Returns the name of the service that the passed config type belongs to.
|
ServiceComponentHost |
getServiceComponentHost(String serviceName,
String serviceComponentName,
String hostname) |
Map<String,Set<String>> |
getServiceComponentHostMap(Set<String> hostNames,
Set<String> serviceNames)
Gets a map of components to hosts they are installed on.
|
List<ServiceComponentHost> |
getServiceComponentHosts()
Get all ServiceComponentHosts for this cluster.
|
List<ServiceComponentHost> |
getServiceComponentHosts(String hostname)
Get all ServiceComponentHosts on a given host
|
List<ServiceComponentHost> |
getServiceComponentHosts(String serviceName,
String componentName)
Get all ServiceComponentHosts for a given service and optional component
If the component name is
null, all components for the requested service will be returned. |
List<ServiceConfigVersionResponse> |
getServiceConfigVersions()
Get service config version history
|
String |
getServiceForConfigTypes(Collection<String> configTypes) |
Map<String,Service> |
getServices()
Get all services
|
Map<String,Object> |
getSessionAttributes()
Get the map of session attributes for this cluster.
|
protected AmbariSessionManager |
getSessionManager()
Get the associated session manager.
|
UpgradeEntity |
getUpgradeInProgress()
Gets an
UpgradeEntity if there is an upgrade in progress or an
upgrade that has been suspended. |
void |
handleClusterEnvConfigChangedEvent(ClusterConfigChangedEvent event)
Handles
ClusterConfigChangedEvent which means that the
{{cluster-env}} may have changed. |
boolean |
isBluePrintDeployed()
Returns whether this cluster was provisioned by a Blueprint or not.
|
boolean |
isConfigTypeExists(String configType)
Check if config type exists in cluster.
|
boolean |
isUpgradeSuspended()
Gets whether there is an upgrade which has been suspended and not yet
finalized.
|
void |
onClusterProvisioned(ClusterProvisionedEvent event) |
Map<ServiceComponentHostEvent,String> |
processServiceComponentHostEvents(com.google.common.collect.ListMultimap<String,ServiceComponentHostEvent> eventMap)
Bulk handle service component host events
|
protected Map<ServiceComponentHostEvent,String> |
processServiceComponentHostEventsInSingleTransaction(com.google.common.collect.ListMultimap<String,ServiceComponentHostEvent> eventMap)
Bulk handle service component host events, wrapping all handling in a
single transaction.
|
void |
refresh()
Refreshes the cluster details
|
void |
removeConfigurations(StackId stackId,
String serviceName)
Removes all configurations for the specified service and stack.
|
protected void |
removeEntities() |
void |
removeServiceComponentHost(ServiceComponentHost svcCompHost)
Remove ServiceComponentHost from cluster
|
void |
removeSessionAttribute(String key)
Removes an attribute from the session for this cluster
|
List<String> |
serviceNameByConfigType(String configType) |
void |
setClusterName(String clusterName)
Set the Cluster Name
|
void |
setCurrentStackVersion(StackId stackId)
Set current stack version
|
void |
setDesiredStackVersion(StackId stackId)
Set desired stack version
|
void |
setProvisioningState(State provisioningState)
Sets the provisioning state of the cluster.
|
void |
setSecurityType(SecurityType securityType)
Sets this Cluster's security type.
|
ServiceConfigVersionResponse |
setServiceConfigVersion(String serviceName,
Long version,
String user,
String note)
Apply specified service config version (rollback)
|
void |
setSessionAttribute(String key,
Object value)
Sets or adds an attribute in the session for this cluster
|
void |
setUpgradeEntity(UpgradeEntity upgradeEntity)
Sets or clears the associated upgrade with the cluster.
|
List<Host> |
transitionHostsToInstalling(RepositoryVersionEntity repoVersionEntity,
VersionDefinitionXml versionDefinitionXml,
boolean forceInstalled)
Creates or updates host versions for all of the hosts within a cluster
based on state of cluster stack version.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHostNames@Inject public ClusterImpl(ClusterEntity clusterEntity, com.google.inject.Injector injector, AmbariEventPublisher eventPublisher) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariExceptionpublic void addConfigGroup(ConfigGroup configGroup) throws org.apache.ambari.server.AmbariException
ClusteraddConfigGroup in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic Map<Long,ConfigGroup> getConfigGroups()
ClustergetConfigGroups in interface Clusterpublic Map<Long,ConfigGroup> getConfigGroupsByHostname(String hostname) throws org.apache.ambari.server.AmbariException
ClustergetConfigGroupsByHostname in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic ConfigGroup getConfigGroupsById(Long configId)
ClustergetConfigGroupsById in interface ClusterconfigId - id of config group to returnpublic Map<Long,ConfigGroup> getConfigGroupsByServiceName(String serviceName)
ClustergetConfigGroupsByServiceName in interface Clusterpublic void addRequestExecution(RequestExecution requestExecution) throws org.apache.ambari.server.AmbariException
ClusteraddRequestExecution in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic Map<Long,RequestExecution> getAllRequestExecutions()
ClustergetAllRequestExecutions in interface Clusterpublic void deleteRequestExecution(Long id) throws org.apache.ambari.server.AmbariException
ClusterdeleteRequestExecution in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic void deleteConfigGroup(Long id) throws org.apache.ambari.server.AmbariException
ClusterdeleteConfigGroup in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic ServiceComponentHost getServiceComponentHost(String serviceName, String serviceComponentName, String hostname) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariExceptionpublic List<ServiceComponentHost> getServiceComponentHosts()
ClustergetServiceComponentHosts in interface Clusterpublic String getClusterName()
ClustergetClusterName in interface Clusterpublic void setClusterName(String clusterName)
ClustersetClusterName in interface Clusterpublic Long getResourceId()
ClustergetResourceId in interface Clusterpublic void addServiceComponentHosts(Collection<ServiceComponentHost> serviceComponentHosts) throws org.apache.ambari.server.AmbariException
ClusteraddServiceComponentHosts in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic void addServiceComponentHost(ServiceComponentHost svcCompHost) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariExceptionpublic void removeServiceComponentHost(ServiceComponentHost svcCompHost) throws org.apache.ambari.server.AmbariException
ClusterremoveServiceComponentHost in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic long getClusterId()
ClustergetClusterId in interface Clusterpublic List<ServiceComponentHost> getServiceComponentHosts(String hostname)
ClustergetServiceComponentHosts in interface Clusterpublic Map<String,Set<String>> getServiceComponentHostMap(Set<String> hostNames, Set<String> serviceNames)
Cluster
This may may be filtered by host and/or service by optionally providing a set of hostname
and/or service names to use as a filter. null for either filter indicates no
filter (or all), an empty set indicates a complete filter (or none).
getServiceComponentHostMap in interface Clusterpublic List<ServiceComponentHost> getServiceComponentHosts(String serviceName, String componentName)
Clusternull, all components for the requested service will be returned.getServiceComponentHosts in interface ClusterserviceName - the name a the desired servicecomponentName - the name a the desired component - null indicates all components for the servicepublic void addService(Service service)
ClusteraddService in interface Clusterpublic Service addService(String serviceName, RepositoryVersionEntity repositoryVersion) throws org.apache.ambari.server.AmbariException
addService in interface ClusterserviceName - the name of the service to add (not null).repositoryVersion - the repository from which the service should be installed (not
null).org.apache.ambari.server.AmbariExceptionpublic Service getService(String serviceName) throws org.apache.ambari.server.AmbariException
ClustergetService in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic Map<String,Service> getServices()
ClustergetServices in interface Clusterpublic Service getServiceByComponentName(String componentName) throws org.apache.ambari.server.AmbariException
ClustergetServiceByComponentName in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic StackId getDesiredStackVersion()
ClustergetDesiredStackVersion in interface Clusterpublic void setDesiredStackVersion(StackId stackId) throws org.apache.ambari.server.AmbariException
ClustersetDesiredStackVersion in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic StackId getCurrentStackVersion()
ClustergetCurrentStackVersion in interface Clusterpublic State getProvisioningState()
ClustergetProvisioningState in interface ClusterState.INIT or State.INSTALLED, never
null.public void setProvisioningState(State provisioningState)
ClustersetProvisioningState in interface ClusterprovisioningState - the provisioning state, not null.public SecurityType getSecurityType()
ClustergetSecurityType in interface Clusterpublic void setSecurityType(SecurityType securityType)
ClustersetSecurityType in interface ClustersecurityType - a SecurityType to setpublic List<Host> transitionHostsToInstalling(RepositoryVersionEntity repoVersionEntity, VersionDefinitionXml versionDefinitionXml, boolean forceInstalled) throws org.apache.ambari.server.AmbariException
RepositoryVersionState.INSTALLING).
Hosts that are in maintenance mode will be transitioned directly into
RepositoryVersionState.OUT_OF_SYNC instead. Hosts which do not need
the version distributed to them will move into the
RepositoryVersionState.NOT_REQUIRED state.transitionHostsToInstalling in interface ClusterrepoVersionEntity - the repository that the hosts are being transitioned for (not
null).versionDefinitionXml - the VDF, or null if none.forceInstalled - if true, then this will transition everything directly to
RepositoryVersionState.INSTALLED instead of
RepositoryVersionState.INSTALLING. Hosts which should
received other states (like
RepositoryVersionState.NOT_REQUIRED will continue to
receive those states.org.apache.ambari.server.AmbariExceptionpublic void setCurrentStackVersion(StackId stackId) throws org.apache.ambari.server.AmbariException
ClustersetCurrentStackVersion in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic Map<String,Config> getConfigsByType(String configType)
ClustergetConfigsByType in interface ClusterconfigType - the config type to returnpublic Config getConfig(String configType, String versionTag)
Clusterpublic List<Config> getLatestConfigsWithTypes(Collection<String> types)
ClustergetLatestConfigsWithTypes in interface Clusterpublic Config getConfigByVersion(String configType, Long configVersion)
ClustergetConfigByVersion in interface ClusterconfigType - the config type to findconfigVersion - the config version to findConfig object, or null if the specific type
and version have not been set.public void addConfig(Config config)
Clusterpublic Collection<Config> getAllConfigs()
ClustergetAllConfigs in interface Clusterpublic ClusterResponse convertToResponse() throws org.apache.ambari.server.AmbariException
ClusterconvertToResponse in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic void debugDump(StringBuilder sb)
Clusterpublic void refresh()
Clusterpublic void deleteAllServices()
throws org.apache.ambari.server.AmbariException
ClusterdeleteAllServices in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic void deleteService(String serviceName, DeleteHostComponentStatusMetaData deleteMetaData) throws org.apache.ambari.server.AmbariException
ClusterdeleteService in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic boolean canBeRemoved()
ClustercanBeRemoved in interface Clusterpublic void delete()
throws org.apache.ambari.server.AmbariException
Clusterprotected void removeEntities()
throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariExceptionpublic ServiceConfigVersionResponse addDesiredConfig(String user, Set<Config> configs) throws org.apache.ambari.server.AmbariException
ClusteraddDesiredConfig in interface Clusteruser - the user making the change for audit purposesconfigs - the set of Config objects to set as desiredtrue if the config was added, or false
if the config is already set as the currentorg.apache.ambari.server.AmbariExceptionpublic ServiceConfigVersionResponse addDesiredConfig(String user, Set<Config> configs, String serviceConfigVersionNote) throws org.apache.ambari.server.AmbariException
ClusteraddDesiredConfig in interface Clusteruser - the user making the change for audit purposesconfigs - the set of Config objects to set as desiredserviceConfigVersionNote - note to attach to service config version if createdtrue if the config was added, or false
if the config is already set as the currentorg.apache.ambari.server.AmbariExceptionpublic Map<String,Set<DesiredConfig>> getAllDesiredConfigVersions()
getAllDesiredConfigVersions in interface Clusterpublic Map<String,DesiredConfig> getDesiredConfigs()
ClustergetDesiredConfigs in interface Clusterpublic Map<String,DesiredConfig> getDesiredConfigs(boolean cachedConfigEntities)
ClustergetDesiredConfigs in interface ClustercachedConfigEntities - retrieves cluster config entities from the cache if true, otherwise from the DB directly.public ServiceConfigVersionResponse createServiceConfigVersion(String serviceName, String user, String note, ConfigGroup configGroup) throws org.apache.ambari.server.AmbariException
createServiceConfigVersion in interface Clusterorg.apache.ambari.server.AmbariExceptionpublic String getServiceForConfigTypes(Collection<String> configTypes)
getServiceForConfigTypes in interface Clusterpublic String getServiceByConfigType(String configType)
ClustergetServiceByConfigType in interface ClusterconfigType - the config type to look up the service bypublic ServiceConfigVersionResponse setServiceConfigVersion(String serviceName, Long version, String user, String note) throws org.apache.ambari.server.AmbariException
ClustersetServiceConfigVersion in interface ClusterserviceName - service nameversion - service config versionuser - the user making the change for audit purposesorg.apache.ambari.server.AmbariExceptionpublic Map<String,Collection<ServiceConfigVersionResponse>> getActiveServiceConfigVersions()
ClustergetActiveServiceConfigVersions in interface Clusterpublic List<ServiceConfigVersionResponse> getServiceConfigVersions()
ClustergetServiceConfigVersions in interface Clusterpublic List<ServiceConfigVersionResponse> getActiveServiceConfigVersionResponse(String serviceName)
ClustergetActiveServiceConfigVersionResponse in interface ClusterserviceName - service namepublic Config getDesiredConfigByType(String configType)
ClustergetDesiredConfigByType in interface ClusterconfigType - the type of configurationConfig instance, or null if the type has
not been set.public boolean isConfigTypeExists(String configType)
ClusterisConfigTypeExists in interface ClusterconfigType - the type of configurationtrue if config type exists, else - falsepublic Map<Long,Map<String,DesiredConfig>> getHostsDesiredConfigs(Collection<Long> hostIds)
ClustergetHostsDesiredConfigs in interface Clusterpublic Map<Long,Map<String,DesiredConfig>> getAllHostsDesiredConfigs()
ClustergetAllHostsDesiredConfigs in interface Clusterpublic Long getNextConfigVersion(String type)
getNextConfigVersion in interface Clustertype - config typepublic Map<ServiceComponentHostEvent,String> processServiceComponentHostEvents(com.google.common.collect.ListMultimap<String,ServiceComponentHostEvent> eventMap)
processServiceComponentHostEvents in interface ClustereventMap - serviceName - event mappingprotected Map<ServiceComponentHostEvent,String> processServiceComponentHostEventsInSingleTransaction(com.google.common.collect.ListMultimap<String,ServiceComponentHostEvent> eventMap)
processServiceComponentHostEvents(ListMultimap) to lock around the
AoP Transactional annotation so that the lock is not released
before the transaction is committed.eventMap - public Set<String> getHosts(String serviceName, String componentName)
Clusterpublic Host getHost(String hostName)
Clusterpublic Host getHost(Long hostId)
Clusterpublic Collection<Host> getHosts()
Clusterpublic boolean checkPermission(PrivilegeEntity privilegeEntity, boolean readOnly)
ClustercheckPermission in interface ClusterprivilegeEntity - the privilegereadOnly - indicate whether or not this check is for a read only operationpublic void addSessionAttributes(Map<String,Object> attributes)
ClusteraddSessionAttributes in interface Clusterattributes - the session attributespublic void setSessionAttribute(String key, Object value)
ClustersetSessionAttribute in interface Clusterkey - the name of the key which identifies the attribute in the mapvalue - the value to setpublic void removeSessionAttribute(String key)
ClusterremoveSessionAttribute in interface Clusterkey - the name of the key which identifies the attribute in the mappublic Map<String,Object> getSessionAttributes()
ClustergetSessionAttributes in interface Clusterprotected AmbariSessionManager getSessionManager()
public void applyLatestConfigurations(StackId stackId, String serviceName)
applyLatestConfigurations in interface ClusterstackId - the stack to use when finding the latest configurations (not
null).serviceName - the service to modify configurations for (not null).public Map<PropertyInfo.PropertyType,Set<String>> getConfigPropertiesTypes(String configType)
getConfigPropertiesTypes in interface ClusterconfigType - the config type to returnpublic Map<PropertyInfo.PropertyType,Set<String>> getConfigPropertiesTypes(String configType, StackId stackId)
getConfigPropertiesTypes in interface ClusterconfigType - the config type to returnstackId - the stack to scan properties forpublic void removeConfigurations(StackId stackId, String serviceName)
removeConfigurations in interface ClusterstackId - the stack to use when finding the configurations to remove (not
null).serviceName - the service to rmeove configurations for (not null).public boolean isBluePrintDeployed()
isBluePrintDeployed in interface Clusterpublic ClusterEntity getClusterEntity()
getClusterEntity in interface Clusterpublic int getClusterSize()
getClusterSize in interface Clusterpublic UpgradeEntity getUpgradeInProgress()
UpgradeEntity if there is an upgrade in progress or an
upgrade that has been suspended. This will return the associated
UpgradeEntity if it exists.getUpgradeInProgress in interface Clusternull if none.public void setUpgradeEntity(UpgradeEntity upgradeEntity) throws org.apache.ambari.server.AmbariException
setUpgradeEntity in interface ClusterupgradeEntity - the upgrade entity to set for cluster, or null for none.org.apache.ambari.server.AmbariExceptionpublic boolean isUpgradeSuspended()
isUpgradeSuspended in interface Clustertrue if the last upgrade is suspendedpublic String getClusterProperty(String propertyName, String defaultValue)
cluster-env/propertyName where
propertyName is the paramter specified to the method. This will use
the desired configuration for cluster-env.
The value is cached on this Cluster instance, so subsequent calls
will not inclur a lookup penalty. This class also responds to
ClusterConfigChangedEvent in order to clear the cache.getClusterProperty in interface ClusterpropertyName - the property to lookup in cluster-env (not null).defaultValue - a default value to cache return if none exists (may be
null).public void handleClusterEnvConfigChangedEvent(ClusterConfigChangedEvent event)
ClusterConfigChangedEvent which means that the
{{cluster-env}} may have changed.event - the change event.public void onClusterProvisioned(ClusterProvisionedEvent event)
public RoleCommandOrder getRoleCommandOrder()
RoleCommandOrder for this cluster.getRoleCommandOrder in interface Clusternull).public void addSuspendedUpgradeParameters(Map<String,String> commandParams, Map<String,String> roleParams)
addSuspendedUpgradeParameters in interface ClustercommandParams - the command parameter map to supplement (not null).roleParams - the role parameter map to supplement (not null).public Map<String,Map<String,String>> getComponentVersionMap()
getComponentVersionMap in interface Clusterpublic org.apache.ambari.spi.ClusterInformation buildClusterInformation()
ClusterInformation instance from a Cluster.buildClusterInformation in interface ClusterClusterInformation instance comprised of simple POJOs
and SPI classes.Copyright © 2022 Apache Software Foundation. All rights reserved.