summaryrefslogtreecommitdiffstats
path: root/configserver/src
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2020-12-02 07:53:44 +0100
committerJon Bratseth <bratseth@gmail.com>2020-12-02 07:53:44 +0100
commitd5982ee7479179b6754b1b9cd4cdbc8140c5e961 (patch)
tree721db18f73b48066dfe9ad4e18066ac2b7955b65 /configserver/src
parent4cf13bc7db215e77f7688e429f700880c115fe76 (diff)
Revert "Merge pull request #15581 from vespa-engine/revert-15578-bratseth/apply-on-restart-take-10"
This reverts commit 4cf13bc7db215e77f7688e429f700880c115fe76, reversing changes made to e21f385bd4f21326608f3a69325df4e96d4a65e5.
Diffstat (limited to 'configserver/src')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/SuperModelController.java2
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/application/Application.java45
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigInstanceBuilder.java117
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactory.java5
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java6
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/rpc/LZ4ConfigResponseFactory.java5
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/rpc/UncompressedConfigResponseFactory.java5
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java4
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/ModelStub.java7
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/ServerCacheTest.java6
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java8
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpConfigResponseTest.java2
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/metrics/DeploymentMetricsRetrieverTest.java7
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/metrics/ProtonMetricsRetrieverTest.java7
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactoryTest.java4
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpcServer.java2
16 files changed, 208 insertions, 24 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/SuperModelController.java b/configserver/src/main/java/com/yahoo/vespa/config/server/SuperModelController.java
index 0bddd8d0637..933a8d86230 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/SuperModelController.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/SuperModelController.java
@@ -46,7 +46,7 @@ public class SuperModelController {
ConfigKey<?> configKey = request.getConfigKey();
validateConfigDefinition(request.getConfigKey(), request.getDefContent());
ConfigPayload payload = model.getConfig(configKey);
- return responseFactory.createResponse(payload, generation, false);
+ return responseFactory.createResponse(payload, generation, false, false);
}
private void validateConfigDefinition(ConfigKey<?> configKey, DefContent defContent) {
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/Application.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/Application.java
index 8d001d5d5df..156b4be392e 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/Application.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/Application.java
@@ -2,6 +2,7 @@
package com.yahoo.vespa.config.server.application;
import com.yahoo.component.Version;
+import com.yahoo.config.ConfigInstance;
import com.yahoo.config.ConfigurationRuntimeException;
import com.yahoo.config.model.api.ApplicationInfo;
import com.yahoo.config.model.api.Model;
@@ -11,6 +12,8 @@ import com.yahoo.vespa.config.ConfigCacheKey;
import com.yahoo.vespa.config.ConfigDefinitionKey;
import com.yahoo.vespa.config.ConfigKey;
import com.yahoo.vespa.config.ConfigPayload;
+import com.yahoo.vespa.config.ConfigPayloadBuilder;
+import com.yahoo.vespa.config.GenericConfig;
import com.yahoo.vespa.config.GetConfigRequest;
import com.yahoo.vespa.config.buildergen.ConfigDefinition;
import com.yahoo.vespa.config.protocol.ConfigResponse;
@@ -23,6 +26,7 @@ import com.yahoo.vespa.config.server.rpc.ConfigResponseFactory;
import com.yahoo.vespa.config.server.rpc.UncompressedConfigResponseFactory;
import com.yahoo.vespa.config.server.tenant.TenantRepository;
import com.yahoo.vespa.config.util.ConfigUtils;
+import com.yahoo.yolean.Exceptions;
import java.util.Objects;
import java.util.Set;
@@ -98,6 +102,7 @@ public class Application implements ModelResult {
/**
* Gets a config from ZK. Returns null if not found.
*/
+ @SuppressWarnings("deprecation")
public ConfigResponse resolveConfig(GetConfigRequest req, ConfigResponseFactory responseFactory) {
long start = System.currentTimeMillis();
metricUpdater.incrementRequests();
@@ -131,18 +136,43 @@ public class Application implements ModelResult {
debug("Resolving " + configKey + " with config definition " + def);
}
- ConfigPayload payload = null;
+ ConfigInstance.Builder builder;
+ ConfigPayload payload;
+ boolean applyOnRestart = false;
try {
- payload = model.getConfig(configKey, def);
+ builder = model.getConfigInstance(configKey, def);
+ if (builder == null) { // TODO: Remove this condition after December 2020
+ payload = model.getConfig(configKey, def);
+ if (def.getCNode() != null)
+ payload.applyDefaultsFromDef(def.getCNode());
+ }
+ else if (builder instanceof GenericConfig.GenericConfigBuilder) {
+ payload = ((GenericConfig.GenericConfigBuilder) builder).getPayload();
+ applyOnRestart = builder.getApplyOnRestart();
+ }
+ else {
+ try {
+ ConfigInstance instance = ConfigInstanceBuilder.buildInstance(builder, def.getCNode());
+ payload = ConfigPayload.fromInstance(instance);
+ applyOnRestart = builder.getApplyOnRestart();
+ } catch (ConfigurationRuntimeException e) {
+ // This can happen in cases where services ask for config that no longer exist before they have been able
+ // to reconfigure themselves
+ log.log(Level.INFO, "Error resolving instance for builder '" + builder.getClass().getName() +
+ "', returning empty config: " + Exceptions.toMessageString(e));
+ payload = ConfigPayload.fromBuilder(new ConfigPayloadBuilder());
+ }
+ if (def.getCNode() != null)
+ payload.applyDefaultsFromDef(def.getCNode());
+ }
} catch (Exception e) {
throw new ConfigurationRuntimeException("Unable to get config for " + app, e);
}
- if (payload == null) {
- metricUpdater.incrementFailedRequests();
- throw new ConfigurationRuntimeException("Unable to resolve config " + configKey);
- }
- ConfigResponse configResponse = responseFactory.createResponse(payload, applicationGeneration, internalRedeploy);
+ ConfigResponse configResponse = responseFactory.createResponse(payload,
+ applicationGeneration,
+ internalRedeploy,
+ applyOnRestart);
metricUpdater.incrementProcTime(System.currentTimeMillis() - start);
if (useCache(req)) {
cache.put(cacheKey, configResponse, configResponse.getConfigMd5());
@@ -197,4 +227,5 @@ public class Application implements ModelResult {
public Set<String> allConfigIds() {
return model.allConfigIds();
}
+
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigInstanceBuilder.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigInstanceBuilder.java
new file mode 100644
index 00000000000..389e8394c9e
--- /dev/null
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigInstanceBuilder.java
@@ -0,0 +1,117 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.vespa.config.server.application;
+
+import com.yahoo.config.ConfigBuilder;
+import com.yahoo.config.ConfigInstance;
+import com.yahoo.config.ConfigurationRuntimeException;
+import com.yahoo.config.codegen.CNode;
+import com.yahoo.config.codegen.InnerCNode;
+import com.yahoo.config.codegen.LeafCNode;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+
+/**
+ * Builds a ConfigInstance from a ConfigInstance.Builder.
+ * (Put here not in ConfigInstance.Builder temporarily to work around dependency problems.)
+ */
+class ConfigInstanceBuilder {
+
+ private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(ConfigInstanceBuilder.class.getName());
+
+ static ConfigInstance buildInstance(ConfigInstance.Builder builder, InnerCNode targetDef) {
+ try {
+ if (targetDef != null) applyDef(builder, targetDef);
+ Class<? extends ConfigInstance> clazz = getConfigClass(builder.getClass());
+ return clazz.getConstructor(builder.getClass()).newInstance(builder);
+ } catch (Exception e) {
+ throw new ConfigurationRuntimeException(e);
+ }
+ }
+
+ /**
+ * If some fields on the builder are null now, set them from the def. Do recursively.
+ * <p>
+ * If the targetDef has some schema incompatibilities, they are not handled here
+ * (except logging in some cases), but in ConfigInstance.serialize().
+ *
+ * @param builder a {@link com.yahoo.config.ConfigBuilder}
+ * @param targetDef a config definition
+ * @throws Exception if applying values form config definitions fails
+ */
+ static void applyDef(ConfigBuilder builder, InnerCNode targetDef) throws Exception {
+ for (Map.Entry<String, CNode> e: targetDef.children().entrySet()) {
+ CNode node = e.getValue();
+ if (node instanceof LeafCNode) {
+ setLeafValueIfUnset(targetDef, builder, (LeafCNode)node);
+ } else if (node instanceof InnerCNode) {
+ // Is there a private field on the builder that matches this inner node in the def?
+ if (hasField(builder.getClass(), node.getName())) {
+ Field innerField = builder.getClass().getDeclaredField(node.getName());
+ innerField.setAccessible(true);
+ Object innerFieldVal = innerField.get(builder);
+ if (innerFieldVal instanceof List) {
+ // inner array? Check that list elems are ConfigBuilder
+ List<?> innerList = (List<?>) innerFieldVal;
+ for (Object b : innerList) {
+ if (b instanceof ConfigBuilder) {
+ applyDef((ConfigBuilder) b, (InnerCNode) node);
+ }
+ }
+ } else if (innerFieldVal instanceof ConfigBuilder) {
+ // Struct perhaps
+ applyDef((ConfigBuilder) innerFieldVal, (InnerCNode) node);
+ } else {
+ // Likely a config value mismatch. That is handled in ConfigInstance.serialize() (error message, omit from response.)
+ }
+ }
+ }
+ }
+ }
+
+ private static boolean hasField(Class<?> aClass, String name) {
+ for (Field field : aClass.getDeclaredFields()) {
+ if (name.equals(field.getName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static void setLeafValueIfUnset(InnerCNode targetDef, Object builder, LeafCNode node) throws Exception {
+ if (hasField(builder.getClass(), node.getName())) {
+ Field field = builder.getClass().getDeclaredField(node.getName());
+ field.setAccessible(true);
+ Object val = field.get(builder);
+ if (val==null) {
+ // Not set on builder, if the leaf node has a default value, try the private setter that takes String
+ try {
+ if (node.getDefaultValue()!=null) {
+ Method setter = builder.getClass().getDeclaredMethod(node.getName(), String.class);
+ setter.setAccessible(true);
+ setter.invoke(builder, node.getDefaultValue().getValue());
+ }
+ } catch (Exception e) {
+ log.log(Level.SEVERE,
+ "For config '" + targetDef.getFullName() + "': " +
+ "Unable to apply the default value for field '" + node.getName() +
+ "' to config Builder (where it wasn't set)",
+ e);
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Class<? extends ConfigInstance> getConfigClass(Class<? extends ConfigInstance.Builder> builderClass) {
+ Class<?> configClass = builderClass.getEnclosingClass();
+ if (configClass == null || ! ConfigInstance.class.isAssignableFrom(configClass)) {
+ throw new ConfigurationRuntimeException("Builder class " + builderClass + " has enclosing class " + configClass + ", which is not a ConfigInstance");
+ }
+ return (Class<? extends ConfigInstance>) configClass;
+ }
+
+}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactory.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactory.java
index 415fa764823..00a0e6f8f2e 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactory.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactory.java
@@ -26,12 +26,15 @@ public interface ConfigResponseFactory {
/**
* Creates a {@link ConfigResponse} for a given payload and generation.
+ *
* @param payload the {@link ConfigPayload} to put in the response
* @param generation the payload generation
* @param internalRedeploy whether this config generation was produced by an internal redeployment
* not a change to the application package
+ * @param applyOnRestart true if this config change should only be applied on restart,
+ * false if it should be applied immediately
* @return a {@link ConfigResponse} that can be sent to the client
*/
- ConfigResponse createResponse(ConfigPayload payload, long generation, boolean internalRedeploy);
+ ConfigResponse createResponse(ConfigPayload payload, long generation, boolean internalRedeploy, boolean applyOnRestart);
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java
index 62f7d3ce5d0..5d637c0e0bd 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java
@@ -125,7 +125,7 @@ class GetConfigProcessor implements Runnable {
// config == null is not an error, but indicates that the config will be returned later.
if ((config != null) && (!config.hasEqualConfig(request) || config.hasNewerGeneration(request) || forceResponse)) {
// debugLog(trace, "config response before encoding:" + config.toString());
- request.addOkResponse(request.payloadFromResponse(config), config.getGeneration(), config.isInternalRedeploy(), config.getConfigMd5());
+ request.addOkResponse(request.payloadFromResponse(config), config.getGeneration(), config.isInternalRedeploy(), config.applyOnRestart(), config.getConfigMd5());
if (logDebug(trace)) {
debugLog(trace, "return response: " + request.getShortDescription());
}
@@ -166,8 +166,8 @@ class GetConfigProcessor implements Runnable {
log.log(Level.FINE, () -> "Returning empty sentinel config for request from " + request.getClientHostName());
ConfigPayload emptyPayload = ConfigPayload.empty();
String configMd5 = ConfigUtils.getMd5(emptyPayload);
- ConfigResponse config = SlimeConfigResponse.fromConfigPayload(emptyPayload, 0, false, configMd5);
- request.addOkResponse(request.payloadFromResponse(config), config.getGeneration(), false, config.getConfigMd5());
+ ConfigResponse config = SlimeConfigResponse.fromConfigPayload(emptyPayload, 0, false, false, configMd5);
+ request.addOkResponse(request.payloadFromResponse(config), config.getGeneration(), false, false, config.getConfigMd5());
respond(request);
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/LZ4ConfigResponseFactory.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/LZ4ConfigResponseFactory.java
index cba1316a131..a818eaeb8f5 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/LZ4ConfigResponseFactory.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/LZ4ConfigResponseFactory.java
@@ -22,12 +22,13 @@ public class LZ4ConfigResponseFactory implements ConfigResponseFactory {
@Override
public ConfigResponse createResponse(ConfigPayload payload,
long generation,
- boolean internalRedeploy) {
+ boolean internalRedeploy,
+ boolean applyOnRestart) {
Utf8Array rawPayload = payload.toUtf8Array(true);
String configMd5 = ConfigUtils.getMd5(rawPayload);
CompressionInfo info = CompressionInfo.create(CompressionType.LZ4, rawPayload.getByteLength());
Utf8Array compressed = new Utf8Array(compressor.compress(rawPayload.getBytes()));
- return new SlimeConfigResponse(compressed, generation, internalRedeploy, configMd5, info);
+ return new SlimeConfigResponse(compressed, generation, internalRedeploy, applyOnRestart, configMd5, info);
}
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/UncompressedConfigResponseFactory.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/UncompressedConfigResponseFactory.java
index 2de88ab44cc..e3f3f1c1395 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/UncompressedConfigResponseFactory.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/UncompressedConfigResponseFactory.java
@@ -19,11 +19,12 @@ public class UncompressedConfigResponseFactory implements ConfigResponseFactory
@Override
public ConfigResponse createResponse(ConfigPayload payload,
long generation,
- boolean internalRedeploy) {
+ boolean internalRedeploy,
+ boolean applyOnRestart) {
Utf8Array rawPayload = payload.toUtf8Array(true);
String configMd5 = ConfigUtils.getMd5(rawPayload);
CompressionInfo info = CompressionInfo.create(CompressionType.UNCOMPRESSED, rawPayload.getByteLength());
- return new SlimeConfigResponse(rawPayload, generation, internalRedeploy, configMd5, info);
+ return new SlimeConfigResponse(rawPayload, generation, internalRedeploy, applyOnRestart, configMd5, info);
}
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
index 93c1e4c2b50..dfe4055d844 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
@@ -171,7 +171,9 @@ public class SessionRepository {
* @param timeoutBudget timeout for creating session and waiting for other servers.
* @return a new session
*/
- public LocalSession createSessionFromExisting(Session existingSession, boolean internalRedeploy, TimeoutBudget timeoutBudget) {
+ public LocalSession createSessionFromExisting(Session existingSession,
+ boolean internalRedeploy,
+ TimeoutBudget timeoutBudget) {
ApplicationId existingApplicationId = existingSession.getApplicationId();
File existingApp = getSessionAppDir(existingSession.getSessionId());
LocalSession session = createSessionFromApplication(existingApp, existingApplicationId, internalRedeploy, timeoutBudget);
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/ModelStub.java b/configserver/src/test/java/com/yahoo/vespa/config/server/ModelStub.java
index 8b515ff837b..88f7d352ad7 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/ModelStub.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/ModelStub.java
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server;
+import com.yahoo.config.ConfigInstance;
import com.yahoo.config.FileReference;
import com.yahoo.config.model.api.FileDistribution;
import com.yahoo.config.model.api.HostInfo;
@@ -20,11 +21,17 @@ import java.util.Set;
public class ModelStub implements Model {
@Override
+ @SuppressWarnings("deprecation")
public ConfigPayload getConfig(ConfigKey<?> configKey, ConfigDefinition targetDef) {
return null;
}
@Override
+ public ConfigInstance.Builder getConfigInstance(ConfigKey<?> configKey, ConfigDefinition targetDef) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public Set<ConfigKey<?>> allConfigsProduced() {
return null;
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/ServerCacheTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/ServerCacheTest.java
index 35449238f78..fa69df9f628 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/ServerCacheTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/ServerCacheTest.java
@@ -48,9 +48,9 @@ public class ServerCacheTest {
cache = new ServerCache(new TestConfigDefinitionRepo(), userConfigDefinitionRepo);
- cache.put(fooBarCacheKey, SlimeConfigResponse.fromConfigPayload(ConfigPayload.empty(), 2, false, configMd5), configMd5);
- cache.put(bazQuuxCacheKey, SlimeConfigResponse.fromConfigPayload(ConfigPayload.empty(), 2, false, configMd5), configMd5);
- cache.put(fooBarCacheKeyDifferentMd5, SlimeConfigResponse.fromConfigPayload(ConfigPayload.empty(), 2, false, configMd5_2), configMd5_2);
+ cache.put(fooBarCacheKey, SlimeConfigResponse.fromConfigPayload(ConfigPayload.empty(), 2, false, false, configMd5), configMd5);
+ cache.put(bazQuuxCacheKey, SlimeConfigResponse.fromConfigPayload(ConfigPayload.empty(), 2, false, false, configMd5), configMd5);
+ cache.put(fooBarCacheKeyDifferentMd5, SlimeConfigResponse.fromConfigPayload(ConfigPayload.empty(), 2, false, false, configMd5_2), configMd5_2);
}
@Test
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java b/configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java
index c9f25451ea4..0288a551cd3 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/application/MockModel.java
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.application;
+import com.yahoo.config.ConfigInstance;
import com.yahoo.config.FileReference;
import com.yahoo.config.model.api.FileDistribution;
import com.yahoo.config.model.api.HostInfo;
@@ -29,6 +30,7 @@ import java.util.stream.Collectors;
* @author hakonhall
*/
public class MockModel implements Model {
+
private final Collection<HostInfo> hosts;
static MockModel createContainer(String hostname, int statePort) {
@@ -72,11 +74,17 @@ public class MockModel implements Model {
}
@Override
+ @SuppressWarnings("deprecation")
public ConfigPayload getConfig(ConfigKey<?> configKey, ConfigDefinition targetDef) {
throw new UnsupportedOperationException();
}
@Override
+ public ConfigInstance.Builder getConfigInstance(ConfigKey<?> configKey, ConfigDefinition targetDef) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public Set<ConfigKey<?>> allConfigsProduced() {
throw new UnsupportedOperationException();
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpConfigResponseTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpConfigResponseTest.java
index ef0a5f6113d..336a8c623b8 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpConfigResponseTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/HttpConfigResponseTest.java
@@ -20,7 +20,7 @@ public class HttpConfigResponseTest {
public void require_that_response_is_created_from_config() throws IOException {
final long generation = 1L;
ConfigPayload payload = ConfigPayload.fromInstance(new SimpletypesConfig(new SimpletypesConfig.Builder()));
- ConfigResponse configResponse = SlimeConfigResponse.fromConfigPayload(payload, generation, false, "mymd5");
+ ConfigResponse configResponse = SlimeConfigResponse.fromConfigPayload(payload, generation, false, false, "mymd5");
HttpConfigResponse response = HttpConfigResponse.createFromConfig(configResponse);
assertThat(SessionHandlerTest.getRenderedString(response), is("{\"boolval\":false,\"doubleval\":0.0,\"enumval\":\"VAL1\",\"intval\":0,\"longval\":0,\"stringval\":\"s\"}"));
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/metrics/DeploymentMetricsRetrieverTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/metrics/DeploymentMetricsRetrieverTest.java
index a0025d086f5..3a68e0f4c65 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/metrics/DeploymentMetricsRetrieverTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/metrics/DeploymentMetricsRetrieverTest.java
@@ -1,6 +1,7 @@
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.metrics;
+import com.yahoo.config.ConfigInstance;
import com.yahoo.config.FileReference;
import com.yahoo.config.model.api.FileDistribution;
import com.yahoo.config.model.api.HostInfo;
@@ -83,11 +84,17 @@ public class DeploymentMetricsRetrieverTest {
}
@Override
+ @SuppressWarnings("deprecation")
public ConfigPayload getConfig(ConfigKey<?> configKey, ConfigDefinition targetDef) {
throw new UnsupportedOperationException();
}
@Override
+ public ConfigInstance.Builder getConfigInstance(ConfigKey<?> configKey, ConfigDefinition targetDef) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public Set<ConfigKey<?>> allConfigsProduced() {
throw new UnsupportedOperationException();
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/metrics/ProtonMetricsRetrieverTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/metrics/ProtonMetricsRetrieverTest.java
index e97c4dc6682..bbf9bd0bcb7 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/metrics/ProtonMetricsRetrieverTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/metrics/ProtonMetricsRetrieverTest.java
@@ -1,5 +1,6 @@
package com.yahoo.vespa.config.server.metrics;
+import com.yahoo.config.ConfigInstance;
import com.yahoo.config.FileReference;
import com.yahoo.config.model.api.FileDistribution;
import com.yahoo.config.model.api.HostInfo;
@@ -76,11 +77,17 @@ public class ProtonMetricsRetrieverTest {
}
@Override
+ @SuppressWarnings("deprecation")
public ConfigPayload getConfig(ConfigKey<?> configKey, ConfigDefinition targetDef) {
throw new UnsupportedOperationException();
}
@Override
+ public ConfigInstance.Builder getConfigInstance(ConfigKey<?> configKey, ConfigDefinition targetDef) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public Set<ConfigKey<?>> allConfigsProduced() {
throw new UnsupportedOperationException();
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactoryTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactoryTest.java
index 5d8b8c92472..c932627ce6a 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactoryTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactoryTest.java
@@ -16,7 +16,7 @@ public class ConfigResponseFactoryTest {
@Test
public void testUncompressedFactory() {
UncompressedConfigResponseFactory responseFactory = new UncompressedConfigResponseFactory();
- ConfigResponse response = responseFactory.createResponse(ConfigPayload.empty(), 3, false);
+ ConfigResponse response = responseFactory.createResponse(ConfigPayload.empty(), 3, false, false);
assertEquals(CompressionType.UNCOMPRESSED, response.getCompressionInfo().getCompressionType());
assertEquals(3L,response.getGeneration());
assertEquals(2, response.getPayload().getByteLength());
@@ -25,7 +25,7 @@ public class ConfigResponseFactoryTest {
@Test
public void testLZ4CompressedFactory() {
LZ4ConfigResponseFactory responseFactory = new LZ4ConfigResponseFactory();
- ConfigResponse response = responseFactory.createResponse(ConfigPayload.empty(), 3, false);
+ ConfigResponse response = responseFactory.createResponse(ConfigPayload.empty(), 3, false, false);
assertEquals(CompressionType.LZ4, response.getCompressionInfo().getCompressionType());
assertEquals(3L, response.getGeneration());
assertEquals(3, response.getPayload().getByteLength());
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpcServer.java b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpcServer.java
index 6ca3f6c67ea..7f4733f0b7c 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpcServer.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpcServer.java
@@ -25,7 +25,7 @@ import java.util.concurrent.CompletionService;
*/
public class MockRpcServer extends RpcServer {
- public final RuntimeException exception = null;
+ public RuntimeException exception = null;
public int errorCode = 0;
public final ConfigResponse response = null;