public class RepoUtil extends Object
Constructor and Description |
---|
RepoUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addServiceReposToOperatingSystemEntities(List<RepoOsEntity> operatingSystems,
com.google.common.collect.ListMultimap<String,RepositoryInfo> stackReposByOs)
Checks the passed
operatingSystems parameter if it contains all repositories from the stack model. |
static List<RepositoryResponse> |
asResponses(List<RepositoryInfo> repositoryInfos,
String versionDefinitionId,
String stackName,
String stackVersion)
Convert a list of
RepositoryInfo objects to a lost of RepositoryResponse objects |
static List<RepositoryInfo> |
getServiceRepos(List<RepositoryInfo> vdfRepos,
com.google.common.collect.ListMultimap<String,RepositoryInfo> stackReposByOs)
Given a list of VDF repositorie and stack repositories (grouped by os) returns the service repositories.
|
static org.apache.ambari.server.stack.RepositoryFolderAndXml |
parseRepoFile(File directory,
Collection<String> subDirs,
ModuleFileUnmarshaller unmarshaller)
Parses the repository file for a stack/service if exists.
|
public static org.apache.ambari.server.stack.RepositoryFolderAndXml parseRepoFile(File directory, Collection<String> subDirs, ModuleFileUnmarshaller unmarshaller)
directory
- stack/service base directorysubDirs
- stack/service directory sub directoriesunmarshaller
- ModuleFileUnmarshaller
, needed to parse repo XMLorg.apache.ambari.server.AmbariException
- if unable to parse the repository filepublic static boolean addServiceReposToOperatingSystemEntities(List<RepoOsEntity> operatingSystems, com.google.common.collect.ListMultimap<String,RepositoryInfo> stackReposByOs)
operatingSystems
parameter if it contains all repositories from the stack model. If a
repository is present in the stack model but missing in the operating system entity list, it is considered a
service repository and will be added.operatingSystems
- - A list of OperatingSystemEntity objects extracted from a RepositoryVersionEntitystackReposByOs
- - Stack repositories loaded from the disk (including service repositories), grouped by os.true
if there were added repositoriespublic static List<RepositoryInfo> getServiceRepos(List<RepositoryInfo> vdfRepos, com.google.common.collect.ListMultimap<String,RepositoryInfo> stackReposByOs)
vdfRepos
- the repositories coming from a version definitionstackReposByOs
- the repositories in the stack model (loaded from disks)public static List<RepositoryResponse> asResponses(List<RepositoryInfo> repositoryInfos, @Nullable String versionDefinitionId, @Nullable String stackName, @Nullable String stackVersion)
RepositoryInfo
objects to a lost of RepositoryResponse
objectsrepositoryInfos
- the list of repository infosversionDefinitionId
- the version definition idstackName
- the stack namestackVersion
- the stack versionCopyright © 2022 Apache Software Foundation. All rights reserved.