public final class VespaHeaders extends Object
Modifier and Type | Field and Description |
---|---|
private static int |
BAD_GATEWAY |
private static int |
GATEWAY_TIMEOUT |
private static int |
NETWORK_AUTHENTICATION_REQUIRED |
private static com.yahoo.collections.Tuple2<Boolean,Integer> |
NO_MATCH |
private static int |
PRECONDITION_REQUIRED |
private static int |
REQUEST_HEADER_FIELDS_TOO_LARGE |
private static int |
TOO_MANY_REQUESTS |
Constructor and Description |
---|
VespaHeaders() |
Modifier and Type | Method and Description |
---|---|
static boolean |
benchmarkCoverage(boolean benchmarkOutput,
com.yahoo.jdisc.HeaderFields headers) |
static void |
benchmarkOutput(com.yahoo.jdisc.HeaderFields responseHeaders,
boolean benchmarkCoverage,
Timing t,
com.yahoo.container.logging.HitCounts c,
int errorCount,
Coverage coverage)
Add search benchmark output to the HTTP getHeaders
|
static boolean |
benchmarkOutput(HttpRequest request) |
private static com.yahoo.collections.Tuple2<Boolean,Integer> |
chooseStatusFromError(com.yahoo.processing.request.ErrorMessage error) |
private static com.yahoo.collections.Tuple2<Boolean,Integer> |
chooseWebServiceStatus(com.yahoo.processing.request.ErrorMessage error) |
static int |
getEagerErrorStatus(com.yahoo.processing.request.ErrorMessage mainError,
Iterator<? extends com.yahoo.processing.request.ErrorMessage> allErrors)
Returns 5xx or 4xx if there is any error present in the result, 200 otherwise
|
static int |
getStatus(boolean isSuccess,
com.yahoo.processing.request.ErrorMessage mainError,
Iterator<? extends com.yahoo.processing.request.ErrorMessage> allErrors)
(during normal execution) return 200 unless this is not a success or a 4xx error is requested.
|
private static boolean |
isHttpStatusCode(int code) |
private static com.yahoo.collections.Tuple2<Boolean,Integer> |
webServiceCodes(com.yahoo.processing.request.ErrorMessage mainError,
Iterator<? extends com.yahoo.processing.request.ErrorMessage> allErrors) |
private static final int GATEWAY_TIMEOUT
private static final int BAD_GATEWAY
private static final int PRECONDITION_REQUIRED
private static final int TOO_MANY_REQUESTS
private static final int REQUEST_HEADER_FIELDS_TOO_LARGE
private static final int NETWORK_AUTHENTICATION_REQUIRED
public static boolean benchmarkCoverage(boolean benchmarkOutput, com.yahoo.jdisc.HeaderFields headers)
public static boolean benchmarkOutput(HttpRequest request)
public static void benchmarkOutput(com.yahoo.jdisc.HeaderFields responseHeaders, boolean benchmarkCoverage, Timing t, com.yahoo.container.logging.HitCounts c, int errorCount, Coverage coverage)
responseHeaders
- The response to write the headers to.benchmarkCoverage
- True to include coverage headers.t
- The Timing to read data from.c
- The Counts to read data from.errorCount
- The error count.coverage
- The Coverage to read data from.public static int getStatus(boolean isSuccess, com.yahoo.processing.request.ErrorMessage mainError, Iterator<? extends com.yahoo.processing.request.ErrorMessage> allErrors)
isSuccess
- Whether or not the response represents a success.mainError
- The main error of the response, if any.allErrors
- All the errors of the response, if any.private static com.yahoo.collections.Tuple2<Boolean,Integer> webServiceCodes(com.yahoo.processing.request.ErrorMessage mainError, Iterator<? extends com.yahoo.processing.request.ErrorMessage> allErrors)
private static com.yahoo.collections.Tuple2<Boolean,Integer> chooseWebServiceStatus(com.yahoo.processing.request.ErrorMessage error)
private static boolean isHttpStatusCode(int code)
public static int getEagerErrorStatus(com.yahoo.processing.request.ErrorMessage mainError, Iterator<? extends com.yahoo.processing.request.ErrorMessage> allErrors)
mainError
- The main error of the response.allErrors
- All the errors of the response, if any.Copyright © 2017. All rights reserved.