You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by chaithu14 <gi...@git.apache.org> on 2015/09/24 14:51:59 UTC

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

GitHub user chaithu14 opened a pull request:

    https://github.com/apache/incubator-apex-core/pull/76

    APEX-150: Added support of Partitionable Unifier

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chaithu14/incubator-apex-core APEX-150-PartitionUnifier

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-apex-core/pull/76.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #76
    
----
commit 855884452cf4428eb6bb2144203835d891b7d64a
Author: Chaitanya <ch...@datatorrent.com>
Date:   2015-09-24T12:46:39Z

    APEX-150: Added support of Partitionable Unifier

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

Posted by ilganeli <gi...@git.apache.org>.
Github user ilganeli commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/76#discussion_r42306656
  
    --- 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)
    --- End diff --
    
    Javadoc


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

Posted by ilganeli <gi...@git.apache.org>.
Github user ilganeli commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/76#discussion_r42306624
  
    --- 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()) {
    --- End diff --
    
    Is the intent here to assign previously assigned keys if the previous component (connected by the stream) already has an assigned partitioning scheme? Can this be clarified with a comment?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

Posted by ilganeli <gi...@git.apache.org>.
Github user ilganeli commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/76#discussion_r42306635
  
    --- 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<>();
    --- End diff --
    
    Nit: rename to ```unifierUpstream```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

Posted by chaithu14 <gi...@git.apache.org>.
Github user chaithu14 commented on the pull request:

    https://github.com/apache/incubator-apex-core/pull/76#issuecomment-152526794
  
    Sure. I will do this.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

Posted by ilooner <gi...@git.apache.org>.
Github user ilooner commented on the pull request:

    https://github.com/apache/incubator-apex-core/pull/76#issuecomment-152378585
  
    @chaithu14 when you have time can you please address @ilganeli comments?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

Posted by ilganeli <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-apex-core/pull/76


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEX-150: Added support of Parti...

Posted by ilganeli <gi...@git.apache.org>.
Github user ilganeli commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/76#discussion_r42306644
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/plan/physical/StreamMapping.java ---
    @@ -222,6 +289,12 @@ private void redoMapping() {
           plan.undeployOpers.addAll(currentUnifiers);
           addSlidingUnifiers();
     
    +      List<PTOutput> unifierSources = this.upstream;
    +      Partitioner<Operator> partitioner = streamMeta.getSource().getUnifierMeta().getAttributes().contains(Context.OperatorContext.PARTITIONER) ?
    --- End diff --
    
    If ```streamMeta.getSource().getUnifierMeta().getAttributes().contains(Context.OperatorContext.PARTITIONER)``` and ```(Partitioner<Operator>)streamMeta.getSource().getUnifierMeta().getValue(Context.OperatorContext.PARTITIONER)``` were extracted to variables this would be easier to read and understand what's going on 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---