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

Rakesh R commented on HDFS-14401:
---------------------------------

Overall the patch looks good and I think its nearing completion. Could you 
please take care below comments:
 # Rename PmemVolumeManager variable '{{i}}' to '{{nextIndex}}'.
 # How about resetting {{nextIndex}} to avoid growing to infinity, probably can 
refer below idea or you can explicitly reset {{nextIndex=0}}, {{if (nextIndex 
== count)}}.
{code:java}
    private byte nextIndex = 0;
        ..
        ..
    while (k++ != count) {
          nextIndex = (byte) (nextIndex % count);
          byte index = nextIndex;
          nextIndex++;
      long availableBytes = usedBytesCounts.get(index).getAvailableBytes();
      if (availableBytes >= bytesCount) {
        return index;
      }
          if (availableBytes > maxAvailableSpace) {
        maxAvailableSpace = availableBytes;
      }
    }
{code}

 # Instead of {{memCacheStats.getCacheUsed()}}, it should be 
{{cacheLoader.getCacheUsed()}}, right?
{code:java}
          LOG.debug("Caching of {} was aborted.  We are now caching only {} "
                  + "bytes in total.", key, cacheLoader.getCacheUsed());
{code}

 # 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?

> 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
>
>
> 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]

Reply via email to