diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-09-24 11:15:27 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-09-24 11:15:27 +0200 |
commit | 15c01353a75375d471dd4d84c8055b9f0848ca2d (patch) | |
tree | f90a9355f6652eac3e0c974057284e95608a7733 | |
parent | e2583ce1e0494b07ff75ef4d2595b3d06dabb433 (diff) |
No functional changes
14 files changed, 53 insertions, 37 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java b/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java index 2784c111019..decc6e98bc4 100644 --- a/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java +++ b/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java @@ -223,15 +223,11 @@ public abstract class AbstractConfigProducer<CHILD extends AbstractConfigProduce didApply = parent.addUserConfig(builder); } - if (log.isLoggable(Level.FINEST)) { - log.log(Level.FINEST, "User configs is: " + userConfigs.toString()); - } + log.log(Level.FINEST, () -> "User configs is: " + userConfigs.toString()); // TODO: What do we do with md5. Currently ignored for user configs? ConfigDefinitionKey key = new ConfigDefinitionKey(builder.getDefName(), builder.getDefNamespace()); if (userConfigs.get(key) != null) { - if (log.isLoggable(Level.FINEST)) { - log.log(Level.FINEST, "Apply in " + configId); - } + log.log(Level.FINEST, () -> "Apply in " + configId); applyUserConfig(builder, userConfigs.get(key)); didApply = true; } diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/DistributableResource.java b/config-model/src/main/java/com/yahoo/searchdefinition/DistributableResource.java index 1719ea72cb0..472bc9d5413 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/DistributableResource.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/DistributableResource.java @@ -11,6 +11,7 @@ import java.util.Collection; import java.util.Objects; public class DistributableResource { + public enum PathType { FILE, URI, BLOB }; /** The search definition-unique name of this constant */ @@ -95,10 +96,9 @@ public class DistributableResource { } } + @Override public String toString() { - StringBuilder b = new StringBuilder(); - b.append("resource '").append(name).append(" of type '").append(pathType) - .append("' with ref '").append(fileReference).append("'"); - return b.toString(); + return "resource '" + name + " of type '" + pathType + "' with ref '" + fileReference + "'"; } + } diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/IndexingOperation.java b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/IndexingOperation.java index 4332d8baea8..87fa74b92fe 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/IndexingOperation.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/IndexingOperation.java @@ -11,6 +11,7 @@ import com.yahoo.vespa.indexinglanguage.ScriptParserContext; import com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression; import com.yahoo.vespa.indexinglanguage.expressions.StatementExpression; import com.yahoo.vespa.indexinglanguage.linguistics.AnnotatorConfig; +import com.yahoo.yolean.Exceptions; /** * @author Einar M R Rosenvinge @@ -46,7 +47,7 @@ public class IndexingOperation implements FieldOperation { exp = new ScriptExpression(StatementExpression.newInstance(config)); } } catch (com.yahoo.vespa.indexinglanguage.parser.ParseException e) { - ParseException t = new ParseException("Error reported by IL parser: " + e.getMessage()); + ParseException t = new ParseException("Could not parse indexing statement: " + Exceptions.toMessageString(e)); t.initCause(e); throw t; } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java index 937537e5f99..2c87fd5c5b3 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java @@ -492,8 +492,8 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Seri boolean found = configProducer.cascadeConfig(builder); boolean foundOverride = configProducer.addUserConfig(builder); log.log(Level.FINE, () -> "Trying to get config for " + builder.getClass().getDeclaringClass().getName() + - " for config id " + quote(configProducer.getConfigId()) + - ", found=" + found + ", foundOverride=" + foundOverride); + " for config id " + quote(configProducer.getConfigId()) + + ", found=" + found + ", foundOverride=" + foundOverride); } /** diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/component/Component.java b/config-model/src/main/java/com/yahoo/vespa/model/container/component/Component.java index 6d891c55075..e7f6697aecc 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/component/Component.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/component/Component.java @@ -69,4 +69,10 @@ public class Component<CHILD extends AbstractConfigProducer<?>, MODEL extends Co return getComponentId().compareTo(other.getComponentId()); } + @Override + public String toString() { + return "component " + getClassId() + + (getClassId().toString().equals(getComponentId().toString()) ? "" : ": " + getComponentId()); + } + } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/utils/FileSender.java b/config-model/src/main/java/com/yahoo/vespa/model/utils/FileSender.java index de5eaa2278e..7d761eb07eb 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/utils/FileSender.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/utils/FileSender.java @@ -149,6 +149,7 @@ public class FileSender implements Serializable { String path = builder.getValue(); FileReference reference = sentFiles.get(path); if (reference == null) { + reference = fileRegistry.addFile(path); send(reference, services); sentFiles.put(path, reference); diff --git a/config/src/main/java/com/yahoo/vespa/config/ConfigTransformer.java b/config/src/main/java/com/yahoo/vespa/config/ConfigTransformer.java index 6d2ae3ef13e..7f81e937b3c 100644 --- a/config/src/main/java/com/yahoo/vespa/config/ConfigTransformer.java +++ b/config/src/main/java/com/yahoo/vespa/config/ConfigTransformer.java @@ -11,9 +11,12 @@ import static com.yahoo.vespa.config.ConfigPayloadApplier.IdentityPathAcquirer; /** * A utility class that can be used to transform config from one format to another. * - * @author Ulf Lilleengen, hmusum, Tony Vaagenes + * @author Ulf Lilleengen + * @author hmusum + * @author Tony Vaagenes */ public class ConfigTransformer<T extends ConfigInstance> { + /** * Workaround since FileAcquirer is in a separate module that depends on config. * Consider moving FileAcquirer into config instead. @@ -52,7 +55,7 @@ public class ConfigTransformer<T extends ConfigInstance> { /** * Create a ConfigBuilder from a payload, based on the <code>clazz</code> supplied. * - * @param payload a Payload to be transformed to builder. + * @param payload a Payload to be transformed to builder * @return a ConfigBuilder */ public ConfigInstance.Builder toConfigBuilder(ConfigPayload payload) { @@ -80,4 +83,5 @@ public class ConfigTransformer<T extends ConfigInstance> { return builder; } } + } diff --git a/config/src/main/java/com/yahoo/vespa/config/GenericConfig.java b/config/src/main/java/com/yahoo/vespa/config/GenericConfig.java index 123d7c22093..bc937ef57ea 100644 --- a/config/src/main/java/com/yahoo/vespa/config/GenericConfig.java +++ b/config/src/main/java/com/yahoo/vespa/config/GenericConfig.java @@ -5,7 +5,6 @@ import com.yahoo.config.ConfigBuilder; import com.yahoo.config.ConfigInstance; /** - * * A generic config with an internal generic builder that mimics a real config builder in order to support builders * when we don't have the schema. * diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/GetConfigContext.java b/configserver/src/main/java/com/yahoo/vespa/config/server/GetConfigContext.java index ef7d8756228..7a3fa9fe46c 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/GetConfigContext.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/GetConfigContext.java @@ -49,4 +49,10 @@ public class GetConfigContext { public String logPre() { return TenantRepository.logPre(app); } + + @Override + public String toString() { + return "get config context for application " + app + ", having handler " + requestHandler; + } + } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java index dd514e0d843..93148c52c3a 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java @@ -205,9 +205,8 @@ public class TenantApplications implements RequestHandler, HostValidator<Applica @Override public ConfigResponse resolveConfig(ApplicationId appId, GetConfigRequest req, Optional<Version> vespaVersion) { Application application = getApplication(appId, vespaVersion); - if (log.isLoggable(Level.FINE)) { - log.log(Level.FINE, TenantRepository.logPre(appId) + "Resolving for tenant '" + tenant + "' with handler for application '" + application + "'"); - } + log.log(Level.FINE, () -> TenantRepository.logPre(appId) + "Resolving for tenant '" + tenant + + "' with handler for application '" + application + "'"); return application.resolveConfig(req, responseFactory); } 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 bad03862133..412eafd9882 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 @@ -27,8 +27,8 @@ import java.util.logging.Logger; import static com.yahoo.vespa.config.protocol.SlimeConfigResponse.fromConfigPayload; /** -* @author hmusum -*/ + * @author hmusum + */ class GetConfigProcessor implements Runnable { private static final Logger log = Logger.getLogger(GetConfigProcessor.class.getName()); @@ -69,7 +69,7 @@ class GetConfigProcessor implements Runnable { // TODO: Increment statistics (Metrics) failed counters when requests fail public Pair<GetConfigContext, Long> getConfig(JRTServerConfigRequest request) { - //Request has already been detached + // Request has already been detached if ( ! request.validateParameters()) { // Error code is set in verifyParameters if parameters are not OK. log.log(Level.WARNING, "Parameters for request " + request + " did not validate: " + request.errorCode() + " : " + request.errorMessage()); @@ -140,6 +140,7 @@ class GetConfigProcessor implements Runnable { } return null; } + @Override public void run() { rpcServer.hostLivenessTracker().receivedRequestFrom(request.getClientHostName()); diff --git a/standalone-container/src/main/java/com/yahoo/container/standalone/LocalFileDb.java b/standalone-container/src/main/java/com/yahoo/container/standalone/LocalFileDb.java index ed7d30c476f..c9e0f0e8c76 100644 --- a/standalone-container/src/main/java/com/yahoo/container/standalone/LocalFileDb.java +++ b/standalone-container/src/main/java/com/yahoo/container/standalone/LocalFileDb.java @@ -24,6 +24,7 @@ import java.util.stream.Collectors; * @author ollivir */ public class LocalFileDb implements FileAcquirer, FileRegistry { + private final Map<FileReference, File> fileReferenceToFile = new HashMap<>(); private final Path appPath; @@ -48,6 +49,7 @@ public class LocalFileDb implements FileAcquirer, FileRegistry { } /* FileRegistry overrides */ + @Override public FileReference addFile(String relativePath) { File file = appPath.resolve(relativePath).toFile(); if (!file.exists()) { diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java index 0089499701f..6fea2d3faa4 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java @@ -22,18 +22,19 @@ public interface FeedClient extends Closeable { /** * Send a document put with the given parameters, returning a future with the result of the operation. * Exceptional completion will use be an instance of {@link FeedException} or one of its sub-classes. - * */ + */ CompletableFuture<Result> put(DocumentId documentId, String documentJson, OperationParameters params); /** * Send a document update with the given parameters, returning a future with the result of the operation. * Exceptional completion will use be an instance of {@link FeedException} or one of its sub-classes. - * */ + */ CompletableFuture<Result> update(DocumentId documentId, String updateJson, OperationParameters params); - /** Send a document remove with the given parameters, returning a future with the result of the operation. - * Exceptional completion will use be an instance of {@link FeedException} or one of its sub-classes. - * */ + /** + * Send a document remove with the given parameters, returning a future with the result of the operation. + * Exceptional completion will use be an instance of {@link FeedException} or one of its sub-classes. + */ CompletableFuture<Result> remove(DocumentId documentId, OperationParameters params); /** Returns a snapshot of the stats for this feed client, such as requests made, and responses by status. */ diff --git a/vespajlib/src/main/java/com/yahoo/slime/ArrayValue.java b/vespajlib/src/main/java/com/yahoo/slime/ArrayValue.java index c8a7f2253bb..ac1a33eea0d 100644 --- a/vespajlib/src/main/java/com/yahoo/slime/ArrayValue.java +++ b/vespajlib/src/main/java/com/yahoo/slime/ArrayValue.java @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.slime; - final class ArrayValue extends Value { private int capacity = 16; @@ -10,16 +9,16 @@ final class ArrayValue extends Value { private final SymbolTable names; public ArrayValue(SymbolTable names) { this.names = names; } - public final Type type() { return Type.ARRAY; } - public final int children() { return used; } - public final int entries() { return used; } - public final Value entry(int index) { + public Type type() { return Type.ARRAY; } + public int children() { return used; } + public int entries() { return used; } + public Value entry(int index) { return (index < used) ? values[index] : NixValue.invalid(); } - public final void accept(Visitor v) { v.visitArray(this); } + public void accept(Visitor v) { v.visitArray(this); } - public final void traverse(ArrayTraverser at) { + public void traverse(ArrayTraverser at) { for (int i = 0; i < used; i++) { at.entry(i, values[i]); } @@ -32,7 +31,7 @@ final class ArrayValue extends Value { System.arraycopy(v, 0, values, 0, used); } - protected final Value addLeaf(Value value) { + protected Value addLeaf(Value value) { if (used == capacity) { grow(); } @@ -40,6 +39,7 @@ final class ArrayValue extends Value { return value; } - public final Value addArray() { return addLeaf(new ArrayValue(names)); } - public final Value addObject() { return addLeaf(new ObjectValue(names)); } + public Value addArray() { return addLeaf(new ArrayValue(names)); } + public Value addObject() { return addLeaf(new ObjectValue(names)); } + } |