use of com.yahoo.vespa.config.RawConfig in project vespa by vespa-engine.
the class UpstreamConfigSubscriber method updateWithNewConfig.
private void updateWithNewConfig(GenericConfigHandle handle) {
final RawConfig newConfig = handle.getRawConfig();
if (log.isLoggable(LogLevel.DEBUG)) {
log.log(LogLevel.DEBUG, "config to be returned for '" + newConfig.getKey() + "', generation=" + newConfig.getGeneration() + ", payload=" + newConfig.getPayload());
}
memoryCache.put(newConfig);
clientUpdater.updateSubscribers(newConfig);
}
use of com.yahoo.vespa.config.RawConfig in project vespa by vespa-engine.
the class MockClientUpdater method waitForConfigGeneration.
long waitForConfigGeneration(ConfigKey<?> configKey, long expectedGeneration) {
Instant end = Instant.now().plus(Duration.ofSeconds(60));
RawConfig lastConfig;
do {
lastConfig = getLastConfig();
System.out.println("config=" + lastConfig + (lastConfig == null ? "" : ",generation=" + lastConfig.getGeneration()));
if (lastConfig != null && lastConfig.getKey().equals(configKey) && lastConfig.getGeneration() == expectedGeneration) {
break;
} else {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
} while (Instant.now().isBefore(end));
if (lastConfig == null || !lastConfig.getKey().equals(configKey) || lastConfig.getGeneration() != expectedGeneration)
throw new RuntimeException("Did not get config " + configKey + " with generation " + expectedGeneration);
return lastConfig.getGeneration();
}
use of com.yahoo.vespa.config.RawConfig in project vespa by vespa-engine.
the class MockConfigSourceClient method getConfig.
@Override
public RawConfig getConfig(RawConfig input, JRTServerConfigRequest request) {
final RawConfig config = getConfig(input.getKey());
memoryCache.put(config);
return config;
}
Aggregations