diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-09-14 21:33:41 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-09-14 21:33:41 +0200 |
commit | f48d0f17f60ef074e131da38cb032a2af8328e84 (patch) | |
tree | 7d706e4813a80263195ff2e311a8e986dfdc9ae2 /jdisc_core | |
parent | a6a4e2d89afc8f299506ec3c97c9b3613dd26950 (diff) |
Propagate requestType through jdisc core response
Diffstat (limited to 'jdisc_core')
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/Request.java | 7 | ||||
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/Response.java | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java b/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java index bce6f72c1fc..895ddb30a6d 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java @@ -48,7 +48,6 @@ public class Request extends AbstractResource { private boolean serverRequest; private Long timeout; private URI uri; - private RequestType requestType; public enum RequestType { READ, WRITE, MONITORING @@ -331,12 +330,6 @@ public class Request extends AbstractResource { return unit.convert(creationTime, TimeUnit.MILLISECONDS); } - /** Sets the type classification of this request for metric collection purposes */ - public void setRequestType(RequestType requestType) { this.requestType = requestType; } - - /** Returns the type classification of this request for metric collection purposes, or null if not set */ - public RequestType getRequestType() { return requestType; } - /** * <p>Returns whether or not this Request has been cancelled. This can be thought of as the {@link * Thread#isInterrupted()} of Requests - it does not enforce anything in ways of blocking the Request, it is simply diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/Response.java b/jdisc_core/src/main/java/com/yahoo/jdisc/Response.java index ec9d2e0df84..c3d07a70e14 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/Response.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/Response.java @@ -102,6 +102,7 @@ public class Response { private final HeaderFields headers = new HeaderFields(); private Throwable error; private int status; + private Request.RequestType requestType; /** * Creates a new instance of this class. @@ -205,6 +206,12 @@ public class Response { return this; } + /** Sets the type classification of this request for metric collection purposes */ + public void setRequestType(Request.RequestType requestType) { this.requestType = requestType; } + + /** Returns the type classification of this request for metric collection purposes, or null if not set */ + public Request.RequestType getRequestType() { return requestType; } + /** * This is a convenience method for creating a Response with status {@link Status#GATEWAY_TIMEOUT} and passing * that to the given {@link ResponseHandler#handleResponse(Response)}. For trivial implementations of {@link |