Handles HTTP RPC put requests @param tsdb The TSDB to which we belong @param query The HTTP query from the user @throws IOException if there is an error parsing the query or formatting the output @throws BadRequestException if the user supplied bad data
(final TSDB tsdb, final HttpQuery query)
| 62 | * @throws BadRequestException if the user supplied bad data |
| 63 | */ |
| 64 | @Override |
| 65 | public void execute(final TSDB tsdb, final HttpQuery query) |
| 66 | throws IOException { |
| 67 | http_requests.incrementAndGet(); |
| 68 | |
| 69 | // only accept POST |
| 70 | if (query.method() != HttpMethod.POST) { |
| 71 | throw new BadRequestException(HttpResponseStatus.METHOD_NOT_ALLOWED, |
| 72 | "Method not allowed", "The HTTP method [" + query.method().getName() + |
| 73 | "] is not permitted for this endpoint"); |
| 74 | } |
| 75 | |
| 76 | final List<RollUpDataPoint> dps = query.serializer() |
| 77 | .parsePutV1(RollUpDataPoint.class, HttpJsonSerializer.TR_ROLLUP); |
| 78 | processDataPoint(tsdb, query, dps); |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Imports a single rolled up data point. |