Helper method for sending a status-only HTTP response. This is used in cases where #createQueryInstance(TSDB, HttpRequest, Channel) failed to determine a query and we still want to return an error status to the client.
(final Channel chan, final HttpResponseStatus status)
| 310 | * and we still want to return an error status to the client. |
| 311 | */ |
| 312 | private void sendStatusAndClose(final Channel chan, final HttpResponseStatus status) { |
| 313 | if (chan.isConnected()) { |
| 314 | final DefaultHttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status); |
| 315 | final ChannelFuture future = chan.write(response); |
| 316 | future.addListener(ChannelFutureListener.CLOSE); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | /** |
| 321 | * Collects the stats and metrics tracked by this instance. |