public class VersionDefinitionXml extends Object
Modifier and Type | Class and Description |
---|---|
static class |
VersionDefinitionXml.Merger
Used to facilitate merging when multiple version definitions are provided.
|
Modifier and Type | Field and Description |
---|---|
Release |
release
Release details.
|
RepositoryXml |
repositoryInfo
Represents the repository details.
|
static String |
SCHEMA_LOCATION |
String |
xsdLocation
The xsd location.
|
Constructor and Description |
---|
VersionDefinitionXml() |
Modifier and Type | Method and Description |
---|---|
static VersionDefinitionXml |
build(StackInfo stackInfo)
Builds a Version Definition that is the default for the stack.
|
Collection<AvailableService> |
getAvailableServices(StackInfo stack) |
ClusterVersionSummary |
getClusterSummary(Cluster cluster,
AmbariMetaInfo metaInfo)
Gets a summary for cluster given the version information in this version.
|
Set<String> |
getMissingDependencies(Cluster cluster,
AmbariMetaInfo metaInfo)
Gets information about services which cannot be upgraded because the
repository does not contain required dependencies.
|
String |
getPackageVersion(String osFamily)
Gets the package version for an OS family
|
List<ManifestServiceInfo> |
getStackServices(StackInfo stack)
Gets the list of stack services, applying information from the version
definition.
|
boolean |
isStackDefault()
Gets if the version definition was built as the default for a stack
|
static VersionDefinitionXml |
load(String xml)
Parses an xml string.
|
static VersionDefinitionXml |
load(URL url)
Parses a URL for a definition XML file into the object graph.
|
void |
setStackDefault(boolean stackDefault)
Sets if the version definition is a stack default.
|
String |
toXml()
Returns the XML representation of this instance.
|
public static final String SCHEMA_LOCATION
public Release release
public RepositoryXml repositoryInfo
public String xsdLocation
null
.public Collection<AvailableService> getAvailableServices(StackInfo stack)
stack
- the stack info needed to lookup service and component display namespublic void setStackDefault(boolean stackDefault)
public boolean isStackDefault()
true
if default for a stackpublic List<ManifestServiceInfo> getStackServices(StackInfo stack)
stack
- the stack for which to get the informationManifestServiceInfo
instances for each service
in the stackpublic String getPackageVersion(String osFamily)
osFamily
- the os familynull
if not foundpublic String toXml() throws Exception
Exception
public ClusterVersionSummary getClusterSummary(Cluster cluster, AmbariMetaInfo metaInfo) throws org.apache.ambari.server.AmbariException
cluster
- the cluster by which to iterate servicesorg.apache.ambari.server.AmbariException
public Set<String> getMissingDependencies(Cluster cluster, AmbariMetaInfo metaInfo) throws org.apache.ambari.server.AmbariException
cluster-env/stack_packages
structure to see if there are any
dependencies listed in the upgrade-dependencies
key.cluster
- the cluster (not null
).metaInfo
- the metainfo instancenull
).org.apache.ambari.server.AmbariException
public static VersionDefinitionXml load(URL url) throws Exception
url
- the URL to load. Can be a file URL reference also.Exception
public static VersionDefinitionXml load(String xml) throws Exception
xml
- the xml stringException
public static VersionDefinitionXml build(StackInfo stackInfo)
This will use all of the services defined on the stack, excluding those which do not advertise a version. If a service doesn't advertise a version, we cannot include it in a generated VDF.
Copyright © 2022 Apache Software Foundation. All rights reserved.