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

Method call

src/core/SaltScanner.java:535–726  ·  view source on GitHub ↗

Iterate through each row of the scanner results, parses out data points (and optional meta data). @return null if no rows were found, otherwise the SortedMap with spans

(final ArrayList<ArrayList<KeyValue>> rows)

Source from the content-addressed store, hash-verified

533 * @return null if no rows were found, otherwise the SortedMap with spans
534 */
535 @Override
536 public Object call(final ArrayList<ArrayList<KeyValue>> rows)
537 throws Exception {
538 try {
539 fetch_time += DateTime.nanoTime() - fetch_start;
540 if (rows == null) {
541 close(true);
542 return null;
543 } else if (exception != null) {
544 close(false);
545 // don't need to handleException here as it's already taken care of
546 // due to the fact that exception was set.
547 if (LOG.isDebugEnabled()) {
548 LOG.debug("Closing scanner as there was an exception: " + scanner);
549 }
550 return null;
551 }
552
553 // used for UID resolution if a filter is involved
554 final List<Deferred<Object>> lookups =
555 filters != null && !filters.isEmpty() ?
556 new ArrayList<Deferred<Object>>(rows.size()) : null;
557
558 // validation checking before processing the next set of results. It's
559 // kinda funky but we want to allow queries to sneak through that were
560 // just a *tad* over the limits so that's why we don't check at the
561 // end of a scan call.
562 if (max_data_points > 0 && num_data_points.get() >= max_data_points) {
563 max_data_points_flag.getAndSet(true);
564 try {
565 close(false);
566 handleException(
567 new QueryException(HttpResponseStatus.REQUEST_ENTITY_TOO_LARGE,
568 "Sorry, you have attempted to fetch more than our limit of "
569 + max_data_points + " data points. Please try filtering "
570 + "using more tags or decrease your time range."));
571 return false;
572 } catch (Exception e) {
573 LOG.error("Sorry, Scanner is closed: " + scanner, e);
574 return false;
575 }
576 }
577
578 if (max_bytes > 0 && bytes_fetched.get() > max_bytes) {
579 max_data_points_flag.getAndSet(true);
580 try {
581 close(false);
582 handleException(
583 new QueryException(HttpResponseStatus.REQUEST_ENTITY_TOO_LARGE,
584 "Sorry, you have attempted to fetch more than our maximum "
585 + "amount of " + (max_bytes / 1024 / 1024) + "MB from storage. "
586 + "Please try filtering using more tags or decrease your time range."));
587 return false;
588 } catch (Exception e) {
589 LOG.error("Sorry, Scanner is closed: " + scanner, e);
590 return false;
591 }
592 }

Callers

nothing calls this directly

Calls 15

nanoTimeMethod · 0.95
closeMethod · 0.95
rowKeyContainsMetricMethod · 0.95
inMillisecondsMethod · 0.95
getQualifierLengthMethod · 0.95
uidToStringMethod · 0.95
getTSUIDFromKeyMethod · 0.95
metrics_widthMethod · 0.95
getTagsAsyncMethod · 0.95
processRowMethod · 0.95
scanMethod · 0.95

Tested by

no test coverage detected