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, wait
getHostNames
@Inject public ClusterImpl(ClusterEntity clusterEntity, com.google.inject.Injector injector, AmbariEventPublisher eventPublisher) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void addConfigGroup(ConfigGroup configGroup) throws org.apache.ambari.server.AmbariException
Cluster
addConfigGroup
in interface Cluster
org.apache.ambari.server.AmbariException
public Map<Long,ConfigGroup> getConfigGroups()
Cluster
getConfigGroups
in interface Cluster
public Map<Long,ConfigGroup> getConfigGroupsByHostname(String hostname) throws org.apache.ambari.server.AmbariException
Cluster
getConfigGroupsByHostname
in interface Cluster
org.apache.ambari.server.AmbariException
public ConfigGroup getConfigGroupsById(Long configId)
Cluster
getConfigGroupsById
in interface Cluster
configId
- id of config group to returnpublic Map<Long,ConfigGroup> getConfigGroupsByServiceName(String serviceName)
Cluster
getConfigGroupsByServiceName
in interface Cluster
public void addRequestExecution(RequestExecution requestExecution) throws org.apache.ambari.server.AmbariException
Cluster
addRequestExecution
in interface Cluster
org.apache.ambari.server.AmbariException
public Map<Long,RequestExecution> getAllRequestExecutions()
Cluster
getAllRequestExecutions
in interface Cluster
public void deleteRequestExecution(Long id) throws org.apache.ambari.server.AmbariException
Cluster
deleteRequestExecution
in interface Cluster
org.apache.ambari.server.AmbariException
public void deleteConfigGroup(Long id) throws org.apache.ambari.server.AmbariException
Cluster
deleteConfigGroup
in interface Cluster
org.apache.ambari.server.AmbariException
public ServiceComponentHost getServiceComponentHost(String serviceName, String serviceComponentName, String hostname) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public List<ServiceComponentHost> getServiceComponentHosts()
Cluster
getServiceComponentHosts
in interface Cluster
public String getClusterName()
Cluster
getClusterName
in interface Cluster
public void setClusterName(String clusterName)
Cluster
setClusterName
in interface Cluster
public Long getResourceId()
Cluster
getResourceId
in interface Cluster
public void addServiceComponentHosts(Collection<ServiceComponentHost> serviceComponentHosts) throws org.apache.ambari.server.AmbariException
Cluster
addServiceComponentHosts
in interface Cluster
org.apache.ambari.server.AmbariException
public void addServiceComponentHost(ServiceComponentHost svcCompHost) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void removeServiceComponentHost(ServiceComponentHost svcCompHost) throws org.apache.ambari.server.AmbariException
Cluster
removeServiceComponentHost
in interface Cluster
org.apache.ambari.server.AmbariException
public long getClusterId()
Cluster
getClusterId
in interface Cluster
public List<ServiceComponentHost> getServiceComponentHosts(String hostname)
Cluster
getServiceComponentHosts
in interface Cluster
public 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 Cluster
public List<ServiceComponentHost> getServiceComponentHosts(String serviceName, String componentName)
Cluster
null
, all components for the requested service will be returned.getServiceComponentHosts
in interface Cluster
serviceName
- the name a the desired servicecomponentName
- the name a the desired component - null indicates all components for the servicepublic void addService(Service service)
Cluster
addService
in interface Cluster
public Service addService(String serviceName, RepositoryVersionEntity repositoryVersion) throws org.apache.ambari.server.AmbariException
addService
in interface Cluster
serviceName
- 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.AmbariException
public Service getService(String serviceName) throws org.apache.ambari.server.AmbariException
Cluster
getService
in interface Cluster
org.apache.ambari.server.AmbariException
public Map<String,Service> getServices()
Cluster
getServices
in interface Cluster
public Service getServiceByComponentName(String componentName) throws org.apache.ambari.server.AmbariException
Cluster
getServiceByComponentName
in interface Cluster
org.apache.ambari.server.AmbariException
public StackId getDesiredStackVersion()
Cluster
getDesiredStackVersion
in interface Cluster
public void setDesiredStackVersion(StackId stackId) throws org.apache.ambari.server.AmbariException
Cluster
setDesiredStackVersion
in interface Cluster
org.apache.ambari.server.AmbariException
public StackId getCurrentStackVersion()
Cluster
getCurrentStackVersion
in interface Cluster
public State getProvisioningState()
Cluster
getProvisioningState
in interface Cluster
State.INIT
or State.INSTALLED
, never
null
.public void setProvisioningState(State provisioningState)
Cluster
setProvisioningState
in interface Cluster
provisioningState
- the provisioning state, not null
.public SecurityType getSecurityType()
Cluster
getSecurityType
in interface Cluster
public void setSecurityType(SecurityType securityType)
Cluster
setSecurityType
in interface Cluster
securityType
- 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 Cluster
repoVersionEntity
- 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.AmbariException
public void setCurrentStackVersion(StackId stackId) throws org.apache.ambari.server.AmbariException
Cluster
setCurrentStackVersion
in interface Cluster
org.apache.ambari.server.AmbariException
public Map<String,Config> getConfigsByType(String configType)
Cluster
getConfigsByType
in interface Cluster
configType
- the config type to returnpublic Config getConfig(String configType, String versionTag)
Cluster
public List<Config> getLatestConfigsWithTypes(Collection<String> types)
Cluster
getLatestConfigsWithTypes
in interface Cluster
public Config getConfigByVersion(String configType, Long configVersion)
Cluster
getConfigByVersion
in interface Cluster
configType
- 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)
Cluster
public Collection<Config> getAllConfigs()
Cluster
getAllConfigs
in interface Cluster
public ClusterResponse convertToResponse() throws org.apache.ambari.server.AmbariException
Cluster
convertToResponse
in interface Cluster
org.apache.ambari.server.AmbariException
public void debugDump(StringBuilder sb)
Cluster
public void refresh()
Cluster
public void deleteAllServices() throws org.apache.ambari.server.AmbariException
Cluster
deleteAllServices
in interface Cluster
org.apache.ambari.server.AmbariException
public void deleteService(String serviceName, DeleteHostComponentStatusMetaData deleteMetaData) throws org.apache.ambari.server.AmbariException
Cluster
deleteService
in interface Cluster
org.apache.ambari.server.AmbariException
public boolean canBeRemoved()
Cluster
canBeRemoved
in interface Cluster
public void delete() throws org.apache.ambari.server.AmbariException
Cluster
protected void removeEntities() throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public ServiceConfigVersionResponse addDesiredConfig(String user, Set<Config> configs) throws org.apache.ambari.server.AmbariException
Cluster
addDesiredConfig
in interface Cluster
user
- 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.AmbariException
public ServiceConfigVersionResponse addDesiredConfig(String user, Set<Config> configs, String serviceConfigVersionNote) throws org.apache.ambari.server.AmbariException
Cluster
addDesiredConfig
in interface Cluster
user
- 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.AmbariException
public Map<String,Set<DesiredConfig>> getAllDesiredConfigVersions()
getAllDesiredConfigVersions
in interface Cluster
public Map<String,DesiredConfig> getDesiredConfigs()
Cluster
getDesiredConfigs
in interface Cluster
public Map<String,DesiredConfig> getDesiredConfigs(boolean cachedConfigEntities)
Cluster
getDesiredConfigs
in interface Cluster
cachedConfigEntities
- 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 Cluster
org.apache.ambari.server.AmbariException
public String getServiceForConfigTypes(Collection<String> configTypes)
getServiceForConfigTypes
in interface Cluster
public String getServiceByConfigType(String configType)
Cluster
getServiceByConfigType
in interface Cluster
configType
- 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
Cluster
setServiceConfigVersion
in interface Cluster
serviceName
- service nameversion
- service config versionuser
- the user making the change for audit purposesorg.apache.ambari.server.AmbariException
public Map<String,Collection<ServiceConfigVersionResponse>> getActiveServiceConfigVersions()
Cluster
getActiveServiceConfigVersions
in interface Cluster
public List<ServiceConfigVersionResponse> getServiceConfigVersions()
Cluster
getServiceConfigVersions
in interface Cluster
public List<ServiceConfigVersionResponse> getActiveServiceConfigVersionResponse(String serviceName)
Cluster
getActiveServiceConfigVersionResponse
in interface Cluster
serviceName
- service namepublic Config getDesiredConfigByType(String configType)
Cluster
getDesiredConfigByType
in interface Cluster
configType
- the type of configurationConfig
instance, or null
if the type has
not been set.public boolean isConfigTypeExists(String configType)
Cluster
isConfigTypeExists
in interface Cluster
configType
- the type of configurationtrue
if config type exists, else - false
public Map<Long,Map<String,DesiredConfig>> getHostsDesiredConfigs(Collection<Long> hostIds)
Cluster
getHostsDesiredConfigs
in interface Cluster
public Map<Long,Map<String,DesiredConfig>> getAllHostsDesiredConfigs()
Cluster
getAllHostsDesiredConfigs
in interface Cluster
public Long getNextConfigVersion(String type)
getNextConfigVersion
in interface Cluster
type
- config typepublic Map<ServiceComponentHostEvent,String> processServiceComponentHostEvents(com.google.common.collect.ListMultimap<String,ServiceComponentHostEvent> eventMap)
processServiceComponentHostEvents
in interface Cluster
eventMap
- 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)
Cluster
public Host getHost(String hostName)
Cluster
public Host getHost(Long hostId)
Cluster
public Collection<Host> getHosts()
Cluster
public boolean checkPermission(PrivilegeEntity privilegeEntity, boolean readOnly)
Cluster
checkPermission
in interface Cluster
privilegeEntity
- the privilegereadOnly
- indicate whether or not this check is for a read only operationpublic void addSessionAttributes(Map<String,Object> attributes)
Cluster
addSessionAttributes
in interface Cluster
attributes
- the session attributespublic void setSessionAttribute(String key, Object value)
Cluster
setSessionAttribute
in interface Cluster
key
- the name of the key which identifies the attribute in the mapvalue
- the value to setpublic void removeSessionAttribute(String key)
Cluster
removeSessionAttribute
in interface Cluster
key
- the name of the key which identifies the attribute in the mappublic Map<String,Object> getSessionAttributes()
Cluster
getSessionAttributes
in interface Cluster
protected AmbariSessionManager getSessionManager()
public void applyLatestConfigurations(StackId stackId, String serviceName)
applyLatestConfigurations
in interface Cluster
stackId
- 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 Cluster
configType
- the config type to returnpublic Map<PropertyInfo.PropertyType,Set<String>> getConfigPropertiesTypes(String configType, StackId stackId)
getConfigPropertiesTypes
in interface Cluster
configType
- the config type to returnstackId
- the stack to scan properties forpublic void removeConfigurations(StackId stackId, String serviceName)
removeConfigurations
in interface Cluster
stackId
- 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 Cluster
public ClusterEntity getClusterEntity()
getClusterEntity
in interface Cluster
public int getClusterSize()
getClusterSize
in interface Cluster
public 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 Cluster
null
if none.public void setUpgradeEntity(UpgradeEntity upgradeEntity) throws org.apache.ambari.server.AmbariException
setUpgradeEntity
in interface Cluster
upgradeEntity
- the upgrade entity to set for cluster, or null
for none.org.apache.ambari.server.AmbariException
public boolean isUpgradeSuspended()
isUpgradeSuspended
in interface Cluster
true
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 Cluster
propertyName
- 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 Cluster
null
).public void addSuspendedUpgradeParameters(Map<String,String> commandParams, Map<String,String> roleParams)
addSuspendedUpgradeParameters
in interface Cluster
commandParams
- 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 Cluster
public org.apache.ambari.spi.ClusterInformation buildClusterInformation()
ClusterInformation
instance from a Cluster
.buildClusterInformation
in interface Cluster
ClusterInformation
instance comprised of simple POJOs
and SPI classes.Copyright © 2022 Apache Software Foundation. All rights reserved.