• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Aggregator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AbstractTridentWindowManager

import storm.trident.operation.Aggregator; //导入依赖的package包/类
public AbstractTridentWindowManager(WindowConfig windowConfig, String windowTaskId, WindowsStore windowStore,
                                    Aggregator aggregator, BatchOutputCollector delegateCollector) {
    this.windowTaskId = windowTaskId;
    this.windowStore = windowStore;
    this.aggregator = aggregator;
    this.delegateCollector = delegateCollector;

    windowTriggerCountId = WindowTridentProcessor.TRIGGER_COUNT_PREFIX + windowTaskId;

    windowManager = new WindowManager<>(new TridentWindowLifeCycleListener());

    WindowStrategy<T> windowStrategy = windowConfig.getWindowStrategy();
    EvictionPolicy<T> evictionPolicy = windowStrategy.getEvictionPolicy();
    windowManager.setEvictionPolicy(evictionPolicy);
    triggerPolicy = windowStrategy.getTriggerPolicy(windowManager, evictionPolicy);
    windowManager.setTriggerPolicy(triggerPolicy);
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:18,代码来源:AbstractTridentWindowManager.java


示例2: partitionAggregate

import storm.trident.operation.Aggregator; //导入依赖的package包/类
@Override
public Stream partitionAggregate(Fields inputFields, Aggregator agg, Fields functionFields) {
    projectionValidation(inputFields);
    return _topology.addSourcedNode(this,
            new ProcessorNode(_topology.getUniqueStreamId(),
                _name,
                functionFields,
                functionFields,
                new AggregateProcessor(inputFields, agg)));
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:11,代码来源:Stream.java


示例3: GroupedAggregator

import storm.trident.operation.Aggregator; //导入依赖的package包/类
public GroupedAggregator(Aggregator agg, Fields group, Fields input, int outSize) {
    _groupFields = group;
    _inFields = input;
    _agg = agg;
    int[] sizes = new int[2];
    sizes[0] = _groupFields.size();
    sizes[1] = outSize;
    _fact = new ComboList.Factory(sizes);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:GroupedAggregator.java


示例4: ChainedAggregatorImpl

import storm.trident.operation.Aggregator; //导入依赖的package包/类
public ChainedAggregatorImpl(Aggregator[] aggs, Fields[] inputFields, ComboList.Factory fact) {
    _aggs = aggs;
    _inputFields = inputFields;
    _fact = fact;
    if(_aggs.length!=_inputFields.length) {
        throw new IllegalArgumentException("Require input fields for each aggregator");
    }
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:9,代码来源:ChainedAggregatorImpl.java


示例5: aggregate

import storm.trident.operation.Aggregator; //导入依赖的package包/类
private ChainedFullAggregatorDeclarer aggregate(Fields inputFields, Aggregator agg, Fields functionFields, boolean isCombiner) {
    if(isCombiner) {
        if(_type == null) {
            _type = AggType.FULL_COMBINE;            
        }
    } else {
        _type = AggType.FULL;
    }
    _aggs.add(new AggSpec(inputFields, agg, functionFields));
    return this;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:ChainedAggregatorDeclarer.java


示例6: partitionAggregate

import storm.trident.operation.Aggregator; //导入依赖的package包/类
@Override
public IAggregatableStream partitionAggregate(Fields inputFields, Aggregator agg, Fields functionFields) {
    Aggregator groupedAgg = new GroupedAggregator(agg, _groupFields, inputFields, functionFields.size());
    Fields allInFields = TridentUtils.fieldsUnion(_groupFields, inputFields);
    Fields allOutFields = TridentUtils.fieldsConcat(_groupFields, functionFields);
    Stream s = _stream.partitionAggregate(allInFields, groupedAgg, allOutFields);
    return new GroupedStream(s, _groupFields);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:9,代码来源:GroupedStream.java


示例7: ChainedAggregatorImpl

import storm.trident.operation.Aggregator; //导入依赖的package包/类
public ChainedAggregatorImpl(Aggregator[] aggs, Fields[] inputFields, ComboList.Factory fact) {
    _aggs = aggs;
    _inputFields = inputFields;
    _fact = fact;
    if (_aggs.length != _inputFields.length) {
        throw new IllegalArgumentException("Require input fields for each aggregator");
    }
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:9,代码来源:ChainedAggregatorImpl.java


示例8: aggregate

import storm.trident.operation.Aggregator; //导入依赖的package包/类
private ChainedFullAggregatorDeclarer aggregate(Fields inputFields, Aggregator agg, Fields functionFields, boolean isCombiner) {
    if (isCombiner) {
        if (_type == null) {
            _type = AggType.FULL_COMBINE;
        }
    } else {
        _type = AggType.FULL;
    }
    _aggs.add(new AggSpec(inputFields, agg, functionFields));
    return this;
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:12,代码来源:ChainedAggregatorDeclarer.java


示例9: window

import storm.trident.operation.Aggregator; //导入依赖的package包/类
private Stream window(WindowConfig windowConfig, WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator,
                      Fields functionFields, boolean storeTuplesInStore) {
    projectionValidation(inputFields);
    windowConfig.validate();

    Fields fields = addTriggerField(functionFields);

    // when storeTuplesInStore is false then the given windowStoreFactory is only used to store triggers and
    // that store is passed to WindowStateUpdater to remove them after committing the batch.
    Stream stream = _topology.addSourcedNode(this,
            new ProcessorNode(_topology.getUniqueStreamId(),
                    _name,
                    fields,
                    fields,
                    new WindowTridentProcessor(windowConfig, _topology.getUniqueWindowId(), windowStoreFactory,
                            inputFields, aggregator, storeTuplesInStore)));

    Stream effectiveStream = stream.project(functionFields);

    // create StateUpdater with the given windowStoreFactory to remove triggered aggregation results form store
    // when they are successfully processed.
    StateFactory stateFactory = new WindowsStateFactory();
    StateUpdater stateUpdater = new WindowsStateUpdater(windowStoreFactory);
    stream.partitionPersist(stateFactory, new Fields(WindowTridentProcessor.TRIGGER_FIELD_NAME), stateUpdater, new Fields());

    return effectiveStream;
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:28,代码来源:Stream.java


示例10: StoreBasedTridentWindowManager

import storm.trident.operation.Aggregator; //导入依赖的package包/类
public StoreBasedTridentWindowManager(WindowConfig windowConfig, String windowTaskId, WindowsStore windowStore, Aggregator aggregator,
                                      BatchOutputCollector delegateCollector, Long maxTuplesCacheSize, Fields inputFields) {
    super(windowConfig, windowTaskId, windowStore, aggregator, delegateCollector);

    this.maxCachedTuplesSize = maxTuplesCacheSize;
    this.inputFields = inputFields;
    freshOutputFactory = new TridentTupleView.FreshOutputFactory(inputFields);
    windowTupleTaskId = TUPLE_PREFIX + windowTaskId;
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:10,代码来源:StoreBasedTridentWindowManager.java


示例11: WindowTridentProcessor

import storm.trident.operation.Aggregator; //导入依赖的package包/类
public WindowTridentProcessor(WindowConfig windowConfig, String uniqueWindowId, WindowsStoreFactory windowStoreFactory,
                              Fields inputFields, Aggregator aggregator, boolean storeTuplesInStore) {

    this.windowConfig = windowConfig;
    this.windowId = uniqueWindowId;
    this.windowStoreFactory = windowStoreFactory;
    this.inputFields = inputFields;
    this.aggregator = aggregator;
    this.storeTuplesInStore = storeTuplesInStore;
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:11,代码来源:WindowTridentProcessor.java


示例12: aggregate

import storm.trident.operation.Aggregator; //导入依赖的package包/类
public Stream aggregate(Aggregator agg, Fields functionFields) {
    return aggregate(null, agg, functionFields);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:4,代码来源:Stream.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JcaCertStore类代码示例发布时间:2022-05-21
下一篇:
Java LocaleManager类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap