hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tsz Wo Nicholas Sze (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-6813) WebHdfsFileSystem#OffsetUrlInputStream should implement PositionedReadable with thead-safe.
Date Tue, 05 Aug 2014 01:29:12 GMT

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

Tsz Wo Nicholas Sze commented on HDFS-6813:
-------------------------------------------

I think requiring PositionedReadable to be thread-safe may be overkill.  I believe few user
applications need thread-safe and, if it is needed, it is very easy to be synchronized in
the user applications.  Just have checked Java InputStream and DataInputStream, they are not
enforcing thread-safe.  The [DataInputStream javadoc|http://docs.oracle.com/javase/7/docs/api/java/io/DataInputStream.html]
even emphasizes that it is not thread-safe:

bq. DataInputStream is not necessarily safe for multithreaded access.   Thread safety is optional
and is the responsibility of users of methods in this class.

I suggest simple update the javadoc of PositionedReadable.  What do you think?

> WebHdfsFileSystem#OffsetUrlInputStream should implement PositionedReadable with thead-safe.
> -------------------------------------------------------------------------------------------
>
>                 Key: HDFS-6813
>                 URL: https://issues.apache.org/jira/browse/HDFS-6813
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: webhdfs
>    Affects Versions: 2.6.0
>            Reporter: Yi Liu
>            Assignee: Yi Liu
>         Attachments: HDFS-6813.001.patch
>
>
> {{PositionedReadable}} definition requires the implementations for its interfaces should
be thread-safe.
> OffsetUrlInputStream(WebHdfsFileSystem inputstream) doesn't implement these interfaces
with tread-safe, this JIRA is to fix this.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message