当前位置: 首页>>代码示例>>Java>>正文


Java WritableDataPoints类代码示例

本文整理汇总了Java中net.opentsdb.core.WritableDataPoints的典型用法代码示例。如果您正苦于以下问题:Java WritableDataPoints类的具体用法?Java WritableDataPoints怎么用?Java WritableDataPoints使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WritableDataPoints类属于net.opentsdb.core包,在下文中一共展示了WritableDataPoints类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeDataPoints

import net.opentsdb.core.WritableDataPoints; //导入依赖的package包/类
/**
 * Main entry method for adding points
 *
 * @param data points list
 */
private void writeDataPoints(List<EventData> data) throws Exception {
  if (data.size() < 1)
    return;
  final WritableDataPoints dataPoints = tsdb.newDataPoints();
  final EventData first = data.get(0);
  dataPoints.setSeries(first.metric, first.tags);
  dataPoints.setBatchImport(false); // we need data to be persisted
  long prevTs = 0;
  Set<String> failures = new HashSet<String>();
  for (EventData eventData : data) {
    try {
      if (eventData.timestamp == prevTs)
        continue;
      sinkCounter.incrementEventDrainAttemptCount();
      prevTs = eventData.timestamp;
      final Deferred<Object> d =
              eventData.makeDeferred(dataPoints, this);
      d.addCallback(new Callback<Object, Object>() {
        @Override
        public Object call(Object o) throws Exception {
          pointsCounter.mark();
          inFlight.decrementAndGet();
          signal.release();
          return null;
        }
      });
      d.addErrback(this);
      if (throttle)
        throttle(d);
      inFlight.incrementAndGet();
      sinkCounter.incrementEventDrainSuccessCount();
    } catch (IllegalArgumentException ie) {
      failures.add(ie.getMessage());
    }
  }
  if (failures.size() > 0) {
    logger.error("Points imported with " + failures.toString() + " IllegalArgumentExceptions");
  }
}
 
开发者ID:yandex,项目名称:opentsdb-flume,代码行数:45,代码来源:OpenTSDBSink.java

示例2: makeDeferred

import net.opentsdb.core.WritableDataPoints; //导入依赖的package包/类
public Deferred<Object> makeDeferred(WritableDataPoints dp, State state) {
  Deferred<Object> d;
  if (Tags.looksLikeInteger(value)) {
    d = dp.addPoint(timestamp, Tags.parseLong(value));
  } else {  // floating point value
    d = dp.addPoint(timestamp, Float.parseFloat(value));
  }
  return d;
}
 
开发者ID:yandex,项目名称:opentsdb-flume,代码行数:10,代码来源:OpenTSDBSink.java

示例3: makeDeferred

import net.opentsdb.core.WritableDataPoints; //导入依赖的package包/类
public Deferred<Object> makeDeferred(WritableDataPoints dp) {
  Deferred<Object> d;
  if (Tags.looksLikeInteger(value)) {
    d = dp.addPoint(timestamp, Tags.parseLong(value));
  } else {  // floating point value
    d = dp.addPoint(timestamp, Float.parseFloat(value));
  }
  return d;
}
 
开发者ID:yandex,项目名称:opentsdb-flume,代码行数:10,代码来源:OpenTSDBSink2.java

示例4: newDataPoints

import net.opentsdb.core.WritableDataPoints; //导入依赖的package包/类
/**
 * {@inheritDoc}
 * @see com.heliosapm.tsdbex.test.mocks.ITSDB#newDataPoints()
 */
@Override
public WritableDataPoints newDataPoints() {
	
	return null;
}
 
开发者ID:nickman,项目名称:HeliosStreams,代码行数:10,代码来源:EmptyTSDB.java

示例5: newDataPoints

import net.opentsdb.core.WritableDataPoints; //导入依赖的package包/类
/**
 * Returns a new {@link WritableDataPoints} instance suitable for this TSDB.
 * <p>
 * If you want to add a single data-point, consider using {@link #addPoint}
 * instead.
 * @return The writable data points
 */
public WritableDataPoints newDataPoints();
 
开发者ID:nickman,项目名称:HeliosStreams,代码行数:9,代码来源:ITSDB.java


注:本文中的net.opentsdb.core.WritableDataPoints类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。