[
https://issues.apache.org/jira/browse/HDFS-14809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16925623#comment-16925623
]
KenCao commented on HDFS-14809:
-------------------------------
I have made an impletation. There is another impletation called
BlockReaderLocalLegacy in the source code, however we should open the 'RX'
permission where data is stored which is unsafe, but the constructions of
BlockReaderLocalLegacy can be reused when fds(or FileInputStream) are provided.
In my code, once the `dfs.client.blockreader.local.reader2` is set to true, a
BlockReaderLocal2 which is copied from BlockReaderLocalLegacy will be made.
We have made an experiment in HBase(1.2.0-cdh5.8.4). When the qps of a single
node reachs 3000 qps, the file descriptors(mainly the shm and socket that
release slots) will exceed the max value after half of an hour; however when
BlockReaderLocal2 is used, the shared memory is not allocated and the number of
file descriptors does not grow too much.
> Make a new BlockReader for hdfs client lib
> -------------------------------------------
>
> Key: HDFS-14809
> URL: https://issues.apache.org/jira/browse/HDFS-14809
> Project: Hadoop HDFS
> Issue Type: New Feature
> Affects Versions: 2.6.0
> Reporter: KenCao
> Priority: Major
> Attachments: HADOOP-14809
>
>
> as we known, the hdfs client java lib uses BlockReaderLocal for short circuit
> read by default, which allocate shared memory first, and make a slot within
> it. After all these steps, it will request the fds from the DataNode.
> However, the slot and shared memory sturcture is only used by DataNode when
> uncaching replicas, the client process can work well just with the fds asked
> later and it is nearly impossible to cache replicas in product environment.
> The api to release fds is called by client only with the slot given, the fds
> is close in the client process finally.
> so i think we can make a new BlockReader implementation which just requests
> the fds, and it will reduce the rpc calls from 3(allocate shm, request fds,
> release fds) to 1(request fds).
--
This message was sent by Atlassian Jira
(v8.3.2#803003)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]