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


Java IMetricsConsumer类代码示例

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


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

示例1: prepare

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
public void prepare(Map stormConf, TopologyContext context,
        OutputCollector collector) {
    try {
        _metricsConsumer = (IMetricsConsumer) Class.forName(
                _consumerClassName).newInstance();
    } catch (Exception e) {
        throw new RuntimeException(
                "Could not instantiate a class listed in config under section "
                        + Config.TOPOLOGY_METRICS_CONSUMER_REGISTER
                        + " with fully qualified name "
                        + _consumerClassName, e);
    }
    _metricsConsumer.prepare(stormConf, _registrationArgument, context,
            collector);
    _collector = collector;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:18,代码来源:MetricsConsumerBolt.java

示例2: prepare

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
public void prepare(Map stormConf, TopologyContext context,
        OutputCollector collector) {
    try {
        _metricsConsumer = (IMetricsConsumer) Class.forName(
                _consumerClassName).newInstance();
    } catch (Exception e) {
        throw new RuntimeException(
                "Could not instantiate a class listed in config under section "
                        + Config.TOPOLOGY_METRICS_CONSUMER_REGISTER
                        + " with fully qualified name "
                        + _consumerClassName, e);
    }
    _metricsConsumer.prepare(stormConf, _registrationArgument, context,
            (IErrorReporter) collector);
    _collector = collector;
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:18,代码来源:MetricsConsumerBolt.java

示例3: handleSelectedDataPoints

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
protected void handleSelectedDataPoints(IMetricsConsumer.TaskInfo taskInfo,
                                        Collection<DataPoint> dataPoints) {
    List<QueueElement> data = dataPoints2QueueElement(taskInfo, dataPoints);
    if (data == null) {
        return;
    }
    // LOG.debug("data size is " + data.size());
    // push to redis
    for (QueueElement e : data) {
        try {
            getJedisInstance().rpush(e.queueName, e.data);
        } catch (Exception e1) {
            LOG.info("push data to redis failed", e1);
            closeJedis();
        }
    }
}
 
开发者ID:ADSC-Resa,项目名称:resa,代码行数:19,代码来源:RedisMetricsCollector.java

示例4: execute

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
public void execute(Tuple input) {
    _metricsConsumer.handleDataPoints(
            (IMetricsConsumer.TaskInfo) input.getValue(0),
            (Collection) input.getValue(1));
    _collector.ack(input);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:MetricsConsumerBolt.java

示例5: prepare

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
    try {
        _metricsConsumer = (IMetricsConsumer) Class.forName(_consumerClassName).newInstance();
    } catch (Exception e) {
        throw new RuntimeException("Could not instantiate a class listed in config under section " + Config.TOPOLOGY_METRICS_CONSUMER_REGISTER
                + " with fully qualified name " + _consumerClassName, e);
    }
    _metricsConsumer.prepare(stormConf, _registrationArgument, context, (IErrorReporter) collector);
    _collector = collector;
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:12,代码来源:MetricsConsumerBolt.java

示例6: dataPoints2QueueElement

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
protected List<QueueElement> dataPoints2QueueElement(IMetricsConsumer.TaskInfo taskInfo,
                                                     Collection<DataPoint> dataPoints) {
    Map<String, Object> ret = dataPoints.stream().collect(Collectors.toMap(p -> p.name, p -> p.value));
    //data format is "srcComponentId:taskId:timestamp->data point json"
    String data = taskInfo.srcComponentId + ':' + taskInfo.srcTaskId + ':' + taskInfo.timestamp
            + "->" + object2Json(ret);
    return Arrays.asList(createDefaultQueueElement(data));
}
 
开发者ID:ADSC-Resa,项目名称:resa,代码行数:9,代码来源:RedisMetricsCollector.java

示例7: handleSelectedDataPoints

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
protected void handleSelectedDataPoints(IMetricsConsumer.TaskInfo taskInfo,
                                        Collection<IMetricsConsumer.DataPoint> dataPoints) {
    Map<String, Object> ret = dataPoints.stream().collect(Collectors.toMap(p -> p.name, p -> p.value));
    MeasuredData measuredData = new MeasuredData(taskInfo.srcComponentId, taskInfo.srcTaskId,
            taskInfo.timestamp, ret);
    ctx.getListeners().forEach(l -> l.measuredDataReceived(measuredData));
}
 
开发者ID:ADSC-Resa,项目名称:resa,代码行数:9,代码来源:ResaContainer.java

示例8: prepare

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
    try {
        _metricsConsumer = (IMetricsConsumer)Class.forName(_consumerClassName).newInstance();
    } catch (Exception e) {
        throw new RuntimeException("Could not instantiate a class listed in config under section " +
            Config.TOPOLOGY_METRICS_CONSUMER_REGISTER + " with fully qualified name " + _consumerClassName, e);
    }
    _metricsConsumer.prepare(stormConf, _registrationArgument, context, (IErrorReporter)collector);
    _collector = collector;
}
 
开发者ID:metamx,项目名称:incubator-storm,代码行数:12,代码来源:MetricsConsumerBolt.java

示例9: prepare

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
    try {
        _metricsConsumer = (IMetricsConsumer) Class.forName(_consumerClassName).newInstance();
    } catch (Exception e) {
        throw new RuntimeException("Could not instantiate a class listed in config under section " +
                Config.TOPOLOGY_METRICS_CONSUMER_REGISTER
                + " with fully qualified name " + _consumerClassName, e);
    }
    _metricsConsumer.prepare(stormConf, _registrationArgument, context, collector);
    _collector = collector;
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:13,代码来源:MetricsConsumerBolt.java

示例10: execute

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
public void execute(Tuple input) {
    _metricsConsumer.handleDataPoints((IMetricsConsumer.TaskInfo) input.getValue(0), (Collection) input.getValue(1));
    _collector.ack(input);
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:6,代码来源:MetricsConsumerBolt.java

示例11: execute

import backtype.storm.metric.api.IMetricsConsumer; //导入依赖的package包/类
@Override
public void execute(Tuple input) {
    _metricsConsumer.handleDataPoints((IMetricsConsumer.TaskInfo)input.getValue(0), (Collection)input.getValue(1));
    _collector.ack(input);
}
 
开发者ID:metamx,项目名称:incubator-storm,代码行数:6,代码来源:MetricsConsumerBolt.java


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