summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-08-21 09:38:31 +0200
committerJon Bratseth <bratseth@oath.com>2018-08-21 09:38:31 +0200
commit6110db7eb9e5ca01e6cc9426e68e74232004ae63 (patch)
treee8eb26a98ab9d283b184db9a8246a5edc4b1ff23 /configserver
parent51318703c054e71ce575d5edde90c6f84c3fedfd (diff)
Revert "Merge pull request #6635 from vespa-engine/bratseth/generate-rank-profiles-for-all-models-part-2-4"
This reverts commit 3f91e18528b4982398332a30728eed8f7d2b580c, reversing changes made to 8e3ba08f1d3b79e573864726c6c03e58862feee6.
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java13
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKLiveApp.java12
2 files changed, 16 insertions, 9 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java
index 2c46f591037..e9b4d6ac1aa 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java
@@ -24,12 +24,14 @@ import java.io.File;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.stream.Collectors;
/**
* Represents an application residing in zookeeper.
@@ -200,16 +202,17 @@ public class ZKApplicationPackage implements ApplicationPackage {
return ret;
}
- //Returns readers for all the children of a node.
- //The node is looked up relative to the location of the active application package
- //in zookeeper.
+ /**
+ * Returns readers for all the children of a node.
+ * The node is looked up relative to the location of the active application package in zookeeper.
+ */
@Override
- public List<NamedReader> getFiles(Path relativePath,String suffix,boolean recurse) {
+ public List<NamedReader> getFiles(Path relativePath, String suffix, boolean recurse) {
return liveApp.getAllDataFromDirectory(ConfigCurator.USERAPP_ZK_SUBPATH + '/' + relativePath.getRelative(), suffix, recurse);
}
@Override
- public ApplicationFile getFile(Path file) { // foo/bar/baz.json
+ public ApplicationFile getFile(Path file) {
return new ZKApplicationFile(file, liveApp);
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKLiveApp.java b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKLiveApp.java
index d7d43dea022..956af02e36f 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKLiveApp.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKLiveApp.java
@@ -69,7 +69,8 @@ public class ZKLiveApp {
log.finer("ZKApplicationPackage: Skipped '" + child + "' (did not match suffix " + fileNameSuffix + ")");
}
if (recursive)
- result.addAll(getAllDataFromDirectory(path + "/" + child, namePrefix + child + "/", fileNameSuffix, recursive));
+ result.addAll(getAllDataFromDirectory(path + "/" + child,
+ namePrefix + child + "/", fileNameSuffix, recursive));
}
if (log.isLoggable(Level.FINE))
log.fine("ZKApplicationPackage: Found '" + result.size() + "' files in " + fullPath);
@@ -80,14 +81,15 @@ public class ZKLiveApp {
}
/**
- * Retrieves a node relative to the node of the live application, e.g. /vespa/config/apps/$lt;app_id&gt;/&lt;path&gt;/&lt;node&gt;
+ * Retrieves a node relative to the node of the live application,
+ * e.g. /vespa/config/apps/$lt;app_id&gt;/&lt;path&gt;/&lt;node&gt;
*
* @param path a path relative to the currently active application
* @param node a path relative to the path above
* @return a Reader that can be used to get the data
*/
public Reader getDataReader(String path, String node) {
- final String data = getData(path, node);
+ String data = getData(path, node);
if (data == null) {
throw new IllegalArgumentException("No node for " + getFullPath(path) + "/" + node + " exists");
}
@@ -98,7 +100,8 @@ public class ZKLiveApp {
try {
return zk.getData(getFullPath(path), node);
} catch (Exception e) {
- throw new IllegalArgumentException("Could not retrieve node '" + getFullPath(path) + "/" + node + "' in zookeeper", e);
+ throw new IllegalArgumentException("Could not retrieve node '" +
+ getFullPath(path) + "/" + node + "' in zookeeper", e);
}
}
@@ -205,5 +208,6 @@ public class ZKLiveApp {
}
return reader(data);
}
+
}