本文整理汇总了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);
}
示例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)));
}
示例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);
}
示例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");
}
}
示例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;
}
示例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);
}
示例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");
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例12: aggregate
import storm.trident.operation.Aggregator; //导入依赖的package包/类
public Stream aggregate(Aggregator agg, Fields functionFields) {
return aggregate(null, agg, functionFields);
}