| Constructor and Description |
|---|
ClusterImpl(ClusterEntity clusterEntity,
com.google.inject.Injector injector) |
| 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
|
void |
addServiceComponentHost(ServiceComponentHost svcCompHost) |
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
|
ServiceComponentHost |
getServiceComponentHost(String serviceName,
String serviceComponentName,
String hostname) |
List<ServiceComponentHost> |
getServiceComponentHosts(String hostname)
Get all ServiceComponentHosts on a given host
|
Map<String,Service> |
getServices()
Get all services
|
void |
loadServiceHostComponents()
Make sure we load all the service host components.
|
void |
refresh()
Refreshes the cluster details
|
protected void |
removeEntities() |
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
|
@Inject public ClusterImpl(ClusterEntity clusterEntity, com.google.inject.Injector injector)
public ReadWriteLock getClusterGlobalLock()
ClustergetClusterGlobalLock in interface Clusterpublic void loadServiceHostComponents()
public void addConfigGroup(ConfigGroup configGroup) throws AmbariException
ClusteraddConfigGroup in interface ClusterAmbariExceptionpublic Map<Long,ConfigGroup> getConfigGroups() throws AmbariException
ClustergetConfigGroups in interface ClusterAmbariExceptionpublic Map<Long,ConfigGroup> getConfigGroupsByHostname(String hostname) throws AmbariException
ClustergetConfigGroupsByHostname in interface ClusterAmbariExceptionpublic void addRequestExecution(RequestExecution requestExecution) throws AmbariException
ClusteraddRequestExecution in interface ClusterAmbariExceptionpublic Map<Long,RequestExecution> getAllRequestExecutions()
ClustergetAllRequestExecutions in interface Clusterpublic void deleteRequestExecution(Long id) throws AmbariException
ClusterdeleteRequestExecution in interface ClusterAmbariExceptionpublic void deleteConfigGroup(Long id) throws AmbariException
ClusterdeleteConfigGroup in interface ClusterAmbariExceptionpublic ServiceComponentHost getServiceComponentHost(String serviceName, String serviceComponentName, String hostname) throws AmbariException
AmbariExceptionpublic String getClusterName()
ClustergetClusterName in interface Clusterpublic void setClusterName(String clusterName)
ClustersetClusterName in interface Clusterpublic void addServiceComponentHost(ServiceComponentHost svcCompHost) throws AmbariException
AmbariExceptionpublic void removeServiceComponentHost(ServiceComponentHost svcCompHost) throws AmbariException
ClusterremoveServiceComponentHost in interface ClusterAmbariExceptionpublic long getClusterId()
ClustergetClusterId in interface Clusterpublic List<ServiceComponentHost> getServiceComponentHosts(String hostname)
ClustergetServiceComponentHosts in interface Clusterpublic void addService(Service service) throws AmbariException
ClusteraddService in interface ClusterAmbariExceptionpublic Service addService(String serviceName) throws AmbariException
ClusteraddService in interface ClusterAmbariExceptionpublic Service getService(String serviceName) throws AmbariException
ClustergetService in interface ClusterAmbariExceptionpublic Map<String,Service> getServices()
ClustergetServices in interface Clusterpublic StackId getDesiredStackVersion()
ClustergetDesiredStackVersion in interface Clusterpublic void setDesiredStackVersion(StackId stackVersion)
ClustersetDesiredStackVersion in interface Clusterpublic StackId getCurrentStackVersion()
ClustergetCurrentStackVersion in interface Clusterpublic void setCurrentStackVersion(StackId stackVersion) throws AmbariException
ClustersetCurrentStackVersion in interface ClusterAmbariExceptionpublic Map<String,Config> getConfigsByType(String configType)
ClustergetConfigsByType in interface ClusterconfigType - the config type to returnpublic Config getConfig(String configType, String versionTag)
Clusterpublic void addConfig(Config config)
Clusterpublic Collection<Config> getAllConfigs()
ClustergetAllConfigs in interface Clusterpublic ClusterResponse convertToResponse() throws AmbariException
ClusterconvertToResponse in interface ClusterAmbariExceptionpublic void debugDump(StringBuilder sb)
Clusterpublic void refresh()
Clusterpublic void deleteAllServices()
throws AmbariException
ClusterdeleteAllServices in interface ClusterAmbariExceptionpublic void deleteService(String serviceName) throws AmbariException
ClusterdeleteService in interface ClusterAmbariExceptionpublic boolean canBeRemoved()
ClustercanBeRemoved in interface Clusterpublic void delete()
throws AmbariException
Clusterdelete in interface ClusterAmbariExceptionprotected void removeEntities()
throws AmbariException
AmbariExceptionpublic boolean addDesiredConfig(String user, Config config)
ClusteraddDesiredConfig in interface Clusteruser - 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 currentpublic Map<String,DesiredConfig> getDesiredConfigs()
ClustergetDesiredConfigs in interface Clusterpublic Config getDesiredConfigByType(String configType)
ClustergetDesiredConfigByType in interface ClusterconfigType - the type of configurationConfig instance, or null if the type has
not been set.public Map<String,Map<String,DesiredConfig>> getHostsDesiredConfigs(Collection<String> hostnames)
ClustergetHostsDesiredConfigs in interface Clusterpublic Map<String,Map<String,DesiredConfig>> getAllHostsDesiredConfigs()
ClustergetAllHostsDesiredConfigs in interface ClusterCopyright © 2016. All rights reserved.