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


Java ProcessorNode类代码示例

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


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

示例1: each

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

示例2: partitionAggregate

import storm.trident.planner.ProcessorNode; //导入依赖的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: stateQuery

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
public Stream stateQuery(TridentState state, Fields inputFields, QueryFunction function, Fields functionFields) {
    projectionValidation(inputFields);
    String stateId = state._node.stateInfo.id;
    Node n = new ProcessorNode(_topology.getUniqueStreamId(),
                    _name,
                    TridentUtils.fieldsConcat(getOutputFields(), functionFields),
                    functionFields,
                    new StateQueryProcessor(stateId, inputFields, function));
    _topology._colocate.get(stateId).add(n);
    return _topology.addSourcedNode(this, n);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:Stream.java

示例4: partitionPersist

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
public TridentState partitionPersist(StateSpec stateSpec, Fields inputFields, StateUpdater updater, Fields functionFields) {
    projectionValidation(inputFields);
    String id = _topology.getUniqueStateId();
    ProcessorNode n = new ProcessorNode(_topology.getUniqueStreamId(),
                _name,
                functionFields,
                functionFields,
                new PartitionPersistProcessor(id, inputFields, updater));
    n.committer = true;
    n.stateInfo = new NodeStateInfo(id, stateSpec);
    return _topology.addSourcedStateNode(this, n);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:13,代码来源:Stream.java

示例5: multiReduce

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
public Stream multiReduce(List<Fields> inputFields, List<Stream> streams, MultiReducer function, Fields outputFields) {
    List<String> names = new ArrayList<String>();
    for(Stream s: streams) {
        if(s._name!=null) {
            names.add(s._name);
        }
    }
    Node n = new ProcessorNode(getUniqueStreamId(), Utils.join(names, "-"), outputFields, outputFields, new MultiReducerProcessor(inputFields, function));
    return addSourcedNode(streams, n);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:11,代码来源:TridentTopology.java

示例6: committerBatches

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
private static Set<String> committerBatches(Group g, Map<Node, String> batchGroupMap) {
    Set<String> ret = new HashSet();
    for(Node n: g.nodes) {
       if(n instanceof ProcessorNode) {
           if(((ProcessorNode) n).committer) {
               ret.add(batchGroupMap.get(n));
           }
       } 
    }
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:TridentTopology.java

示例7: each

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
@Override
public Stream each(Fields inputFields, Function function, Fields functionFields) {
    projectionValidation(inputFields);
    return _topology.addSourcedNode(this,
            new ProcessorNode(_topology.getUniqueStreamId(), _name, TridentUtils.fieldsConcat(getOutputFields(), functionFields), functionFields,
                    new EachProcessor(inputFields, function)));
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:8,代码来源:Stream.java

示例8: stateQuery

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
public Stream stateQuery(TridentState state, Fields inputFields, QueryFunction function, Fields functionFields) {
    projectionValidation(inputFields);
    String stateId = state._node.stateInfo.id;
    Node n =
            new ProcessorNode(_topology.getUniqueStreamId(), _name, TridentUtils.fieldsConcat(getOutputFields(), functionFields), functionFields,
                    new StateQueryProcessor(stateId, inputFields, function));
    _topology._colocate.get(stateId).add(n);
    return _topology.addSourcedNode(this, n);
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:10,代码来源:Stream.java

示例9: partitionPersist

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
public TridentState partitionPersist(StateSpec stateSpec, Fields inputFields, StateUpdater updater, Fields functionFields) {
    projectionValidation(inputFields);
    String id = _topology.getUniqueStateId();
    ProcessorNode n =
            new ProcessorNode(_topology.getUniqueStreamId(), _name, functionFields, functionFields, new PartitionPersistProcessor(id, inputFields, updater));
    n.committer = true;
    n.stateInfo = new NodeStateInfo(id, stateSpec);
    return _topology.addSourcedStateNode(this, n);
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:10,代码来源:Stream.java

示例10: each

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
@Override
public Stream each(Fields inputFields, Function function, Fields functionFields) {
    projectionValidation(inputFields);
    return _topology.addSourcedNode(this,
            new ProcessorNode(_topology.getUniqueStreamId(),
                    _name,
                    TridentUtils.fieldsConcat(getOutputFields(), functionFields),
                    functionFields,
                    new EachProcessor(inputFields, function)));
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:11,代码来源:Stream.java

示例11: map

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
/**
 * Returns a stream consisting of the result of applying the given mapping function to the values of this stream.
 *
 * @param function a mapping function to be applied to each value in this stream.
 * @return the new stream
 */
public Stream map(MapFunction function) {
    projectionValidation(getOutputFields());
    return _topology.addSourcedNode(this,
                                    new ProcessorNode(
                                            _topology.getUniqueStreamId(),
                                            _name,
                                            getOutputFields(),
                                            getOutputFields(),
                                            new MapProcessor(getOutputFields(), new MapFunctionExecutor(function))));
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:17,代码来源:Stream.java

示例12: flatMap

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
/**
 * Returns a stream consisting of the results of replacing each value of this stream with the contents
 * produced by applying the provided mapping function to each value. This has the effect of applying
 * a one-to-many transformation to the values of the stream, and then flattening the resulting elements into a new stream.
 *
 * @param function a mapping function to be applied to each value in this stream which produces new values.
 * @return the new stream
 */
public Stream flatMap(FlatMapFunction function) {
    projectionValidation(getOutputFields());
    return _topology.addSourcedNode(this,
                                    new ProcessorNode(
                                            _topology.getUniqueStreamId(),
                                            _name,
                                            getOutputFields(),
                                            getOutputFields(),
                                            new MapProcessor(getOutputFields(), new FlatMapFunctionExecutor(function))));
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:19,代码来源:Stream.java

示例13: peek

import storm.trident.planner.ProcessorNode; //导入依赖的package包/类
/**
 * Returns a stream consisting of the trident tuples of this stream, additionally performing the provided action on
 * each trident tuple as they are consumed from the resulting stream. This is mostly useful for debugging
 * to see the tuples as they flow past a certain point in a pipeline.
 *
 * @param action the action to perform on the trident tuple as they are consumed from the stream
 * @return the new stream
 */
public Stream peek(Consumer action) {
    projectionValidation(getOutputFields());
    return _topology.addSourcedNode(this,
                                    new ProcessorNode(
                                            _topology.getUniqueStreamId(),
                                            _name,
                                            getOutputFields(),
                                            getOutputFields(),
                                            new MapProcessor(getOutputFields(), new ConsumerExecutor(action))));
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:19,代码来源:Stream.java


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