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

Method parseUidAssignV1

src/tsd/HttpJsonSerializer.java:224–236  ·  view source on GitHub ↗

Parses a list of metrics, tagk and/or tagvs to assign UIDs to @return as hash map of lists for the different types @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed

()

Source from the content-addressed store, hash-verified

222 * @throws BadRequestException if the content was missing or parsing failed
223 */
224 public HashMap<String, List<String>> parseUidAssignV1() {
225 final String json = query.getContent();
226 if (json == null || json.isEmpty()) {
227 throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
228 "Missing message content",
229 "Supply valid JSON formatted data in the body of your request");
230 }
231 try {
232 return JSON.parseToObject(json, UID_ASSIGN);
233 } catch (IllegalArgumentException iae) {
234 throw new BadRequestException("Unable to parse the given JSON", iae);
235 }
236 }
237
238 /**
239 * Parses metric, tagk or tagv, and name to rename UID

Callers

nothing calls this directly

Calls 3

parseToObjectMethod · 0.95
isEmptyMethod · 0.80
getContentMethod · 0.45

Tested by

no test coverage detected