hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yi Liu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-6813) WebHdfsFileSystem#OffsetUrlInputStream should implement PositionedReadable with thead-safe.
Date Tue, 05 Aug 2014 16:04:15 GMT

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

Yi Liu commented on HDFS-6813:
------------------------------

Hi [~szetszwo] and [~stevel@apache.org], after further thinking, I think we need to make thread-safe
in DFSInputStream, my points are:
* Pread in org.apache.hadoop.hdfs.DFSInputStream doesn't modify the pos, so we have opportunity
to make read and pread concurrent. We need to synchronize few object variables like {{failures}},
we can define local variable to resolve this problem.
   If Pread doesn't access object variable, then it's thread-safe and we don't need to synchronize
it with other Ops like read, seek.
* If we leave the synchronization to user applications, then read and pread *cannot* be concurrent.

> 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