diff options
author | gjoranv <gjoranv@gmail.com> | 2018-06-20 14:52:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-20 14:52:45 +0200 |
commit | 97ee583a295562b2e927c2d49795397657aa0f38 (patch) | |
tree | b0f9ddb7372a72e0f8dc6d71b219070f8dff973e /config | |
parent | 930212818c2f17c7f6df841192f564eb6fa3de25 (diff) | |
parent | 03c8064cb0000c05058b72e61438718aa84bd6ae (diff) |
Merge pull request #6243 from vespa-engine/bratseth/nonfunctional-changes-2
Nonfunctional changes
Diffstat (limited to 'config')
10 files changed, 45 insertions, 15 deletions
diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/ConfigSubscription.java b/config/src/main/java/com/yahoo/config/subscription/impl/ConfigSubscription.java index 9f277330401..64eee39af1f 100644 --- a/config/src/main/java/com/yahoo/config/subscription/impl/ConfigSubscription.java +++ b/config/src/main/java/com/yahoo/config/subscription/impl/ConfigSubscription.java @@ -324,6 +324,7 @@ public abstract class ConfigSubscription<T extends ConfigInstance> { * True if someone has set the {@link #reloadedGeneration} number by calling {@link #reload(long)} * and hence wants to force a given generation programmatically. If that is the case, * sets the generation and flags it as changed accordingly. + * * @return true if {@link #reload(long)} has been called, false otherwise */ protected boolean checkReloaded() { diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/GenericConfigHandle.java b/config/src/main/java/com/yahoo/config/subscription/impl/GenericConfigHandle.java index 916aa6faeff..bf247dffb7c 100644 --- a/config/src/main/java/com/yahoo/config/subscription/impl/GenericConfigHandle.java +++ b/config/src/main/java/com/yahoo/config/subscription/impl/GenericConfigHandle.java @@ -12,14 +12,15 @@ import com.yahoo.vespa.config.RawConfig; @SuppressWarnings({"rawtypes", "unchecked"}) public class GenericConfigHandle extends ConfigHandle { - private final GenericJRTConfigSubscription genSub; + private final GenericJRTConfigSubscription subscription; - public GenericConfigHandle(GenericJRTConfigSubscription sub) { - super(sub); - genSub = sub; + public GenericConfigHandle(GenericJRTConfigSubscription subscription) { + super(subscription); + this.subscription = subscription; } public RawConfig getRawConfig() { - return genSub.getRawConfig(); + return subscription.getRawConfig(); } + } diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/GenericConfigSubscriber.java b/config/src/main/java/com/yahoo/config/subscription/impl/GenericConfigSubscriber.java index a33c1556dd3..82d4708f53b 100644 --- a/config/src/main/java/com/yahoo/config/subscription/impl/GenericConfigSubscriber.java +++ b/config/src/main/java/com/yahoo/config/subscription/impl/GenericConfigSubscriber.java @@ -19,6 +19,7 @@ import com.yahoo.vespa.config.TimingValues; * @author vegardh */ public class GenericConfigSubscriber extends ConfigSubscriber { + /** * Constructs a new subscriber using the given pool of requesters (JRTConfigRequester holds 1 connection which in * turn is subject to failover across the elems in the source set.) @@ -72,4 +73,5 @@ public class GenericConfigSubscriber extends ConfigSubscriber { */ public void closeRequesters() { } + } diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java index 920c8c264e7..58f720b8cb6 100644 --- a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java +++ b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java @@ -172,6 +172,7 @@ public class JRTConfigSubscription<T extends ConfigInstance> extends ConfigSubsc /** * The timing values of this + * * @return timing values */ public TimingValues timingValues() { diff --git a/config/src/main/java/com/yahoo/vespa/config/ConfigCacheKey.java b/config/src/main/java/com/yahoo/vespa/config/ConfigCacheKey.java index 79edeea99fc..e8e3fe9ed94 100644 --- a/config/src/main/java/com/yahoo/vespa/config/ConfigCacheKey.java +++ b/config/src/main/java/com/yahoo/vespa/config/ConfigCacheKey.java @@ -3,10 +3,11 @@ package com.yahoo.vespa.config; /** * A ConfigKey that also uses the def MD5 sum. Used for caching when def payload is user provided. - * @author vegardh * + * @author Vegard Havdal */ public class ConfigCacheKey { + private final ConfigKey<?> key; private final String defMd5; @@ -45,6 +46,7 @@ public class ConfigCacheKey { /** * The def md5 sum of this key + * * @return md5 sum */ public String getDefMd5() { diff --git a/config/src/main/java/com/yahoo/vespa/config/ConfigKey.java b/config/src/main/java/com/yahoo/vespa/config/ConfigKey.java index 5f068c4708a..930b74ea804 100755 --- a/config/src/main/java/com/yahoo/vespa/config/ConfigKey.java +++ b/config/src/main/java/com/yahoo/vespa/config/ConfigKey.java @@ -135,4 +135,5 @@ public class ConfigKey<CONFIGCLASS extends ConfigInstance> implements Comparable public static ConfigKey<?> createFull(String name, String configId, String namespace, String md5) { return new ConfigKey<>(name, configId, namespace, md5, null); } + } diff --git a/config/src/main/java/com/yahoo/vespa/config/GetConfigRequest.java b/config/src/main/java/com/yahoo/vespa/config/GetConfigRequest.java index 8021fa95514..c5eeab74157 100644 --- a/config/src/main/java/com/yahoo/vespa/config/GetConfigRequest.java +++ b/config/src/main/java/com/yahoo/vespa/config/GetConfigRequest.java @@ -7,10 +7,8 @@ import java.util.Optional; /** * Interface for getConfig requests. - * @author lulf - * @since 5.3 + * @author Ulf Lilleengen */ - public interface GetConfigRequest { /** @@ -22,6 +20,7 @@ public interface GetConfigRequest { /** * The def file contents in the request, or empty array if not sent/not supported + * * @return the contents (payload) of the def schema */ DefContent getDefContent(); @@ -33,7 +32,9 @@ public interface GetConfigRequest { /** * Whether or not the config can be retrieved from or stored in a cache. + * * @return true if content should _not_ be cached, false if it should. */ boolean noCache(); + } diff --git a/config/src/main/java/com/yahoo/vespa/config/RawConfig.java b/config/src/main/java/com/yahoo/vespa/config/RawConfig.java index 8ff69b56ffe..96908f055f1 100755 --- a/config/src/main/java/com/yahoo/vespa/config/RawConfig.java +++ b/config/src/main/java/com/yahoo/vespa/config/RawConfig.java @@ -35,6 +35,7 @@ public class RawConfig extends ConfigInstance { /** * Constructor for an empty config (not yet resolved). + * * @param key The ConfigKey * @param defMd5 The md5 sum of the .def-file. */ @@ -69,6 +70,7 @@ public class RawConfig extends ConfigInstance { /** * Creates a new Config from the given request, with the values in the response parameters. + * * @param req a {@link JRTClientConfigRequest} */ public static RawConfig createFromResponseParameters(JRTClientConfigRequest req) { @@ -85,6 +87,7 @@ public class RawConfig extends ConfigInstance { /** * Creates a new Config from the given request, with the values in the response parameters. + * * @param req a {@link JRTClientConfigRequest} */ public static RawConfig createFromServerRequest(JRTServerConfigRequest req) { @@ -135,7 +138,7 @@ public class RawConfig extends ConfigInstance { /** * Returns true if this config is equal to the config (same payload md5) in the given request. * - * @param req The request for which to compare config payload with this config. + * @param req the request for which to compare config payload with this config. * @return true if this config is equal to the config in the given request. */ public boolean hasEqualConfig(JRTServerConfigRequest req) { @@ -145,7 +148,7 @@ public class RawConfig extends ConfigInstance { /** * Returns true if this config has a more recent generation than the config in the given request. * - * @param req The request for which to compare generation with this config. + * @param req the request for which to compare generation with this config. * @return true if this config has a more recent generation than the config in the given request. */ public boolean hasNewerGeneration(JRTServerConfigRequest req) { @@ -160,6 +163,7 @@ public class RawConfig extends ConfigInstance { return (errorCode() != 0); } + @Override public boolean equals(Object o) { if (o == this) { return true; @@ -186,6 +190,7 @@ public class RawConfig extends ConfigInstance { } } + @Override public int hashCode() { int hash = 17; if (key != null) { @@ -205,6 +210,7 @@ public class RawConfig extends ConfigInstance { return hash; } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(key.getNamespace()).append(".").append(key.getName()); @@ -224,4 +230,5 @@ public class RawConfig extends ConfigInstance { public List<String> getDefContent() { return defContent; } + } diff --git a/config/src/main/java/com/yahoo/vespa/config/protocol/JRTConfigRequest.java b/config/src/main/java/com/yahoo/vespa/config/protocol/JRTConfigRequest.java index 46b3651afd7..26fa41c19c7 100644 --- a/config/src/main/java/com/yahoo/vespa/config/protocol/JRTConfigRequest.java +++ b/config/src/main/java/com/yahoo/vespa/config/protocol/JRTConfigRequest.java @@ -8,11 +8,14 @@ import java.util.Optional; /** * Common interface for jrt config requests available both at server and client. + * * @author Ulf Lilleengen */ public interface JRTConfigRequest { + /** * Get the config key of the config request. + * * @return a {@link ConfigKey}. */ ConfigKey<?> getConfigKey(); @@ -20,18 +23,21 @@ public interface JRTConfigRequest { /** * Perform request parameter validation of this config request. This method should be called before fetching * any kind of config protocol-specific parameter. + * * @return true if valid, false if not. */ boolean validateParameters(); /** * Get the config md5 of the config request. Return an empty string if no response has been returned. + * * @return a config md5. */ String getRequestConfigMd5(); /** * Get the generation of the requested config. If none has been given, 0 should be returned. + * * @return the generation in the request. */ long getRequestGeneration(); @@ -39,42 +45,49 @@ public interface JRTConfigRequest { /** * Get the JRT request object for this config request. * TODO: This method leaks the internal jrt stuff :( + * * @return a {@link Request} object. */ Request getRequest(); /** * Get a short hand description of this request. + * * @return a short description */ String getShortDescription(); /** * Get the error code of this request + * * @return the error code as defined in {@link com.yahoo.vespa.config.ErrorCode}. */ int errorCode(); /** * Return the error message of this request, mostly corresponding to the {@link com.yahoo.vespa.config.ErrorCode}. + * * @return the error message. */ String errorMessage(); /** * Get the server timeout of this request. + * * @return the timeout given to the server */ long getTimeout(); /** * Get the config protocol version + * * @return a protocol version number. */ long getProtocolVersion(); /** * Get the wanted generation for this request. + * * @return a generation that client would like. */ long getWantedGeneration(); @@ -87,7 +100,9 @@ public interface JRTConfigRequest { /** * Get the Vespa version of the client that initiated the request + * * @return Vespa version of the client */ Optional<VespaVersion> getVespaVersion(); + } diff --git a/config/src/main/java/com/yahoo/vespa/config/protocol/SlimeRequestData.java b/config/src/main/java/com/yahoo/vespa/config/protocol/SlimeRequestData.java index 65e50acb72d..5e88c4cb146 100644 --- a/config/src/main/java/com/yahoo/vespa/config/protocol/SlimeRequestData.java +++ b/config/src/main/java/com/yahoo/vespa/config/protocol/SlimeRequestData.java @@ -12,11 +12,10 @@ import com.yahoo.vespa.config.ConfigKey; import java.util.Optional; /** - * Contains slime request data objects. Provides methods for reading various fields from slime request data. All - * data is read lazily. + * Contains slime request data objects. Provides methods for reading various fields from slime request data. + * All data is read lazily. * -* @author lulf -* @since 5.18 +* @author Ulf Lilleengen */ class SlimeRequestData { |