[
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 [[email protected]], 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)