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

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

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

    https://github.com/apache/apex-malhar/pull/333#discussion_r69828207
  
    --- Diff: 
library/src/test/java/com/datatorrent/lib/io/fs/FileSplitterInputTest.java ---
    @@ -499,7 +499,7 @@ public void testRecoveryOfBlockMetadataIterator() 
throws InterruptedException
         testMeta.fileSplitterInput.getScanner().setScanIntervalMillis(500);
     
     
    -    testMeta.fileSplitterInput.setup(testMeta.context);
    --- End diff --
    
    The goal of writing tests is to test the operator not just setup of window 
data manager. 
    For a trivial improvement, that is, to avoid instantiating objects in the 
logical instance, this change now doesn't execute setup of the operator which 
is a much bigger problem. 
    In future if something is added to splitter setup, the test will never 
execute it and result in bugs.
    
    Also, there are multiple of operators in library which instantiate field 
that are transient when the operator is constructed. Are you going to change 
all of them?
    



> FileSplitterInput and TimeBasedDirectoryScanner - move operational fields 
> initialization from constructor to setup
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: APEXMALHAR-2069
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-2069
>             Project: Apache Apex Malhar
>          Issue Type: Improvement
>            Reporter: Vlad Rozov
>            Assignee: Sanjay M Pujare
>             Fix For: 3.5.0
>
>
> For example, there is no need for scanService to be initialized in the 
> constructor. It should be done during operator setup().



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

Reply via email to