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

ASF GitHub Bot commented on NIFI-5000:
--------------------------------------

GitHub user zenfenan opened a pull request:

    https://github.com/apache/nifi/pull/2576

    NIFI-5000: ListHDFS properly lists files from updated directory path

    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?
    
    - [x] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
    - [ ] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zenfenan/nifi NIFI-5000

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/2576.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2576
    
----
commit 84d8e2e6f9af2ca59f05990197a7a13e648ebf2a
Author: zenfenan <sivaprasanna246@...>
Date:   2018-03-22T17:13:52Z

    NIFI-5000: ListHDFS properly lists files from updated directory path

----


> ListHDFS doesn't list files from updated 'directory'
> ----------------------------------------------------
>
>                 Key: NIFI-5000
>                 URL: https://issues.apache.org/jira/browse/NIFI-5000
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.2.0, 1.3.0, 1.4.0, 1.5.0
>            Reporter: Sivaprasanna Sethuraman
>            Assignee: Sivaprasanna Sethuraman
>            Priority: Major
>         Attachments: 
> 0001-SNTDA-5000-ListHDFS-properly-lists-files-from-update.patch
>
>
> ListHDFS lists files and saves the latest listed files' modified time - 
> latestTimestampListed and latestTimestampEmitted in the `StateMap`. It is 
> overriding `onPropertyModified` to check if the `Directory` or the `File 
> Filter` has been modified and if they are indeed modified, it will reset the 
> statemap variables to `-1L` so as to list all the files from the updated 
> `Directory` or according to the updated `File Filter`. However it is not 
> working as intended.
> *Scenario:*
>  # Create two directories in HDFS
>  ## > hdfs dfs -mkdir /test1
>  ## > hdfs dfs -mkdir /test2
>  # Write files to the above directories in the following order:
>  ## > hdfs dfs -put sample.txt */test1/t1_1.txt* 
>  ## > hdfs dfs -put sample.txt */test2/t2_1.txt*
>  ## > hdfs dfs -put sample.txt */test1/t1_2.txt*
>  # Configure ListHDFS and set *Directory* to */test1* and start the 
> processor. It will produce two flowfiles: *t1_1.txt* and *t1_2.txt*
>  # Stop the processor. Configure and set *Directory* to */test2*. Ideally the 
> state variables (listed and emitted timestamp) should be reset and they 
> should list the file *t2_1.txt* but it is not.
>  # Now put one more file to test2:
>  ## > hdfs dfs -put sample.txt */test2/2_2.txt*
>  # This would have listed the file *t2_2.txt*. File t2_1.txt is missed
> Little debugging helped me found that the `onPropertyModified` indeed works 
> as intended but somewhere else the code still reads the last saved state i.e. 
> the modified time of */test1/t1_2.txt*



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to