Search in sources :

Example 6 with ProcessorNode

use of storm.trident.planner.ProcessorNode in project storm by nathanmarz.

the class Stream method partitionPersist.

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);
}
Also used : PartitionPersistProcessor(storm.trident.planner.processor.PartitionPersistProcessor) ProcessorNode(storm.trident.planner.ProcessorNode) NodeStateInfo(storm.trident.planner.NodeStateInfo)

Example 7 with ProcessorNode

use of storm.trident.planner.ProcessorNode in project storm by nathanmarz.

the class TridentTopology method multiReduce.

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);
}
Also used : ProcessorNode(storm.trident.planner.ProcessorNode) SpoutNode(storm.trident.planner.SpoutNode) ProcessorNode(storm.trident.planner.ProcessorNode) PartitionNode(storm.trident.planner.PartitionNode) Node(storm.trident.planner.Node) ArrayList(java.util.ArrayList) GroupedStream(storm.trident.fluent.GroupedStream) IAggregatableStream(storm.trident.fluent.IAggregatableStream) MultiReducerProcessor(storm.trident.planner.processor.MultiReducerProcessor)

Aggregations

ProcessorNode (storm.trident.planner.ProcessorNode)7 Node (storm.trident.planner.Node)4 PartitionNode (storm.trident.planner.PartitionNode)4 GroupedStream (storm.trident.fluent.GroupedStream)3 IAggregatableStream (storm.trident.fluent.IAggregatableStream)3 ArrayList (java.util.ArrayList)2 NodeStateInfo (storm.trident.planner.NodeStateInfo)2 SpoutNode (storm.trident.planner.SpoutNode)2 MultiReducerProcessor (storm.trident.planner.processor.MultiReducerProcessor)2 PartitionPersistProcessor (storm.trident.planner.processor.PartitionPersistProcessor)2 StateQueryProcessor (storm.trident.planner.processor.StateQueryProcessor)2 Fields (backtype.storm.tuple.Fields)1 CombinerAggStateUpdater (storm.trident.operation.impl.CombinerAggStateUpdater)1 ReducerAggStateUpdater (storm.trident.operation.impl.ReducerAggStateUpdater)1 StateFactory (storm.trident.state.StateFactory)1 StateUpdater (storm.trident.state.StateUpdater)1 WindowTridentProcessor (storm.trident.windowing.WindowTridentProcessor)1 WindowsStateFactory (storm.trident.windowing.WindowsStateFactory)1 WindowsStateUpdater (storm.trident.windowing.WindowsStateUpdater)1