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

Method findHistogramSpans

src/core/TsdbQuery.java:926–963  ·  view source on GitHub ↗

Finds all the HistogramSpans that match this query. This is what actually scans the HBase table and loads the data into HistogramSpans. @return A map from HBase row key to the HistogramSpan for that row key. Since a HistogramSpan actually contains multiple HBase rows

()

Source from the content-addressed store, hash-verified

924 * @throws IllegalArgumentException if bad data was retreived from HBase.
925 */
926 private Deferred<SortedMap<byte[], HistogramSpan>> findHistogramSpans() throws HBaseException {
927 final short metric_width = tsdb.metrics.width();
928 final TreeMap<byte[], HistogramSpan> histSpans = new TreeMap<byte[], HistogramSpan>(new SpanCmp(metric_width));
929
930 // Copy only the filters that should trigger a tag resolution. If this list
931 // is empty due to literals or a wildcard star, then we'll save a TON of
932 // UID lookups
933 final List<TagVFilter> scanner_filters;
934 if (filters != null) {
935 scanner_filters = new ArrayList<TagVFilter>(filters.size());
936 for (final TagVFilter filter : filters) {
937 if (filter.postScan()) {
938 scanner_filters.add(filter);
939 }
940 }
941 } else {
942 scanner_filters = null;
943 }
944
945 scan_start_time = System.nanoTime();
946 final List<Scanner> scanners;
947 if (Const.SALT_WIDTH() > 0) {
948 scanners = new ArrayList<Scanner>(Const.SALT_BUCKETS());
949 for (int i = 0; i < Const.SALT_BUCKETS(); i++) {
950 scanners.add(getScanner(i));
951 }
952 scan_start_time = DateTime.nanoTime();
953 return new SaltScanner(tsdb, metric, scanners, null, scanner_filters,
954 delete, rollup_query, query_stats, query_index, histSpans,
955 max_bytes, max_data_points).scanHistogram();
956 } else {
957 scanners = Lists.newArrayList(getScanner());
958 scan_start_time = DateTime.nanoTime();
959 return new SaltScanner(tsdb, metric, scanners, null, scanner_filters,
960 delete, rollup_query, query_stats, query_index, histSpans,
961 max_bytes, max_data_points).scanHistogram();
962 }
963 }
964
965 private Deferred<SortedMap<byte[], HistogramSpan>> findHistogramSpansWithMultiGetter() throws HBaseException {
966 final short metric_width = tsdb.metrics.width();

Callers 1

runHistogramAsyncMethod · 0.95

Calls 9

nanoTimeMethod · 0.95
SALT_WIDTHMethod · 0.95
SALT_BUCKETSMethod · 0.95
getScannerMethod · 0.95
postScanMethod · 0.80
scanHistogramMethod · 0.80
widthMethod · 0.65
sizeMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected