diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-03-13 22:52:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 22:52:43 +0100 |
commit | a289c6ea55bc0251e437805892e545c5c3090f99 (patch) | |
tree | 661d9d3b319c3299a6f70eb47044c192476f1494 /config-model-api | |
parent | 7e92c3852e893d09f0aa821e04e4e9dbe83b4ab2 (diff) |
Revert "Bratseth/search to schema"
Diffstat (limited to 'config-model-api')
3 files changed, 14 insertions, 18 deletions
diff --git a/config-model-api/abi-spec.json b/config-model-api/abi-spec.json index dc67b6537e5..e1e3d6f610c 100644 --- a/config-model-api/abi-spec.json +++ b/config-model-api/abi-spec.json @@ -137,7 +137,6 @@ "fields": [ "public static final java.lang.String HOSTS", "public static final java.lang.String SERVICES", - "public static final com.yahoo.path.Path SCHEMAS_DIR", "public static final com.yahoo.path.Path SEARCH_DEFINITIONS_DIR", "public static final java.lang.String COMPONENT_DIR", "public static final java.lang.String SEARCHCHAINS_DIR", diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/ApplicationPackage.java b/config-model-api/src/main/java/com/yahoo/config/application/api/ApplicationPackage.java index 174f9bb54d7..db3d391d19b 100644 --- a/config-model-api/src/main/java/com/yahoo/config/application/api/ApplicationPackage.java +++ b/config-model-api/src/main/java/com/yahoo/config/application/api/ApplicationPackage.java @@ -36,6 +36,8 @@ import java.util.jar.JarFile; * The class hides detail as to whether the source is local files or ZooKeeper * data in config server. * + * Anyone wanting to access application data should use this interface. + * * @author Vegard Havdal */ public interface ApplicationPackage { @@ -45,8 +47,7 @@ public interface ApplicationPackage { String HOSTS = "hosts.xml"; String SERVICES = "services.xml"; - Path SCHEMAS_DIR = Path.fromString("schemas"); - Path SEARCH_DEFINITIONS_DIR = Path.fromString("searchdefinitions"); // Legacy addition to schemas + Path SEARCH_DEFINITIONS_DIR = Path.fromString("searchdefinitions"); String COMPONENT_DIR = "components"; String SEARCHCHAINS_DIR = "search/chains"; String DOCPROCCHAINS_DIR = "docproc/chains"; @@ -167,7 +168,7 @@ public interface ApplicationPackage { } /** - * Returns information about a file + * Returns inforamtion about a file * * @param relativePath the relative path of the file within this application package. * @return information abut the file, returned whether or not the file exists @@ -205,26 +206,23 @@ public interface ApplicationPackage { Reader getRankingExpression(String name); /** - * Returns the name-payload pairs of any sd files under path/schemas and path/searchdefinitions/ - * in the given jar bundle. - * - * @param bundle the jar file, which will be closed afterwards by this method - * @param path for example 'complex/' + * Returns the name-payload pairs of any sd files under path/searchdefinitions/ in the given jar bundle + * @param bundle The jar file, which will be closed afterwards by this method. + * @param path For example 'complex/' * @return map of the SD payloads * @throws IOException if it is reading sd files fails */ static Map<String, String> getBundleSdFiles(String path, JarFile bundle) throws IOException { - Map<String, String> schemas = new LinkedHashMap<>(); + Map<String,String> ret = new LinkedHashMap<>(); for (Enumeration<JarEntry> e = bundle.entries(); e.hasMoreElements();) { - JarEntry entry = e.nextElement(); - if ((entry.getName().startsWith(path + SCHEMAS_DIR + "/") || entry.getName().startsWith(path + SEARCH_DEFINITIONS_DIR + "/")) - && entry.getName().endsWith(SD_NAME_SUFFIX)) { - String contents = IOUtils.readAll(new InputStreamReader(bundle.getInputStream(entry))); - schemas.put(getFileName(entry), contents); + JarEntry je=e.nextElement(); + if (je.getName().startsWith(path+SEARCH_DEFINITIONS_DIR+"/") && je.getName().endsWith(SD_NAME_SUFFIX)) { + String contents = IOUtils.readAll(new InputStreamReader(bundle.getInputStream(je))); + ret.put(getFileName(je), contents); } } bundle.close(); - return schemas; + return ret; } /** diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/SuperModelListener.java b/config-model-api/src/main/java/com/yahoo/config/model/api/SuperModelListener.java index 930c3c94907..e66a7e1ef7e 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/SuperModelListener.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/SuperModelListener.java @@ -7,7 +7,6 @@ import com.yahoo.config.provision.ApplicationId; * Interface for those wanting to be notified about changes to the SuperModel. */ public interface SuperModelListener { - /** * Application has been activated: Either deployed the first time, * internally redeployed, or externally triggered redeploy. @@ -23,7 +22,7 @@ public interface SuperModelListener { * Invoked once all applications that were supposed to be deployed on bootstrap * have been activated (and the respective {@link #applicationActivated(SuperModel, ApplicationInfo) * applicationActivated} have been invoked). The SuperModel is then said to be "complete". + * @param superModel */ void notifyOfCompleteness(SuperModel superModel); - } |