[ 
https://issues.apache.org/jira/browse/APEXMALHAR-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15328436#comment-15328436
 ] 

ASF GitHub Bot commented on APEXMALHAR-139:
-------------------------------------------

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

    https://github.com/apache/apex-malhar/pull/302#discussion_r66880779
  
    --- Diff: 
library/src/main/java/com/datatorrent/lib/math/AbstractOutput.java ---
    @@ -38,23 +38,23 @@
        * Double type output.
        */
       @OutputPortFieldAnnotation(optional = true)
    -  public final transient DefaultOutputPort<Double> doubleResult = new 
DefaultOutputPort<Double>();
    +  public transient DefaultOutputPort<Double> doubleResult = new 
DefaultOutputPort<Double>();
    --- End diff --
    
    @ilganeli This won't work. The purpose of keeping port variable final is 
because this variable is used in Application.java to connect the ports. Once 
its used in addStream in application.java, the reference to this variable is 
kept and the same object will be used. Hence even if the object is recreated in 
child class, that won't take effect.
    
    Suggested approach for adding unifier to super class's port is as follows:
    
    1. Do following in parent class:
    ``
    public final transient DefaultOutputPort<Double> doubleResult = new 
DefaultOutputPort<>()
    {
       @Override
      public Operator.Unifier getUnifier()
      {
         return getUnifier();
      }
    }
    
    protected Operator.Unifier getUnifier()
    {
       return null;
    }
    ``
    2. Do following in child class:
    ``
    @Override
    protected Operator.Unifier<Double> getUnifier()
    {
        return new UnifierSumNumber<>();
    }
    ``


> Make sigma operator partition-able
> ----------------------------------
>
>                 Key: APEXMALHAR-139
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-139
>             Project: Apache Apex Malhar
>          Issue Type: Task
>            Reporter: Chandni Singh
>
> Sigma operator in Malhar library doesn't seem to be Stateful as stated in the 
> java-docs.
> This operator can be partitioned by adding a Unifier to the output ports.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to