Package com.yahoo.vespa.config.protocol
Interface JRTServerConfigRequest
- All Superinterfaces:
GetConfigRequest
,JRTConfigRequest
- All Known Implementing Classes:
JRTServerConfigRequestV3
Interface for config requests at the server end point.
- Author:
- Ulf Lilleengen
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addErrorResponse
(int errorCode, String message) Signal error when handling this request.void
addOkResponse
(Payload payload, long generation, boolean applyOnRestart, PayloadChecksums payloadChecksums) Signal that the request was handled and provide return values typically needed by a client.boolean
Returns the payload checksums from the config request.Returns the md5 of the config definition in the request.long
Get the current config generation of the client config.Get the request trace for this request.boolean
Check whether or not this request is delayed.payloadFromResponse
(ConfigResponse response) Extract the appropriate payload for this request type for a given config response.void
setDelayedResponse
(boolean delayedResponse) Notify this request that its delayed due to no new config being available at this point.Methods inherited from interface com.yahoo.vespa.config.GetConfigRequest
getConfigKey, getDefContent, getVespaVersion, noCache
Methods inherited from interface com.yahoo.vespa.config.protocol.JRTConfigRequest
errorCode, errorMessage, getClientHostName, getConfigKey, getProtocolVersion, getRequest, getRequestConfigChecksums, getShortDescription, getTimeout, getVespaVersion, validateParameters
-
Method Details
-
setDelayedResponse
void setDelayedResponse(boolean delayedResponse) Notify this request that its delayed due to no new config being available at this point. The value provided in this function should be returned when callingisDelayedResponse()
.- Parameters:
delayedResponse
- true if response is delayed, false if not.
-
addErrorResponse
Signal error when handling this request. The error should be reflected in the request state and propagated back to the client.- Parameters:
errorCode
- error code, as described inErrorCode
.message
- message to display for this error, typically printed by client.
-
addOkResponse
void addOkResponse(Payload payload, long generation, boolean applyOnRestart, PayloadChecksums payloadChecksums) Signal that the request was handled and provide return values typically needed by a client.- Parameters:
payload
- The config payload that the client should receive.generation
- The config generation of the given payload.applyOnRestart
- true if this config should only be applied on the next restart, false if it should be applied right awaypayloadChecksums
- checksums of the given payload.
-
getRequestDefMd5
String getRequestDefMd5()Returns the md5 of the config definition in the request.- Specified by:
getRequestDefMd5
in interfaceGetConfigRequest
- Specified by:
getRequestDefMd5
in interfaceJRTConfigRequest
- Returns:
- an md5 of config definition in request.
-
getRequestGeneration
long getRequestGeneration()Get the current config generation of the client config.- Specified by:
getRequestGeneration
in interfaceJRTConfigRequest
- Returns:
- the current config generation.
-
isDelayedResponse
boolean isDelayedResponse()Check whether or not this request is delayed.- Returns:
- true if delayed, false if not.
-
applyOnRestart
boolean applyOnRestart() -
getRequestTrace
Trace getRequestTrace()Get the request trace for this request. The trace can be used to trace config execution to provide useful debug info in production environments.- Returns:
- a
Trace
instance.
-
payloadFromResponse
Extract the appropriate payload for this request type for a given config response.- Parameters:
response
-ConfigResponse
to get payload from.- Returns:
- A
Payload
that satisfies this request format.
-
configPayloadChecksums
PayloadChecksums configPayloadChecksums()Returns the payload checksums from the config request.- Specified by:
configPayloadChecksums
in interfaceGetConfigRequest
- Returns:
- the payload checksumss from request.
-