summaryrefslogtreecommitdiffstats
path: root/config-model-api
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2020-03-17 11:41:59 +0100
committerJon Bratseth <bratseth@verizonmedia.com>2020-03-17 11:41:59 +0100
commit79f4cb5be4a6719d0b11cd39c3f44af2849903b8 (patch)
tree58d830381f0e6f05309d49d4b8f5c88aa2545db9 /config-model-api
parentca1eae82829cd9f2d270b2b788432a4461c1dc3e (diff)
Revert "Merge pull request #12565 from vespa-engine/revert-12563-bratseth/search-to-schema"
This reverts commit ea5fe1bf8c0d389a3964d2e5c490994920d21a4e, reversing changes made to 7e92c3852e893d09f0aa821e04e4e9dbe83b4ab2.
Diffstat (limited to 'config-model-api')
-rw-r--r--config-model-api/abi-spec.json1
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/application/api/ApplicationPackage.java28
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/SuperModelListener.java3
3 files changed, 18 insertions, 14 deletions
diff --git a/config-model-api/abi-spec.json b/config-model-api/abi-spec.json
index e1e3d6f610c..dc67b6537e5 100644
--- a/config-model-api/abi-spec.json
+++ b/config-model-api/abi-spec.json
@@ -137,6 +137,7 @@
"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 db3d391d19b..174f9bb54d7 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,8 +36,6 @@ 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 {
@@ -47,7 +45,8 @@ public interface ApplicationPackage {
String HOSTS = "hosts.xml";
String SERVICES = "services.xml";
- Path SEARCH_DEFINITIONS_DIR = Path.fromString("searchdefinitions");
+ Path SCHEMAS_DIR = Path.fromString("schemas");
+ Path SEARCH_DEFINITIONS_DIR = Path.fromString("searchdefinitions"); // Legacy addition to schemas
String COMPONENT_DIR = "components";
String SEARCHCHAINS_DIR = "search/chains";
String DOCPROCCHAINS_DIR = "docproc/chains";
@@ -168,7 +167,7 @@ public interface ApplicationPackage {
}
/**
- * Returns inforamtion about a file
+ * Returns information 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
@@ -206,23 +205,26 @@ public interface ApplicationPackage {
Reader getRankingExpression(String name);
/**
- * 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/'
+ * 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/'
* @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> ret = new LinkedHashMap<>();
+ Map<String, String> schemas = new LinkedHashMap<>();
for (Enumeration<JarEntry> e = bundle.entries(); e.hasMoreElements();) {
- 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);
+ 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);
}
}
bundle.close();
- return ret;
+ return schemas;
}
/**
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 e66a7e1ef7e..930c3c94907 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,6 +7,7 @@ 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.
@@ -22,7 +23,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);
+
}