Package com.yahoo.config.application.api
Interface ApplicationPackage
public interface ApplicationPackage
Represents an application package, that is, used as input when creating a VespaModel and as
a general reference to all contents in an application.
- Author:
- Vegard Havdal
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
Do not usestatic final com.yahoo.path.Path
Constant tensorsstatic final com.yahoo.path.Path
static final String
static final String
static final String
static final com.yahoo.path.Path
Machine-learned models - only present in user-uploaded package instancesstatic final com.yahoo.path.Path
Files generated from machine-learned modelsstatic final com.yahoo.path.Path
Files generated from machine-learned models which should be replicated in ZooKeeperstatic final com.yahoo.path.Path
static final String
static final com.yahoo.path.Path
static final com.yahoo.path.Path
static final String
static final String
static final String
static final com.yahoo.path.Path
static final String
static final com.yahoo.path.Path
static final String
static final com.yahoo.path.Path
static final String
static final com.yahoo.path.Path
static final String
static final com.yahoo.path.Path
-
Method Summary
Modifier and TypeMethodDescriptionMap<com.yahoo.vespa.config.ConfigDefinitionKey,
UnparsedConfigDefinition> Returns all the config definitions available in this package as unparsed data.default Optional<com.yahoo.config.provision.AllocatedHosts>
Returns the host allocation info of this, or empty if no allocation is availablecom.yahoo.config.provision.ApplicationId
default ApplicationFile
Returns handle for the file containing client certificate authoritiesgetComponentsInfo
(com.yahoo.component.Version vespaVersion) Returns the parsed deployment spec of this, without validating it, and without reparsing on each request.getFile
(com.yahoo.path.Path relativePath) Returns information about a filestatic String
getFileName
(JarEntry je) The name of an SD in a JarEntrygetFileReference
(com.yahoo.path.Path pathRelativeToAppDir) default Map<com.yahoo.component.Version,
FileRegistry> default List<com.yahoo.io.reader.NamedReader>
Same as getFiles(pathFromRoot, suffix, false)List<com.yahoo.io.reader.NamedReader>
Returns the files in a directory as readers.getHosts()
Contents of hosts.xml.Returns the major version this application is valid for, or empty if it is valid for all versionsGets the ApplicationMetaData instance for this application package.default List<com.yahoo.io.reader.NamedReader>
DoesgetFiles(com.yahoo.path.Path, java.lang.String, boolean)
on the page template directory and gets all xml filesdefault List<com.yahoo.io.reader.NamedReader>
DoesgetFiles(com.yahoo.path.Path, java.lang.String, boolean)
on the query profile directory and gets all xml filesdefault List<com.yahoo.io.reader.NamedReader>
DoesgetFiles(com.yahoo.path.Path, java.lang.String, boolean)
on the query profile directory and gets all xml filesgetRankingExpression
(String name) Reads a ranking expression from file to a string and returns it.Collection<com.yahoo.io.reader.NamedReader>
Readers for all the schema files.Contents of services.xml.Returns the include dirs given by the user in the services.xml file.default DeploymentSpec
parseDeploymentSpec
(boolean validate) default ApplicationPackage
preprocess
(com.yahoo.config.provision.Zone zone, DeployLogger logger) Preprocess an application for a given zone and return a new application package pointing to the preprocessed application package.default void
validateIncludeDir
(String dirName) default void
default void
validateXMLFor
(Optional<com.yahoo.component.Version> vespaVersion) default void
-
Field Details
-
HOSTS
- See Also:
-
SERVICES
- See Also:
-
SCHEMAS_DIR
static final com.yahoo.path.Path SCHEMAS_DIR -
SEARCH_DEFINITIONS_DIR
static final com.yahoo.path.Path SEARCH_DEFINITIONS_DIR -
COMPONENT_DIR
- See Also:
-
SEARCHCHAINS_DIR
- See Also:
-
DOCPROCCHAINS_DIR
- See Also:
-
PROCESSORCHAINS_DIR
- See Also:
-
ROUTINGTABLES_DIR
- See Also:
-
MODELS_DIR
static final com.yahoo.path.Path MODELS_DIRMachine-learned models - only present in user-uploaded package instances -
MODELS_GENERATED_DIR
static final com.yahoo.path.Path MODELS_GENERATED_DIRFiles generated from machine-learned models -
MODELS_GENERATED_REPLICATED_DIR
static final com.yahoo.path.Path MODELS_GENERATED_REPLICATED_DIRFiles generated from machine-learned models which should be replicated in ZooKeeper -
CONSTANTS_DIR
static final com.yahoo.path.Path CONSTANTS_DIRConstant tensors -
CONFIG_DEFINITIONS_DIR
Do not use- See Also:
-
QUERY_PROFILES_DIR
static final com.yahoo.path.Path QUERY_PROFILES_DIR -
QUERY_PROFILE_TYPES_DIR
static final com.yahoo.path.Path QUERY_PROFILE_TYPES_DIR -
PAGE_TEMPLATES_DIR
static final com.yahoo.path.Path PAGE_TEMPLATES_DIR -
RULES_DIR
static final com.yahoo.path.Path RULES_DIR -
DEPLOYMENT_FILE
static final com.yahoo.path.Path DEPLOYMENT_FILE -
VALIDATION_OVERRIDES
static final com.yahoo.path.Path VALIDATION_OVERRIDES -
SECURITY_DIR
static final com.yahoo.path.Path SECURITY_DIR -
SD_NAME_SUFFIX
- See Also:
-
RANKEXPRESSION_NAME_SUFFIX
- See Also:
-
RANKPROFILE_NAME_SUFFIX
- See Also:
-
RULES_NAME_SUFFIX
- See Also:
-
EXT_DIR
- See Also:
-
-
Method Details
-
getApplicationId
com.yahoo.config.provision.ApplicationId getApplicationId() -
getServices
Reader getServices()Contents of services.xml. Caller must close reader after use.- Returns:
- a Reader, or null if no services.xml present
-
getHosts
Reader getHosts()Contents of hosts.xml. Caller must close reader after use.- Returns:
- a Reader, or null if no hosts.xml present
-
getUserIncludeDirs
Returns the include dirs given by the user in the services.xml file. -
validateIncludeDir
-
getAllExistingConfigDefs
Map<com.yahoo.vespa.config.ConfigDefinitionKey,UnparsedConfigDefinition> getAllExistingConfigDefs()Returns all the config definitions available in this package as unparsed data. -
getFiles
List<com.yahoo.io.reader.NamedReader> getFiles(com.yahoo.path.Path pathFromRoot, String suffix, boolean recurse) Returns the files in a directory as readers. The readers must be closed by the caller.- Parameters:
pathFromRoot
- the relative path string from the root of the application packagesuffix
- the suffix of files to return, or null to return allrecurse
- return files in all subdirectories (recursively) as well- Returns:
- a list of the files at this location, or an empty list (never null) if the directory does not exist or is empty. The list gets owned by the caller and can be modified freely.
-
getFiles
default List<com.yahoo.io.reader.NamedReader> getFiles(com.yahoo.path.Path pathFromRoot, String suffix) Same as getFiles(pathFromRoot, suffix, false) -
getMajorVersion
Returns the major version this application is valid for, or empty if it is valid for all versions -
getFile
Returns information about a file- Parameters:
relativePath
- the relative path of the file within this application package.- Returns:
- information abut the file, returned whether or not the file exists
-
getQueryProfileFiles
DoesgetFiles(com.yahoo.path.Path, java.lang.String, boolean)
on the query profile directory and gets all xml files -
getQueryProfileTypeFiles
DoesgetFiles(com.yahoo.path.Path, java.lang.String, boolean)
on the query profile directory and gets all xml files -
getPageTemplateFiles
DoesgetFiles(com.yahoo.path.Path, java.lang.String, boolean)
on the page template directory and gets all xml files -
getClientSecurityFile
Returns handle for the file containing client certificate authorities -
getHostSource
String getHostSource() -
getServicesSource
String getServicesSource() -
getDeployment
-
getDeploymentSpec
DeploymentSpec getDeploymentSpec()Returns the parsed deployment spec of this, without validating it, and without reparsing on each request. -
parseDeploymentSpec
-
getValidationOverrides
-
getComponentsInfo
-
getRankingExpression
Reads a ranking expression from file to a string and returns it.- Parameters:
name
- the name of the file to return, relative to the search definition directory in the application package- Returns:
- the content of a ranking expression file
- Throws:
IllegalArgumentException
- if the file was not found or could not be read
-
getFileName
The name of an SD in a JarEntry -
getMetaData
ApplicationMetaData getMetaData()Gets the ApplicationMetaData instance for this application package.- Returns:
- an ApplicationMetaData instance
-
getFileReference
-
validateXML
- Throws:
IOException
-
validateXMLFor
- Throws:
IOException
-
writeMetaData
- Throws:
IOException
-
getAllocatedHosts
Returns the host allocation info of this, or empty if no allocation is available -
getFileRegistries
-
legacyOverrides
-
getSchemas
Collection<com.yahoo.io.reader.NamedReader> getSchemas()Readers for all the schema files.- Returns:
- a collection of readers for schemas
-
preprocess
default ApplicationPackage preprocess(com.yahoo.config.provision.Zone zone, DeployLogger logger) throws IOException Preprocess an application for a given zone and return a new application package pointing to the preprocessed application package. This is the entry point for the multi environment application package support. This method will not mutate the existing application package.- Parameters:
zone
- a validZone
instance, used to decide which parts of services to keep and removelogger
- aDeployLogger
to add output that will be returned to the user- Returns:
- a new application package instance pointing to a new location
- Throws:
IOException
-