public class AmbariMetaInfo extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ANY_OS
This string is used in placeholder in places that are common for
all operating systems or in situations where os type is not important.
|
static String |
KERBEROS_DESCRIPTOR_FILE_NAME
The filename for a Kerberos descriptor file at either the stack or service level
|
static String |
SCHEMA_VERSION_2
Version of XML files with support of custom services and custom commands
|
static String |
WIDGETS_DESCRIPTOR_FILE_NAME
The filename for a Widgets descriptor file at either the stack or service level
|
Constructor and Description |
---|
AmbariMetaInfo(Configuration conf)
Ambari Meta Info Object
|
Modifier and Type | Method and Description |
---|---|
void |
addActionDefinition(ActionDefinition ad)
Used for test purposes
|
ActionDefinition |
getActionDefinition(String name)
Get action definitions based on the supplied name
|
Set<AlertDefinition> |
getAlertDefinitions(ServiceInfo service)
Gets the alert definitions for the specified stack and service.
|
Set<AlertDefinition> |
getAlertDefinitions(String stackName,
String stackVersion,
String serviceName)
Gets the alert definitions for the specified stack and service.
|
List<ActionDefinition> |
getAllActionDefinition()
Get all action definitions
|
Map<String,String> |
getAmbariServerProperties() |
protected String |
getCommonKerberosDescriptorFileLocation()
Gets the path to the common Kerberos descriptor file
|
File |
getCommonWidgetsDescriptorFile() |
ComponentInfo |
getComponent(String stackName,
String version,
String serviceName,
String componentName) |
List<DependencyInfo> |
getComponentDependencies(String stackName,
String version,
String service,
String component)
Get all dependencies for a component.
|
DependencyInfo |
getComponentDependency(String stackName,
String version,
String service,
String component,
String dependencyName)
Obtain a specific dependency by name.
|
List<ComponentInfo> |
getComponentsByService(String stackName,
String version,
String serviceName)
Get components by service
|
String |
getComponentToService(String stackName,
String version,
String componentName)
Get the name of a service given the component name.
|
ConfigUpgradePack |
getConfigUpgradePack(String stackName,
String stackVersion)
Get all upgrade config pack if it is available for a stack.
|
ExtensionInfo |
getExtension(String extensionName,
String version) |
Collection<ExtensionInfo> |
getExtensions() |
Collection<ExtensionInfo> |
getExtensions(String extensionName) |
File |
getExtensionsRoot() |
KerberosServiceDescriptor[] |
getKerberosDescriptor(ServiceInfo serviceInfo)
Gets the requested service-level Kerberos descriptor(s)
An array of descriptors are returned since the kerberos.json in a service directory may contain
descriptor details for one or more services.
|
KerberosDescriptor |
getKerberosDescriptor(String stackName,
String stackVersion,
boolean includePreconfigureData)
Gets the fully compiled Kerberos descriptor for the relevant stack and version.
|
List<MetricDefinition> |
getMetrics(String stackName,
String stackVersion,
String serviceName,
String componentName,
String metricType)
Gets the metrics for a Role (component).
|
List<Module> |
getModules(Long mpackId)
Gets the module information for given mpack.
|
Collection<String> |
getMonitoringServiceNames(String stackName,
String version) |
Mpack |
getMpack(Long mpackId)
Fetch a particular mpack based on mpackid
|
MpackManager |
getMpackManager()
Obtain the underlying mpack manager.
|
Collection<Mpack> |
getMpacks() |
OperatingSystemInfo |
getOperatingSystem(String stackName,
String version,
String osType) |
Set<OperatingSystemInfo> |
getOperatingSystems(String stackName,
String version)
Lists operatingsystems supported by stack
|
Set<PropertyInfo> |
getPropertiesByName(String stackName,
String version,
String serviceName,
String propertyName) |
Set<String> |
getRackSensitiveServicesNames(String stackName,
String version)
Get the set of names of services which require restart when host rack information is changed.
|
List<RepositoryInfo> |
getRepositories(String stackName,
String version,
String osType) |
Map<String,List<RepositoryInfo>> |
getRepository(String stackName,
String version)
Gets repositories that are keyed by operating system type.
|
RepositoryInfo |
getRepository(String stackName,
String version,
String osType,
String repoId) |
Set<String> |
getRestartRequiredServicesNames(String stackName,
String version) |
String |
getServerVersion() |
ServiceInfo |
getService(Service service)
Convenience method to use stack id instead of separate name and version.
|
ServiceInfo |
getService(String stackName,
String version,
String serviceName) |
Map<String,Map<String,List<MetricDefinition>>> |
getServiceMetrics(String stackName,
String stackVersion,
String serviceName)
Return metrics for a stack service.
|
Set<PropertyInfo> |
getServiceProperties(String stackName,
String version,
String serviceName) |
Map<String,ServiceInfo> |
getServices(String stackName,
String version)
Given a stack name and version return all the services with info
|
StackInfo |
getStack(StackId stackId)
Convenience method to get stack info from a stack id
|
StackInfo |
getStack(String stackName,
String version) |
StackManager |
getStackManager()
Obtain the underlying stack manager.
|
List<String> |
getStackParentVersions(String stackName,
String version) |
Set<PropertyInfo> |
getStackProperties(String stackName,
String version) |
Set<PropertyInfo> |
getStackPropertiesByName(String stackName,
String version,
String propertyName) |
File |
getStackRoot() |
Collection<StackInfo> |
getStacks() |
Collection<StackInfo> |
getStacks(String stackName) |
Map<String,UpgradePack> |
getUpgradePacks(String stackName,
String stackVersion)
Get all upgrade packs available for a stack.
|
VersionDefinitionXml |
getVersionDefinition(String versionDefinitionId) |
Map<String,VersionDefinitionXml> |
getVersionDefinitions() |
void |
init()
Initialize the Ambari Meta Info
|
boolean |
isOsSupported(String osType) |
boolean |
isServiceRemovedInStack(String stackName,
String version,
String serviceName) |
boolean |
isServiceWithNoConfigs(String stackName,
String version,
String serviceName) |
boolean |
isSupportedStack(String stackName,
String version) |
boolean |
isValidService(String stackName,
String version,
String serviceName) |
boolean |
isValidServiceComponent(String stackName,
String version,
String serviceName,
String componentName) |
void |
reconcileAlertDefinitions(Cluster cluster,
boolean updateScriptPaths)
Compares the alert definitions defined on the stack with those in the
database and merges any new or updated definitions.
|
void |
reconcileAlertDefinitions(Clusters clusters,
boolean updateScriptPaths)
Compares the alert definitions defined on the stack with those in the
database and merges any new or updated definitions.
|
MpackResponse |
registerMpack(MpackRequest mpackRequest)
Calls the registerMpack method from mpackManager to support a POST /mpacks request
|
void |
removeMpack(MpackEntity mpackEntity,
StackEntity stackEntity)
Remove Mpack from the mpackMap and stackMap which is used to power the Mpack and Stack APIs.
|
public static final String ANY_OS
public static final String SCHEMA_VERSION_2
public static final String KERBEROS_DESCRIPTOR_FILE_NAME
public static final String WIDGETS_DESCRIPTOR_FILE_NAME
@Inject public AmbariMetaInfo(Configuration conf) throws Exception
conf
- Configuration API to be used.Exception
@Inject public void init() throws Exception
Exception
- throws exception if not able to parse the Meta data.public StackManager getStackManager()
public MpackManager getMpackManager()
public List<ComponentInfo> getComponentsByService(String stackName, String version, String serviceName) throws org.apache.ambari.server.AmbariException
stackName
- stack nameversion
- stack versionserviceName
- service nameorg.apache.ambari.server.AmbariException
public ComponentInfo getComponent(String stackName, String version, String serviceName, String componentName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public List<DependencyInfo> getComponentDependencies(String stackName, String version, String service, String component) throws org.apache.ambari.server.AmbariException
stackName
- stack nameversion
- stack versionservice
- service namecomponent
- component nameorg.apache.ambari.server.AmbariException
- if unable to obtain the dependencies for the componentpublic DependencyInfo getComponentDependency(String stackName, String version, String service, String component, String dependencyName) throws org.apache.ambari.server.AmbariException
stackName
- stack nameversion
- stack versionservice
- service namecomponent
- component namedependencyName
- dependency component nameorg.apache.ambari.server.AmbariException
- if unable to obtain the requested dependencypublic Map<String,List<RepositoryInfo>> getRepository(String stackName, String version) throws org.apache.ambari.server.AmbariException
stackName
- the stack nameversion
- the stack versionorg.apache.ambari.server.AmbariException
public List<RepositoryInfo> getRepositories(String stackName, String version, String osType) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public RepositoryInfo getRepository(String stackName, String version, String osType, String repoId) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public boolean isValidServiceComponent(String stackName, String version, String serviceName, String componentName)
public String getComponentToService(String stackName, String version, String componentName) throws org.apache.ambari.server.AmbariException
stackName
- the stack nameversion
- the stack versioncomponentName
- the component nameorg.apache.ambari.server.AmbariException
public Map<String,ServiceInfo> getServices(String stackName, String version) throws org.apache.ambari.server.AmbariException
stackName
- the stack nameversion
- the version of the stackorg.apache.ambari.server.AmbariException
public ServiceInfo getService(Service service) throws org.apache.ambari.server.AmbariException
service
- the service business objectorg.apache.ambari.server.AmbariException
public ServiceInfo getService(String stackName, String version, String serviceName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public boolean isServiceRemovedInStack(String stackName, String version, String serviceName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public boolean isServiceWithNoConfigs(String stackName, String version, String serviceName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Collection<String> getMonitoringServiceNames(String stackName, String version) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Set<String> getRestartRequiredServicesNames(String stackName, String version) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Set<String> getRackSensitiveServicesNames(String stackName, String version) throws org.apache.ambari.server.AmbariException
stackName
- the stack nameversion
- the stack versionorg.apache.ambari.server.AmbariException
- if the service set can not be acquiredpublic Collection<StackInfo> getStacks()
public MpackResponse registerMpack(MpackRequest mpackRequest) throws IOException, ResourceAlreadyExistsException
mpackRequest
- IOException
ResourceAlreadyExistsException
public List<Module> getModules(Long mpackId)
mpackId
- public Collection<StackInfo> getStacks(String stackName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public StackInfo getStack(StackId stackId) throws org.apache.ambari.server.AmbariException
stackId
- the stack idorg.apache.ambari.server.AmbariException
public StackInfo getStack(String stackName, String version) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Collection<ExtensionInfo> getExtensions()
public Collection<ExtensionInfo> getExtensions(String extensionName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public ExtensionInfo getExtension(String extensionName, String version) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Set<PropertyInfo> getServiceProperties(String stackName, String version, String serviceName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Set<PropertyInfo> getStackProperties(String stackName, String version) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Set<PropertyInfo> getPropertiesByName(String stackName, String version, String serviceName, String propertyName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Set<PropertyInfo> getStackPropertiesByName(String stackName, String version, String propertyName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Set<OperatingSystemInfo> getOperatingSystems(String stackName, String version) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public OperatingSystemInfo getOperatingSystem(String stackName, String version, String osType) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public List<ActionDefinition> getAllActionDefinition()
public ActionDefinition getActionDefinition(String name)
public void addActionDefinition(ActionDefinition ad) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public String getServerVersion()
public boolean isOsSupported(String osType)
public File getStackRoot()
public File getExtensionsRoot()
public Map<String,Map<String,List<MetricDefinition>>> getServiceMetrics(String stackName, String stackVersion, String serviceName) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public List<MetricDefinition> getMetrics(String stackName, String stackVersion, String serviceName, String componentName, String metricType) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public Set<AlertDefinition> getAlertDefinitions(String stackName, String stackVersion, String serviceName) throws org.apache.ambari.server.AmbariException
stackName
- the stack namestackVersion
- the stack versionserviceName
- the service namenull
).org.apache.ambari.server.AmbariException
public Set<AlertDefinition> getAlertDefinitions(ServiceInfo service) throws org.apache.ambari.server.AmbariException
service
- the service namenull
).org.apache.ambari.server.AmbariException
public void reconcileAlertDefinitions(Clusters clusters, boolean updateScriptPaths) throws org.apache.ambari.server.AmbariException
clusters
- all clustersupdateScriptPaths
- whether existing script-based alerts should be updated
with possibly new paths from the stack definitionorg.apache.ambari.server.AmbariException
public void reconcileAlertDefinitions(Cluster cluster, boolean updateScriptPaths) throws org.apache.ambari.server.AmbariException
cluster
- clusterupdateScriptPaths
- whether existing script-based alerts should be updated
with possibly new paths from the stack definitionorg.apache.ambari.server.AmbariException
public Map<String,UpgradePack> getUpgradePacks(String stackName, String stackVersion)
stackName
- the stack namestackVersion
- the stack versionpublic ConfigUpgradePack getConfigUpgradePack(String stackName, String stackVersion)
stackName
- the stack namestackVersion
- the stack versionpublic KerberosDescriptor getKerberosDescriptor(String stackName, String stackVersion, boolean includePreconfigureData) throws org.apache.ambari.server.AmbariException
stackName
- a String declaring the stack namestackVersion
- a String declaring the stack versionincludePreconfigureData
- a Boolean value indicating whether to include the pre-configuration
data (true
), or not (false
)org.apache.ambari.server.AmbariException
- if an error occurs reading or parsing the stack's kerberos.json filesprotected String getCommonKerberosDescriptorFileLocation()
public KerberosServiceDescriptor[] getKerberosDescriptor(ServiceInfo serviceInfo) throws org.apache.ambari.server.AmbariException
serviceInfo
- a ServiceInfo declaring the stack name, version, a service (directory) name
detailsorg.apache.ambari.server.AmbariException
- if an error occurs reading or parsing the service's kerberos.json filespublic VersionDefinitionXml getVersionDefinition(String versionDefinitionId)
versionDefinitionId
- the version definition idnull
if not foundpublic Map<String,VersionDefinitionXml> getVersionDefinitions()
public File getCommonWidgetsDescriptorFile()
public void removeMpack(MpackEntity mpackEntity, StackEntity stackEntity) throws IOException
mpackEntity
- stackEntity
- IOException
public Collection<Mpack> getMpacks()
Copyright © 2022 Apache Software Foundation. All rights reserved.