Github user jacques-n commented on a diff in the pull request:

    https://github.com/apache/drill/pull/376#discussion_r53083386
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java 
---
    @@ -47,6 +49,14 @@
       public List<String> files;
       public final String selectionRoot;
     
    +  private enum StatusType {
    +    CHECKED_DIRS,        // whether we have already checked for directories
    +    HAS_DIRS,            // whether directories were found in the selection
    +    EXPANDED_DIRS        // whether this selection has been expanded to 
files
    +  }
    +
    +  private final BitSet dirStatus;
    --- End diff --
    
    You took this differently than I meant it. My proposal was that 
FileSelection has various states:
    
    NOT_CHECKED_DIRS => (HAS_DIRS | NO_DIRS) => EXPANDED
    
    Doesn this lifecycle describe the state of FileSelection? This way you 
don't have the multi-state-management problem you currently have below with 
this kind of construct: 
    
        fileSel.setExpanded(true);
        fileSel.setCheckedForDirectories(true);
        fileSel.setHasDirectories(false);  // already expanded
    
    For each of the enumerations, we can return the right booleans that you 
need through enumerator constructors. 


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