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

ASF GitHub Bot commented on FLINK-3677:
---------------------------------------

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

    https://github.com/apache/flink/pull/2109#discussion_r73162978
  
    --- Diff: 
flink-core/src/test/java/org/apache/flink/api/common/io/FileInputFormatTest.java
 ---
    @@ -257,41 +257,22 @@ public void testFileInputSplit() {
        public void testIgnoredUnderscoreFiles() {
                try {
                        final String contents = "CONTENTS";
    -                   
    +
                        // create some accepted, some ignored files
    -                   
    -                   File tempDir = new 
File(System.getProperty("java.io.tmpdir"));
    -                   File f;
    -                   do {
    -                           f = new File(tempDir, 
TestFileUtils.randomFileName(""));
    -                   }
    -                   while (f.exists());
     
    -                   assertTrue(f.mkdirs());
    -                   f.deleteOnExit();
    -                   
    -                   File child1 = new File(f, "dataFile1.txt");
    -                   File child2 = new File(f, "another_file.bin");
    -                   File luigiFile = new File(f, "_luigi");
    -                   File success = new File(f, "_SUCCESS");
    -                   
    -                   File[] files = { child1, child2, luigiFile, success };
    -                   
    -                   for (File child : files) {
    -                           child.deleteOnExit();
    -                   
    -                           BufferedWriter out = new BufferedWriter(new 
FileWriter(child));
    -                           try { 
    -                                   out.write(contents);
    -                           } finally {
    -                                   out.close();
    -                           }
    -                   }
    +                   File tempDirectory = createTempDirectory();
                        
    +                   File child1 = new File(tempDirectory, "dataFile1.txt");
    +                   File child2 = new File(tempDirectory, 
"another_file.bin");
    +                   File luigiFile = new File(tempDirectory, "_luigi");
    +                   File success = new File(tempDirectory, "_SUCCESS");
    +
    +                   createTempFiles(contents.getBytes(), child1, child2, 
luigiFile, success);
    --- End diff --
    
    You could actually use `TemporaryFolder` here to create the root. It would 
be cleaned up automatically by junit.


> FileInputFormat: Allow to specify include/exclude file name patterns
> --------------------------------------------------------------------
>
>                 Key: FLINK-3677
>                 URL: https://issues.apache.org/jira/browse/FLINK-3677
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Maximilian Michels
>            Assignee: Ivan Mushketyk
>            Priority: Minor
>              Labels: starter
>
> It would be nice to be able to specify a regular expression to filter files.



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

Reply via email to