apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tushargosavi <...@git.apache.org>
Subject [GitHub] incubator-apex-core pull request: APEX-103: Add module and dag int...
Date Tue, 08 Dec 2015 06:01:07 GMT
Github user tushargosavi commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/148#discussion_r46917771
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/plan/logical/LogicalPlan.java ---
    @@ -1067,28 +1097,217 @@ public int hashCode()
       public <T extends Operator> T addOperator(String name, T operator)
       {
         if (operators.containsKey(name)) {
    -      if (operators.get(name) == (Object)operator) {
    +      if (operators.get(name).operator == operator) {
             return operator;
           }
           throw new IllegalArgumentException("duplicate operator id: " + operators.get(name));
         }
     
    +    // Avoid name conflict with module.
    +    if (modules.containsKey(name))
    +      throw new IllegalArgumentException("duplicate operator id: " + operators.get(name));
    +
         OperatorMeta decl = new OperatorMeta(name, operator);
         rootOperators.add(decl); // will be removed when a sink is added to an input port
for this operator
         operators.put(name, decl);
         return operator;
       }
     
    -  @Override
    -  public <T extends Module> T addModule(String name, Class<T> moduleClass)
    +  /**
    +   * Module meta object.
    +   */
    +  public final class ModuleMeta implements DAG.ModuleMeta, Serializable
       {
    -    throw new UnsupportedOperationException("Modules are not supported");
    +    private final LinkedHashMap<InputPortMeta, StreamMeta> inputStreams = new LinkedHashMap<InputPortMeta,
StreamMeta>();
    +    private final LinkedHashMap<OutputPortMeta, StreamMeta> outputStreams = new
LinkedHashMap<OutputPortMeta, StreamMeta>();
    +    private final Attribute.AttributeMap attributes;
    +    @NotNull
    +    private String name;
    +    private transient Module module;
    +    private ModuleMeta parent;
    +    private LogicalPlan dag = null;
    +    private transient String fullName;
    --- End diff --
    
    This name is constructed in getFullName method, as it has to traverse the dag backward
to construct the full name, its computed only once and cached here.


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