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

    https://github.com/apache/apex-core/pull/364#discussion_r73433050
  
    --- Diff: 
engine/src/main/java/com/datatorrent/stram/engine/OperatorContext.java ---
    @@ -84,12 +87,13 @@ public void setIdleTimeout(long idleTimeout)
        * @param attributes the value of attributes
        * @param parentContext
        */
    -  public OperatorContext(int id, AttributeMap attributes, Context 
parentContext)
    +  public OperatorContext(int id, String operatorName, AttributeMap 
attributes, Context parentContext)
       {
         super(attributes, parentContext);
         this.lastProcessedWindowId = Stateless.WINDOW_ID;
         this.id = id;
         this.stateless = super.getValue(OperatorContext.STATELESS);
    +    this.operatorName = Preconditions.checkNotNull(operatorName, "operator 
name");
    --- End diff --
    
    @vrozov I am running this app with a ```null``` operator name and 
NullPointerException is thrown:
    ```
      @ApplicationAnnotation(name = "TestApp")
      class SplitterApp implements StreamingApplication
      {
        MockReceiver receiver;
    
        @Override
        public void populateDAG(DAG dag, Configuration configuration)
        {
          dag.setAttribute(DAG.APPLICATION_PATH, baseTestMeta.dataDirectory);
          MockFileInput fileInput = dag.addOperator("Input", new 
MockFileInput());
          fileInput.filePaths = baseTestMeta.filePaths;
    
          FileSplitterBase splitter = dag.addOperator(null, new 
FileSplitterBase());
          splitter.setFile(baseTestMeta.dataDirectory);
    
          receiver = dag.addOperator("Receiver", new MockReceiver());
    
          dag.addStream("files", fileInput.files, splitter.input);
          dag.addStream("file-metadata", splitter.filesMetadataOutput, 
receiver.fileMetadata);
        }
      }
    java.lang.NullPointerException
        at 
com.datatorrent.stram.plan.logical.LogicalPlan$OperatorMeta.equals(LogicalPlan.java:1187)
        at java.util.ArrayList.remove(ArrayList.java:528)
        at 
com.datatorrent.stram.plan.logical.LogicalPlan$StreamMeta.addSink(LogicalPlan.java:531)
        at 
com.datatorrent.stram.plan.logical.LogicalPlan.addStream(LogicalPlan.java:1391)
        at 
com.datatorrent.stram.plan.logical.LogicalPlan.addStream(LogicalPlan.java:1442)
        at 
com.datatorrent.stram.plan.logical.LogicalPlan.addStream(LogicalPlan.java:119)
        at 
com.datatorrent.lib.io.fs.FileSplitterBaseTest$SplitterApp.populateDAG(FileSplitterBaseTest.java:231)
        at 
com.datatorrent.stram.plan.logical.LogicalPlanConfiguration.prepareDAG(LogicalPlanConfiguration.java:2226)
        at com.datatorrent.stram.LocalModeImpl.prepareDAG(LocalModeImpl.java:67)
        at 
com.datatorrent.lib.io.fs.FileSplitterBaseTest.testSplitterInApp(FileSplitterBaseTest.java:205)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)


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

Reply via email to