kfaraz commented on code in PR #13609:
URL: https://github.com/apache/druid/pull/13609#discussion_r1055156452


##########
server/src/main/java/org/apache/druid/server/QueryResource.java:
##########
@@ -561,20 +549,27 @@ public ResultsWriter start()
     {
       return new ResultsWriter()
       {
+        private QueryResponse<Object> queryResponse;
+
         @Override
-        public QueryResponse<Object> start(HttpServletResponse response)
+        public Response.ResponseBuilder start()
         {
-          final QueryResponse<Object> queryResponse = queryLifecycle.execute();
+          queryResponse = queryLifecycle.execute();
           final ResponseContext responseContext = 
queryResponse.getResponseContext();
           final String prevEtag = getPreviousEtag(req);
 
           if (prevEtag != null && 
prevEtag.equals(responseContext.getEntityTag())) {
             queryLifecycle.emitLogsAndMetrics(null, req.getRemoteAddr(), -1);
             counter.incrementSuccess();
-            response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
-            return null;
+            return Response.status(Status.NOT_MODIFIED);

Review Comment:
   >  If/when we want to add other things, being able to just return a 
ResponseBuilder is the nicest API possible.
   
   That's true, if we want to add other things here in the future, 
ResponseBuilder would be the cleanest thing to do.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to