public class StackManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
COMMON_SERVICES
Prefix used for common services parent path string
|
protected Map<String,ServiceModule> |
commonServiceModules |
protected Map<String,ExtensionModule> |
extensionModules |
static String |
EXTENSIONS
Prefix used for extension services parent path string
|
static String |
METAINFO_FILE_NAME |
static String |
PATH_DELIMITER
Delimiter used for parent path string
Example:
HDP/2.0.6/HDFS
common-services/HDFS/2.1.0.2.0
|
static String |
PROPERTY_SCHEMA_PATH |
protected NavigableMap<String,StackInfo> |
stackMap
Map of stack id to stack info
|
protected Map<String,StackModule> |
stackModules |
Constructor and Description |
---|
StackManager(File stackRoot,
File commonServicesRoot,
File extensionRoot,
OsFamily osFamily,
boolean validate,
MetainfoDAO metaInfoDAO,
ActionMetadata actionMetadata,
StackDAO stackDao,
ExtensionDAO extensionDao,
ExtensionLinkDAO linkDao,
AmbariManagementHelper helper)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ExtensionInfo |
getExtension(String name,
String version)
Obtain the extension info specified by name and version.
|
Collection<ExtensionInfo> |
getExtensions()
Obtain all extensions.
|
Collection<ExtensionInfo> |
getExtensions(String name)
Obtain all extensions for the given name.
|
static Validator |
getPropertySchemaValidator() |
StackInfo |
getStack(String name,
String version)
Obtain the stack info specified by name and version.
|
Collection<StackInfo> |
getStacks()
Obtain all stacks.
|
Collection<StackInfo> |
getStacks(String name)
Obtain all stacks for the given name.
|
Map<String,List<StackInfo>> |
getStacksByName()
Obtain all a map of all stacks by name.
|
boolean |
haveAllRepoUrlsBeenResolved()
Determine if all tasks which update stack repo urls have completed.
|
void |
linkStackToExtension(StackInfo stack,
ExtensionInfo extension) |
protected void |
parseDirectories(File stackRoot,
File commonServicesRoot,
File extensionRoot) |
void |
removeStack(StackEntity stackEntity) |
void |
unlinkStackAndExtension(StackInfo stack,
ExtensionInfo extension) |
static void |
validateAllPropertyXmlsInFolderRecursively(File stackRoot,
Validator validator) |
public static final String PROPERTY_SCHEMA_PATH
public static final String PATH_DELIMITER
public static final String COMMON_SERVICES
public static final String EXTENSIONS
public static final String METAINFO_FILE_NAME
protected NavigableMap<String,StackInfo> stackMap
protected Map<String,ServiceModule> commonServiceModules
protected Map<String,StackModule> stackModules
protected Map<String,ExtensionModule> extensionModules
public StackManager(File stackRoot, @Nullable File commonServicesRoot, @Nullable File extensionRoot, OsFamily osFamily, boolean validate, MetainfoDAO metaInfoDAO, ActionMetadata actionMetadata, StackDAO stackDao, ExtensionDAO extensionDao, ExtensionLinkDAO linkDao, AmbariManagementHelper helper) throws org.apache.ambari.server.AmbariException
stackRootDir
- stack root directorycommonServicesRoot
- common services root directoryextensionRoot
- extensions root directoryosFamily
- the OS family read from resourcesmetaInfoDAO
- metainfo DAO automatically injectedactionMetadata
- action meta data automatically injectedstackDao
- stack DAO automatically injectedextensionDao
- extension DAO automatically injectedlinkDao
- extension link DAO automatically injectedhelper
- Ambari management helper automatically injectedorg.apache.ambari.server.AmbariException
- if an exception occurs while processing the stacksprotected void parseDirectories(File stackRoot, File commonServicesRoot, File extensionRoot) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public StackInfo getStack(String name, String version)
name
- name of the stackversion
- version of the stackpublic Collection<StackInfo> getStacks(String name)
name
- stack namepublic Map<String,List<StackInfo>> getStacksByName()
public Collection<StackInfo> getStacks()
public ExtensionInfo getExtension(String name, String version)
name
- name of the extensionversion
- version of the extensionpublic Collection<ExtensionInfo> getExtensions(String name)
name
- extension namepublic Collection<ExtensionInfo> getExtensions()
public boolean haveAllRepoUrlsBeenResolved()
public static Validator getPropertySchemaValidator() throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public static void validateAllPropertyXmlsInFolderRecursively(File stackRoot, Validator validator) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void linkStackToExtension(StackInfo stack, ExtensionInfo extension) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void unlinkStackAndExtension(StackInfo stack, ExtensionInfo extension) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void removeStack(StackEntity stackEntity)
Copyright © 2022 Apache Software Foundation. All rights reserved.