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

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

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

    https://github.com/apache/apex-malhar/pull/329#discussion_r69063970
  
    --- Diff: 
library/src/main/java/com/datatorrent/lib/io/fs/FileSplitterInput.java ---
    @@ -318,6 +317,9 @@ public TimeBasedDirectoryScanner()
         @Override
         public void setup(Context.OperatorContext context)
         {
    +      if (scanService == null) {
    --- End diff --
    
    why is it necessary to check for null? Under what condition it will be not 
null? As far as I know platform calls setup/terminate once per deployment. IMO, 
it is safer to create new execution service each time setup is called and 
possibly assert or throw RuntimeException if scanService is not null to avoid 
misusage in unit tests.


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