Package co.cask.cdap.metrics.data

Examples of co.cask.cdap.metrics.data.TimeSeriesTable$ScannerFields


    return (prefixEntity == null || prefixEntity.isEmpty()) ? null : prefixEntity.get(0);
  }

  private void deleteTableEntries(MetricsScope scope, String contextPrefix,
                                  String metricPrefix, String tag) throws OperationException {
    TimeSeriesTable ts1Table = metricsTableCaches.get(scope).getUnchecked(1);
    AggregatesTable aggTable = aggregatesTables.get().get(scope);

    if (contextPrefix == null && tag == null && metricPrefix == null) {
      ts1Table.clear();
      aggTable.clear();
    } else if (tag == null) {
      ts1Table.delete(contextPrefix, metricPrefix);
      aggTable.delete(contextPrefix, metricPrefix);
    } else {
      long now = TimeUnit.SECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
      MetricsScanQuery scanQuery = new MetricsScanQueryBuilder()
        .setContext(contextPrefix)
        .setMetric(metricPrefix)
        .allowEmptyMetric()
        .setRunId("0")
        .setTag(tag)
        .build(now - tsRetentionSeconds, now + 10);
      ts1Table.delete(scanQuery);
      aggTable.delete(contextPrefix, metricPrefix, "0", tag);
    }
  }
View Full Code Here


        long currentTime = TimeUnit.SECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
        long deleteBefore = currentTime - retention;

        for (MetricsScope scope : MetricsScope.values()) {
          TimeSeriesTable timeSeriesTable = tableFactory.createTimeSeries(scope.name(), 1);
          try {
            timeSeriesTable.deleteBefore(deleteBefore);
          } catch (OperationException e) {
            LOG.error("Failed in cleaning up metrics table: {}", e.getMessage(), e);
          }
        }
View Full Code Here

TOP

Related Classes of co.cask.cdap.metrics.data.TimeSeriesTable$ScannerFields

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.