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

Method getTSMetas

src/meta/TSUIDQuery.java:344–447  ·  view source on GitHub ↗

Returns all TSMeta objects stored for timeseries defined by this query. The query is similar to TsdbQuery without any aggregations. Returns an empty list, when no TSMetas are found. Only returns stored TSMetas. NOTE: If you called #setQuery(String, Map) successfully this will immediately

()

Source from the content-addressed store, hash-verified

342 * tag map was null (Empty map is OK).
343 */
344 public Deferred<List<TSMeta>> getTSMetas() {
345 class ResolutionCB implements Callback<Deferred<List<TSMeta>>, Object> {
346 @Override
347 public Deferred<List<TSMeta>> call(final Object done) throws Exception {
348 final Scanner scanner = getScanner();
349 scanner.setQualifier(TSMeta.META_QUALIFIER());
350 final Deferred<List<TSMeta>> results = new Deferred<List<TSMeta>>();
351 final List<TSMeta> tsmetas = new ArrayList<TSMeta>();
352 final List<Deferred<TSMeta>> tsmeta_group = new ArrayList<Deferred<TSMeta>>();
353
354 final class TSMetaGroupCB implements Callback<Object,
355 ArrayList<TSMeta>> {
356 @Override
357 public List<TSMeta> call(ArrayList<TSMeta> ts) throws Exception {
358 for (TSMeta tsm: ts) {
359 if (tsm != null) {
360 tsmetas.add(tsm);
361 }
362 }
363 results.callback(tsmetas);
364 return null;
365 }
366 @Override
367 public String toString() {
368 return "TSMeta callback";
369 }
370 }
371
372 final class ErrBack implements Callback<Object, Exception> {
373 @Override
374 public Object call(final Exception e) throws Exception {
375 results.callback(e);
376 return null;
377 }
378 @Override
379 public String toString() {
380 return "Error callback";
381 }
382 }
383
384 /**
385 * Scanner callback that will call itself while iterating through the
386 * tsdb-meta table.
387 *
388 * Keeps track of a Set of Deferred TSMeta calls. When all rows are scanned,
389 * will wait for all TSMeta calls to be completed and then create the result
390 * list.
391 */
392 final class ScannerCB implements Callback<Object,
393 ArrayList<ArrayList<KeyValue>>> {
394
395 /**
396 * Starts the scanner and is called recursively to fetch the next set of
397 * rows from the scanner.
398 * @return The map of spans if loaded successfully, null if no data was
399 * found
400 */
401 public Object scan() {

Callers 7

handleTSMetaMethod · 0.95
getTSMetasSingleMethod · 0.80
getTSMetasNSUITagkMethod · 0.80
getTSMetasNullMetricMethod · 0.80

Calls 2

resolveMetricMethod · 0.95
callMethod · 0.45

Tested by 6

getTSMetasSingleMethod · 0.64
getTSMetasNSUITagkMethod · 0.64
getTSMetasNullMetricMethod · 0.64