hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ayush Saxena (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HADOOP-16282) AvoidFileStream to improve performance
Date Wed, 01 May 2019 04:55:00 GMT

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

Ayush Saxena edited comment on HADOOP-16282 at 5/1/19 4:54 AM:
---------------------------------------------------------------

Thanx [~giovanni.fumarola] for review.
{quote}(new FileOutputStream(new File(filename)), -> new PrintStream(Files.newOutputStream(Paths.get(filename))
{quote}
Here first file was required as input but for the latter only path is required, So Instead
of converting to file and then getting the path I directly took the path from filename.

 
{quote}Moving from FileNotFoundException to IOException may have some different results. Can
you check if that instruction is the only one that can trigger the exception?
{quote}
I checked the javadoc, and tried searching a bit, but there isn't any discrete confirmation,
that I can take upon and guarantee on the fact. 
 Should I take those Exception changed changes?
 it had a mention [here|https://pmd.github.io/latest/pmd_rules_java_performance.html#avoidfilestream]

Let me know ur opinion, will update accordingly:)

 


was (Author: ayushtkn):
Thanx [~giovanni.fumarola] for review.
{quote}(new FileOutputStream(new File(filename)), -> new PrintStream(Files.newOutputStream(Paths.get(filename))
{quote}
Here first file was required as input but for the latter only path is required, So Instead
of converting to file and then getting the path I directly took the path from file.

 
{quote}Moving from FileNotFoundException to IOException may have some different results. Can
you check if that instruction is the only one that can trigger the exception?
{quote}

 I checked the javadoc, and tried searching a bit, but there isn't any discrete confirmation,
that I can take upon and guarantee on the fact. 
 Should I take those Exception changed changes?
 it had a mention [here|https://pmd.github.io/latest/pmd_rules_java_performance.html#avoidfilestream]

Let me know ur opinion, will update accordingly:)

 

> AvoidFileStream to improve performance
> --------------------------------------
>
>                 Key: HADOOP-16282
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16282
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Major
>         Attachments: HADOOP-16282-01.patch, HADOOP-16282-02.patch
>
>
> The FileInputStream and FileOutputStream classes contains a finalizer method which will
cause garbage collection pauses. See [JDK-8080225|https://bugs.openjdk.java.net/browse/JDK-8080225]
for details.
> The FileReader and FileWriter constructors instantiate FileInputStream and FileOutputStream,
again causing garbage collection issues while finalizer methods are called.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message