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 FilenameFilter |
FILENAME_FILTER |
static String |
RCO_FILE_NAME |
static String |
SCHEMA_VERSION_2
Version of XML files with support of custom services and custom commands
|
static String |
SCHEMA_VERSION_LEGACY
Value for legacy xml files that don't contain schema property
|
static String |
SERVICE_CONFIG_FILE_NAME_POSTFIX |
static String |
SERVICE_CONFIG_FOLDER_NAME |
static String |
SERVICE_METAINFO_FILE_NAME |
static String |
SERVICE_METRIC_FILE_NAME |
static String |
SERVICES_FOLDER_NAME |
static String |
STACK_METAINFO_FILE_NAME |
| Constructor and Description |
|---|
AmbariMetaInfo(Configuration conf)
Ambari Meta Info Object
|
AmbariMetaInfo(File stackRoot,
File serverVersionFile) |
| 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
|
List<ActionDefinition> |
getAllActionDefinition()
Get all action definitions
|
ComponentInfo |
getComponent(String stackName,
String version,
String serviceName,
String componentName) |
ComponentInfo |
getComponentCategory(String stackName,
String version,
String serviceName,
String componentName)
Get component category
|
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.
|
List<MetricDefinition> |
getMetrics(String stackName,
String stackVersion,
String serviceName,
String componentName,
String metricType)
Gets the metrics for a Role (component).
|
OperatingSystemInfo |
getOperatingSystem(String stackName,
String version,
String osType) |
Set<OperatingSystemInfo> |
getOperatingSystems(String stackName,
String version)
Lists operatingsystems supported by stack
|
Set<PropertyInfo> |
getProperties(String stackName,
String version,
String serviceName) |
PropertyInfo |
getProperty(String stackName,
String version,
String serviceName,
String propertyName) |
List<RepositoryInfo> |
getRepositories(String stackName,
String version,
String osType) |
Map<String,List<RepositoryInfo>> |
getRepository(String stackName,
String version) |
RepositoryInfo |
getRepository(String stackName,
String version,
String osType,
String repoId) |
String |
getServerVersion() |
ServiceInfo |
getService(String stackName,
String version,
String serviceName) |
ServiceInfo |
getServiceInfo(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
|
Stack |
getStack(String stackName) |
StackInfo |
getStackInfo(String stackName,
String version) |
Set<StackInfo> |
getStackInfos(String stackName) |
Set<Stack> |
getStackNames() |
File |
getStackRoot() |
Map<String,Map<String,String>> |
getSupportedConfigs(String stackName,
String version,
String serviceName)
Get the service configs supported for a service in a particular stack
|
List<ServiceInfo> |
getSupportedServices(String stackName,
String version) |
List<StackInfo> |
getSupportedStacks() |
void |
init()
Initialize the Ambari Meta Info
|
boolean |
isOsSupported(String osType) |
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 |
updateRepoBaseURL(String stackName,
String stackVersion,
String osType,
String repoId,
String newBaseUrl) |
public static final String STACK_METAINFO_FILE_NAME
public static final String SERVICES_FOLDER_NAME
public static final String SERVICE_METAINFO_FILE_NAME
public static final String SERVICE_CONFIG_FOLDER_NAME
public static final String SERVICE_CONFIG_FILE_NAME_POSTFIX
public static final String RCO_FILE_NAME
public static final String SERVICE_METRIC_FILE_NAME
public static final String ANY_OS
public static final String SCHEMA_VERSION_LEGACY
public static final String SCHEMA_VERSION_2
public static final FilenameFilter FILENAME_FILTER
@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 ComponentInfo getComponentCategory(String stackName, String version, String serviceName, String componentName) throws AmbariException
stackName - version - serviceName - componentName - AmbariExceptionpublic List<ComponentInfo> getComponentsByService(String stackName, String version, String serviceName) throws AmbariException
stackName - version - serviceName - AmbariExceptionpublic ComponentInfo getComponent(String stackName, String version, String serviceName, String componentName) throws AmbariException
AmbariExceptionpublic Map<String,List<RepositoryInfo>> getRepository(String stackName, String version) throws AmbariException
AmbariExceptionpublic List<RepositoryInfo> getRepositories(String stackName, String version, String osType) throws AmbariException
AmbariExceptionpublic RepositoryInfo getRepository(String stackName, String version, String osType, String repoId) throws AmbariException
AmbariExceptionpublic boolean isSupportedStack(String stackName, String version) throws AmbariException
AmbariExceptionpublic boolean isValidService(String stackName, String version, String serviceName) throws AmbariException
AmbariExceptionpublic boolean isValidServiceComponent(String stackName, String version, String serviceName, String componentName) throws AmbariException
AmbariExceptionpublic String getComponentToService(String stackName, String version, String componentName) throws AmbariException
stackName - the stack nameversion - the stack versioncomponentName - the component nameAmbariExceptionpublic Map<String,Map<String,String>> getSupportedConfigs(String stackName, String version, String serviceName) throws AmbariException
stackName - the stack nameversion - the version of the stackserviceName - the name of the service in the stackAmbariExceptionpublic Map<String,ServiceInfo> getServices(String stackName, String version) throws AmbariException
stackName - the stack nameversion - the version of the stackAmbariExceptionpublic ServiceInfo getService(String stackName, String version, String serviceName) throws AmbariException
AmbariExceptionpublic ServiceInfo getServiceInfo(String stackName, String version, String serviceName) throws AmbariException
AmbariExceptionpublic List<ServiceInfo> getSupportedServices(String stackName, String version) throws AmbariException
AmbariExceptionpublic Stack getStack(String stackName) throws AmbariException
AmbariExceptionpublic StackInfo getStackInfo(String stackName, String version) throws AmbariException
AmbariExceptionpublic Set<PropertyInfo> getProperties(String stackName, String version, String serviceName) throws AmbariException
AmbariExceptionpublic PropertyInfo getProperty(String stackName, String version, String serviceName, String propertyName) throws AmbariException
AmbariExceptionpublic Set<OperatingSystemInfo> getOperatingSystems(String stackName, String version) throws AmbariException
AmbariExceptionpublic OperatingSystemInfo getOperatingSystem(String stackName, String version, String osType) throws AmbariException
AmbariExceptionpublic List<ActionDefinition> getAllActionDefinition()
public ActionDefinition getActionDefinition(String name)
public void addActionDefinition(ActionDefinition ad) throws AmbariException
AmbariExceptionpublic String getServerVersion()
public boolean isOsSupported(String osType)
public void updateRepoBaseURL(String stackName, String stackVersion, String osType, String repoId, String newBaseUrl) throws AmbariException
stackName - the stack namestackVersion - the stack versionosType - the osrepoId - the repo idnewBaseUrl - the new base urlAmbariExceptionpublic File getStackRoot()
public List<MetricDefinition> getMetrics(String stackName, String stackVersion, String serviceName, String componentName, String metricType) throws AmbariException
AmbariExceptionCopyright © 2016. All rights reserved.