apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chandnisingh <...@git.apache.org>
Subject [GitHub] apex-core pull request #364: APEXCORE-448 Made operator name available in op...
Date Thu, 04 Aug 2016 02:42:59 GMT
Github user chandnisingh commented on a diff in the pull request:

    https://github.com/apache/apex-core/pull/364#discussion_r73455000
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/engine/StreamingContainer.java ---
    @@ -902,14 +902,14 @@ private void deployNodes(List<OperatorDeployInfo> nodeList)
throws IOException
     
           Context parentContext;
           if (ndi instanceof UnifierDeployInfo) {
    -        OperatorContext unifiedOperatorContext = new OperatorContext(0, ((UnifierDeployInfo)ndi).operatorAttributes,
containerContext);
    +        OperatorContext unifiedOperatorContext = new OperatorContext(ndi, containerContext);
             parentContext = new PortContext(ndi.inputs.get(0).contextAttributes, unifiedOperatorContext);
             massageUnifierDeployInfo(ndi);
           } else {
             parentContext = containerContext;
           }
     
    -      OperatorContext ctx = new OperatorContext(ndi.id, ndi.contextAttributes, parentContext);
    +      OperatorContext ctx = new OperatorContext(ndi, parentContext);
    --- End diff --
    
    Old code behavior:
    ```
          if (ndi instanceof UnifierDeployInfo) {
            OperatorContext unifiedOperatorContext = new OperatorContext(0, ((UnifierDeployInfo)ndi).operatorAttributes,
containerContext);
          } else {
            parentContext = containerContext;
          }
    
          OperatorContext ctx = new OperatorContext(ndi.id, ndi.contextAttributes, parentContext);
    
    ``` 
    In the new code, the constructor handles which attributes to use.
    ``` 
      public OperatorContext(@NotNull OperatorDeployInfo operatorDeployInfo, Context parentContext)
      {
        super(operatorDeployInfo instanceof OperatorDeployInfo.UnifierDeployInfo ?
            ((OperatorDeployInfo.UnifierDeployInfo)operatorDeployInfo).operatorAttributes
: operatorDeployInfo.contextAttributes,
            parentContext);
      }



---
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.
---

Mime
View raw message