Package com.yahoo.vespa.config
Class RawConfig
java.lang.Object
com.yahoo.config.Node
com.yahoo.config.InnerNode
com.yahoo.config.ConfigInstance
com.yahoo.vespa.config.RawConfig
public class RawConfig
extends com.yahoo.config.ConfigInstance
Encapsulates config, usually associated with a
JRTConfigRequest
. An instance of this class can represent
either a config that is not yet resolved, a successfully resolved config, or an error.- Author:
- hmusum
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.config.ConfigInstance
com.yahoo.config.ConfigInstance.Builder, com.yahoo.config.ConfigInstance.Producer
-
Constructor Summary
ConstructorDescriptionConstructor for an empty config (not yet resolved).RawConfig
(ConfigKey<?> key, String defMd5, Payload payload, PayloadChecksums payloadChecksums, long generation, boolean applyOnRestart, int errorCode, List<String> defContent, Optional<VespaVersion> vespaVersion) RawConfig
(ConfigKey<?> key, String defMd5, Payload payload, PayloadChecksums payloadChecksums, long generation, boolean applyOnRestart, List<String> defContent, Optional<VespaVersion> vespaVersion) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
static RawConfig
Creates a new Config from the given request, with the values in the response parameters.static RawConfig
Creates a new Config from the given request, with the values in the response parameters.boolean
int
long
ConfigKey<?>
getKey()
getName()
boolean
Returns true if this config is equal to the config (same payload md5) in the given request.int
hashCode()
boolean
Returns true if this config has a more recent generation than the config in the given request.boolean
isError()
Convenience method.void
setApplyOnRestart
(boolean applyOnRestart) void
setGeneration
(long generation) toString()
Methods inherited from class com.yahoo.config.ConfigInstance
getDefName, getDefNamespace, serialize, serialize
Methods inherited from class com.yahoo.config.InnerNode
getAllDescendantLeafNodes, getChildren, getChildrenWithVectorsFlattened, postInitialize
Methods inherited from class com.yahoo.config.Node
clone
-
Constructor Details
-
RawConfig
Constructor for an empty config (not yet resolved).- Parameters:
key
- The ConfigKeydefMd5
- The md5 sum of the .def-file.
-
RawConfig
public RawConfig(ConfigKey<?> key, String defMd5, Payload payload, PayloadChecksums payloadChecksums, long generation, boolean applyOnRestart, List<String> defContent, Optional<VespaVersion> vespaVersion) -
RawConfig
Copy constructor -
RawConfig
public RawConfig(ConfigKey<?> key, String defMd5, Payload payload, PayloadChecksums payloadChecksums, long generation, boolean applyOnRestart, int errorCode, List<String> defContent, Optional<VespaVersion> vespaVersion)
-
-
Method Details
-
createFromResponseParameters
Creates a new Config from the given request, with the values in the response parameters.- Parameters:
req
- aJRTClientConfigRequest
-
createFromServerRequest
Creates a new Config from the given request, with the values in the response parameters.- Parameters:
req
- aJRTClientConfigRequest
-
getKey
-
getName
-
getNamespace
-
getConfigId
-
getDefMd5
-
getGeneration
public long getGeneration() -
setGeneration
public void setGeneration(long generation) -
setApplyOnRestart
public void setApplyOnRestart(boolean applyOnRestart) -
applyOnRestart
public boolean applyOnRestart() -
getPayload
-
errorCode
public int errorCode() -
getDefNamespace
-
getVespaVersion
-
getPayloadChecksums
-
hasEqualConfig
Returns true if this config is equal to the config (same payload md5) in the given request.- Parameters:
req
- the request for which to compare config payload with this config.- Returns:
- true if this config is equal to the config in the given request.
-
hasNewerGeneration
Returns true if this config has a more recent generation than the config in the given request.- Parameters:
req
- the request for which to compare generation with this config.- Returns:
- true if this config has a more recent generation than the config in the given request.
-
isError
public boolean isError()Convenience method.- Returns:
- true if errorCode() returns 0, false otherwise.
-
equals
- Overrides:
equals
in classcom.yahoo.config.InnerNode
-
hashCode
public int hashCode()- Overrides:
hashCode
in classcom.yahoo.config.InnerNode
-
toString
- Overrides:
toString
in classcom.yahoo.config.InnerNode
-
getDefContent
-