public interface Cluster
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
|
boolean |
addDesiredConfig(String user,
Config config)
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)
Add service to the cluster
|
boolean |
canBeRemoved()
Gets if the cluster can be deleted
|
ClusterResponse |
convertToResponse()
Creates a cluster response based on the current cluster definition
|
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)
Delete the named service associated with this cluster
|
Collection<Config> |
getAllConfigs()
Gets all configurations defined for a cluster.
|
Map<String,Map<String,DesiredConfig>> |
getAllHostsDesiredConfigs()
Fetch desired configs for all hosts in cluster
|
Map<Long,RequestExecution> |
getAllRequestExecutions()
Get all @RequestExecution objects associated with the cluster
|
ReadWriteLock |
getClusterGlobalLock()
Get lock to control access to cluster structure
|
long |
getClusterId()
Get the cluster ID
|
String |
getClusterName()
Get the Cluster Name
|
Config |
getConfig(String configType,
String versionTag)
Gets the specific config that matches the specified type and tag.
|
Map<Long,ConfigGroup> |
getConfigGroups()
Get all config groups associated with this cluster
|
Map<Long,ConfigGroup> |
getConfigGroupsByHostname(String hostname)
Find all config groups associated with the give hostname
|
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 desired configurations for the cluster.
|
StackId |
getDesiredStackVersion()
Get desired stack version
|
Map<String,Map<String,DesiredConfig>> |
getHostsDesiredConfigs(Collection<String> hostnames)
Fetch desired configs for list of hosts in cluster
|
Service |
getService(String serviceName)
Get a service
|
List<ServiceComponentHost> |
getServiceComponentHosts(String hostname)
Get all ServiceComponentHosts on a given host
|
Map<String,Service> |
getServices()
Get all services
|
void |
refresh()
Refreshes the cluster details
|
void |
removeServiceComponentHost(ServiceComponentHost svcCompHost)
Remove ServiceComponentHost from cluster
|
void |
setClusterName(String clusterName)
Set the Cluster Name
|
void |
setCurrentStackVersion(StackId stackVersion)
Set current stack version
|
void |
setDesiredStackVersion(StackId stackVersion)
Set desired stack version
|
long getClusterId()
String getClusterName()
void setClusterName(String clusterName)
void addService(Service service) throws AmbariException
service
- AmbariException
Service getService(String serviceName) throws AmbariException
serviceName
- AmbariException
List<ServiceComponentHost> getServiceComponentHosts(String hostname)
hostname
- void removeServiceComponentHost(ServiceComponentHost svcCompHost) throws AmbariException
ServiceComponentHost
- AmbariException
StackId getDesiredStackVersion()
void setDesiredStackVersion(StackId stackVersion)
stackVersion
- StackId getCurrentStackVersion()
void setCurrentStackVersion(StackId stackVersion) throws AmbariException
stackVersion
- AmbariException
Map<String,Config> getConfigsByType(String configType)
configType
- the config type to returnConfig getConfig(String configType, String versionTag)
configType
- the config type to findversionTag
- the config version to findConfig
object, or null
if the specific type
and version have not been set.void addConfig(Config config)
config
- the config instance to addCollection<Config> getAllConfigs()
boolean addDesiredConfig(String user, Config config)
user
- the user making the change for audit purposesconfig
- the Config
object to set as desiredtrue
if the config was added, or false
if the config is already set as the currentConfig getDesiredConfigByType(String configType)
configType
- the type of configurationConfig
instance, or null
if the type has
not been set.Map<String,DesiredConfig> getDesiredConfigs()
ClusterResponse convertToResponse() throws AmbariException
AmbariException
void refresh()
void debugDump(StringBuilder sb)
sb
- void deleteAllServices() throws AmbariException
AmbariException
void deleteService(String serviceName) throws AmbariException
serviceName
- AmbariException
boolean canBeRemoved()
void delete() throws AmbariException
AmbariException
Service addService(String serviceName) throws AmbariException
serviceName
- AmbariException
ReadWriteLock getClusterGlobalLock()
Map<String,Map<String,DesiredConfig>> getHostsDesiredConfigs(Collection<String> hostnames)
hostnames
- Map<String,Map<String,DesiredConfig>> getAllHostsDesiredConfigs()
void addConfigGroup(ConfigGroup configGroup) throws AmbariException
configGroup
- AmbariException
Map<Long,ConfigGroup> getConfigGroups() throws AmbariException
AmbariException
void deleteConfigGroup(Long id) throws AmbariException
id
- AmbariException
Map<Long,ConfigGroup> getConfigGroupsByHostname(String hostname) throws AmbariException
hostname
- AmbariException
void addRequestExecution(RequestExecution requestExecution) throws AmbariException
requestExecution
- AmbariException
Map<Long,RequestExecution> getAllRequestExecutions()
void deleteRequestExecution(Long id) throws AmbariException
id
- AmbariException
Copyright © 2017. All rights reserved.