MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / parseTSMetaV1

Method parseTSMetaV1

src/tsd/HttpJsonSerializer.java:327–339  ·  view source on GitHub ↗

Parses a single TSMeta object @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed

()

Source from the content-addressed store, hash-verified

325 * @throws BadRequestException if the content was missing or parsing failed
326 */
327 public TSMeta parseTSMetaV1() {
328 final String json = query.getContent();
329 if (json == null || json.isEmpty()) {
330 throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
331 "Missing message content",
332 "Supply valid JSON formatted data in the body of your request");
333 }
334 try {
335 return JSON.parseToObject(json, TSMeta.class);
336 } catch (IllegalArgumentException iae) {
337 throw new BadRequestException("Unable to parse the given JSON", iae);
338 }
339 }
340
341 /**
342 * Parses a single Tree object

Callers

nothing calls this directly

Calls 3

parseToObjectMethod · 0.95
isEmptyMethod · 0.80
getContentMethod · 0.45

Tested by

no test coverage detected