Search in sources :

Example 1 with NodeStateInfo

use of org.apache.storm.trident.planner.NodeStateInfo in project storm by apache.

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(org.apache.storm.trident.planner.processor.PartitionPersistProcessor) ProcessorNode(org.apache.storm.trident.planner.ProcessorNode) NodeStateInfo(org.apache.storm.trident.planner.NodeStateInfo)

Example 2 with NodeStateInfo

use of org.apache.storm.trident.planner.NodeStateInfo in project storm by apache.

the class TridentTopology method newStaticState.

public TridentState newStaticState(StateSpec spec) {
    String stateId = getUniqueStateId();
    Node n = new Node(getUniqueStreamId(), null, new Fields());
    n.stateInfo = new NodeStateInfo(stateId, spec);
    registerNode(n);
    return new TridentState(this, n);
}
Also used : Fields(org.apache.storm.tuple.Fields) NodeStateInfo(org.apache.storm.trident.planner.NodeStateInfo) ProcessorNode(org.apache.storm.trident.planner.ProcessorNode) Node(org.apache.storm.trident.planner.Node) PartitionNode(org.apache.storm.trident.planner.PartitionNode) SpoutNode(org.apache.storm.trident.planner.SpoutNode)

Aggregations

NodeStateInfo (org.apache.storm.trident.planner.NodeStateInfo)2 ProcessorNode (org.apache.storm.trident.planner.ProcessorNode)2 Node (org.apache.storm.trident.planner.Node)1 PartitionNode (org.apache.storm.trident.planner.PartitionNode)1 SpoutNode (org.apache.storm.trident.planner.SpoutNode)1 PartitionPersistProcessor (org.apache.storm.trident.planner.processor.PartitionPersistProcessor)1 Fields (org.apache.storm.tuple.Fields)1