GitHub user HuangWHWHW opened a pull request:

    https://github.com/apache/flink/pull/1119

    [hotfix][streaming]Improve throwing exception for WriteSinkFunction.java

    When call the `cleanFile()` method in WriteSinkFunction, it will only print 
"File not found" when error occurred.
    And the FileNotFoundException is not only the "File not found" but also 
others(.e.g "Permission denied").
    So I changed the print path to print exception.
    
    For example, when a "Permission denied" happened, here is the exception 
information following before change:
    `java.lang.RuntimeException: File not found /result.txt
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
        at java.io.PrintWriter.<init>(PrintWriter.java:184)
        at 
org.apache.flink.streaming.api.functions.sink.WriteSinkFunction.cleanFile(WriteSinkFunction.java:55)
        at 
org.apache.flink.streaming.api.functions.sink.WriteSinkFunction.<init>(WriteSinkFunction.java:43)
        at 
org.apache.flink.streaming.api.functions.sink.WriteSinkFunctionTest$2.<init>(WriteSinkFunctionTest.java:22)
        at 
org.apache.flink.streaming.api.functions.sink.WriteSinkFunctionTest.testFileNotFound(WriteSinkFunctionTest.java:22)`
    
    And here is the info after change:
    `java.lang.RuntimeException: An error occured while cleaning the 
file:java.io.FileNotFoundException: /result.txt (Permission denied)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
        at java.io.PrintWriter.<init>(PrintWriter.java:184)
        at 
org.apache.flink.streaming.api.functions.sink.WriteSinkFunction.cleanFile(WriteSinkFunction.java:55)
        at 
org.apache.flink.streaming.api.functions.sink.WriteSinkFunction.<init>(WriteSinkFunction.java:43)
        at 
org.apache.flink.streaming.api.functions.sink.WriteSinkFunctionTest$2.<init>(WriteSinkFunctionTest.java:22)
        at 
org.apache.flink.streaming.api.functions.sink.WriteSinkFunctionTest.testFileNotFound(WriteSinkFunctionTest.java:22)`

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

    $ git pull https://github.com/HuangWHWHW/flink FLINK-2480-9-11-new

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

    https://github.com/apache/flink/pull/1119.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 #1119
    
----
commit 22a1b10ad6bf04a3c25056a1aec8930373927704
Author: HuangWHWHW <404823...@qq.com>
Date:   2015-09-11T08:28:48Z

    [hotfix][streaming]Improve throwing exception for WriteSinkFunction.java

----


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