Github user ilganeli commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/76#discussion_r42306617
  
    --- Diff: 
engine/src/main/java/com/datatorrent/stram/plan/physical/StreamMapping.java ---
    @@ -188,6 +192,69 @@ private void addSlidingUnifiers()
         }
       }
     
    +  private List<PTOutput> setupPartitionerUnifiers(List<PTOutput> upstream, 
Partitioner<Operator> partitioner)
    +  {
    +    Operator.Unifier<?> unifier = streamMeta.getSource().getUnifier();
    +
    +    if (unifier == null) {
    +      unifier = new DefaultUnifier();
    +    }
    +
    +    Collection<Partitioner.Partition<Operator>> collection = new 
ArrayList<>(1);
    +    DefaultPartition<Operator> firstPartition = new 
DefaultPartition<Operator>(unifier);
    +    collection.add(firstPartition);
    +
    +    Collection<Partitioner.Partition<Operator>> partitions = 
partitioner.definePartitions(collection, new 
PhysicalPlan.UnifierPartitioningContextImpl());
    +
    +    if (partitions.size() <= 1) {
    +      return upstream;
    +    }
    +    OperatorMeta om = streamMeta.getSource().getOperatorMeta();
    +
    +    InputPortMeta portMeta = null;
    +    Map<InputPortMeta, StreamMeta> inputs = om.getInputStreams();
    +    if (!inputs.isEmpty()) {
    +      portMeta = inputs.keySet().iterator().next();
    +      DefaultPartition.assignPartitionKeys(partitions, 
portMeta.getPortObject());
    +    }
    +
    +    List<PTOutput> Unifierupstream = new LinkedList<>();
    +    for (Partitioner.Partition<Operator> partition : partitions) {
    +      PortMappingDescriptor mergeDesc = new PortMappingDescriptor();
    --- End diff --
    
    Can we move lines 223-254 into their own function? This will help make this 
function more readable.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to