You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/03/09 05:02:00 UTC

[jira] [Updated] (HDFS-17848) OIV should not use PrintStream

     [ https://issues.apache.org/jira/browse/HDFS-17848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated HDFS-17848:
----------------------------------
    Labels: pull-request-available  (was: )

> OIV should not use PrintStream
> ------------------------------
>
>                 Key: HDFS-17848
>                 URL: https://issues.apache.org/jira/browse/HDFS-17848
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: command
>            Reporter: Tsz-wo Sze
>            Priority: Major
>              Labels: pull-request-available
>
> The problem reported by HDFS-17847 actually is due to the use of PrintStream in OIV.
> {quote}... Unlike other output streams, a PrintStream never throws an IOException; instead, exceptional situations merely set an internal flag that can be tested via the checkError method. ...
> {quote} - [https://docs.oracle.com/javase/8/docs/api/java/io/PrintStream.html]
> As described in the javadoc above, PrintStream never throws an IOException. HDFS-17847 has proposed a quick fix by calling the checkError method. However, the checkError method does not tell the detail of the error.
> In the use case of OIV, it is better to use a class which throws IOException on failures. A potential replacement is [OutputStreamWriter|https://docs.oracle.com/javase/8/docs/api/java/io/OutputStreamWriter.html].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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