Search in sources :

Example 1 with StreamInfo

use of com.datatorrent.stram.webapp.StreamInfo in project apex-core by apache.

the class StreamingContainerManager method getStreamInfoList.

public List<StreamInfo> getStreamInfoList() {
    List<StreamInfo> infoList = new ArrayList<>();
    for (PTContainer container : this.plan.getContainers()) {
        for (PTOperator operator : container.getOperators()) {
            List<PTOutput> outputs = operator.getOutputs();
            for (PTOutput output : outputs) {
                StreamInfo si = new StreamInfo();
                si.logicalName = output.logicalStream.getName();
                si.source.operatorId = String.valueOf(operator.getId());
                si.source.portName = output.portName;
                si.locality = output.logicalStream.getLocality();
                for (PTInput input : output.sinks) {
                    StreamInfo.Port p = new StreamInfo.Port();
                    p.operatorId = String.valueOf(input.target.getId());
                    if (input.target.isUnifier()) {
                        p.portName = StreamingContainer.getUnifierInputPortName(input.portName, operator.getId(), output.portName);
                    } else {
                        p.portName = input.portName;
                    }
                    si.sinks.add(p);
                }
                infoList.add(si);
            }
        }
    }
    return infoList;
}
Also used : PTOperator(com.datatorrent.stram.plan.physical.PTOperator) PTInput(com.datatorrent.stram.plan.physical.PTOperator.PTInput) OutputPort(com.datatorrent.api.Operator.OutputPort) InputPort(com.datatorrent.api.Operator.InputPort) ArrayList(java.util.ArrayList) StreamInfo(com.datatorrent.stram.webapp.StreamInfo) PTContainer(com.datatorrent.stram.plan.physical.PTContainer) PTOutput(com.datatorrent.stram.plan.physical.PTOperator.PTOutput)

Aggregations

InputPort (com.datatorrent.api.Operator.InputPort)1 OutputPort (com.datatorrent.api.Operator.OutputPort)1 PTContainer (com.datatorrent.stram.plan.physical.PTContainer)1 PTOperator (com.datatorrent.stram.plan.physical.PTOperator)1 PTInput (com.datatorrent.stram.plan.physical.PTOperator.PTInput)1 PTOutput (com.datatorrent.stram.plan.physical.PTOperator.PTOutput)1 StreamInfo (com.datatorrent.stram.webapp.StreamInfo)1 ArrayList (java.util.ArrayList)1