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

    https://github.com/apache/storm/pull/1937#discussion_r103069596
  
    --- Diff: 
external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/HdfsSpout.java ---
    @@ -596,9 +622,16 @@ private FileReader pickNextFile() {
           }
     
           // 2) If no abandoned files, then pick oldest file in sourceDirPath, 
lock it and rename it
    -      Collection<Path> listing = 
HdfsUtils.listFilesByModificationTime(hdfs, sourceDirPath, 0);
    -
    -      for (Path file : listing) {
    +      try {
    +        hdfsDirectoryMonitor.update();
    +      } catch (Exception e) {
    +        LOG.error("Unable to update source dir: " + sourceDirPath, e);
    +        return null;
    +      }
    +      for (Path file : hdfsDirectoryMonitor) {
    +        if 
(Path.getPathWithoutSchemeAndAuthority(file).toString().startsWith(lockDirPath.toString()))
 {
    --- End diff --
    
    we can merge these two if blocks into single if block.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to