[
https://issues.apache.org/jira/browse/HDFS-14401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16833606#comment-16833606
]
Feilong He commented on HDFS-14401:
-----------------------------------
Thanks [~rakeshr] for commenting on the patch.
{quote}Rename PmemVolumeManager variable '{{i}}' to '{{nextIndex}}'.
{quote}
Yes, {{nextIndex }}would be more friendly to reading the code.
{quote}How about resetting {{nextIndex}} to avoid growing to infinity, probably
can refer below idea or you can explicitly reset {{nextIndex=0}}, {{if
(nextIndex == count)}}.
{quote}
Agree with you. The max value of nextIndex should be restricted. I will reset
nextIndex when it equals to count.
{quote}Instead of {{memCacheStats.getCacheUsed()}}, it should be
{{cacheLoader.getCacheUsed()}}, right?
{quote}
Yes, thanks for your careful review. I will fix it in new patch.
{quote}Please double check the chances of any scenario where it adds
{{blockKeyToVolume.put(key, index);}}entry and then
{{usedBytesCounts.get(index).reserve(bytesCount);}} return -1?
{quote}
Since the two statements {{blockKeyToVolume.put(key, index) }}and
{{usedBytesCounts.get(index).reserve(bytesCount)}}
are called in a synchronized method, the given volume should have enough space
for reserving in multi-thread case. To gaurantee the expected logic further, I
will exchange the execution sequence of these two statements. The value will be
put into {{bockKeyToVolume }}only if reserving bytes succeeded.
> Refine the implementation for HDFS cache on SCM
> -----------------------------------------------
>
> Key: HDFS-14401
> URL: https://issues.apache.org/jira/browse/HDFS-14401
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: caching, datanode
> Reporter: Feilong He
> Assignee: Feilong He
> Priority: Major
> Attachments: HDFS-14401.000.patch, HDFS-14401.001.patch,
> HDFS-14401.002.patch, HDFS-14401.003.patch, HDFS-14401.004.patch,
> HDFS-14401.005.patch, HDFS-14401.006.patch, HDFS-14401.007.patch
>
>
> In this Jira, we will refine the implementation for HDFS cache on SCM, such
> as: 1) Handle full pmem volume in VolumeManager; 2) Refine pmem volume
> selection impl; 3) Clean up MapppableBlockLoader interface; etc.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]