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

Andrew Wang commented on HDFS-5304:
-----------------------------------

There's a mismatch if we still want to use {{boolean[]}} in the RPC format and 
{{DatanodeInfo[]}} in {{LocatedBlock}}. It means the RPC layer has to map from 
{{DI->booleans}} and back, which is problematic if you mistakenly add a cached 
location that isn't also in the list of locations.

Maybe we can do something mildly complicated with both a {{repeated boolean}} 
for cached locations that are in the {{locs}} array, and then a {{repeated 
DatanodeInfoProto}} for anything that's not. The in-memory state of the 
LocatedBlock will still be references when possible, and it's a nice future 
proofing for if/when we have non-disk-backed caching.

> Expose if a block replica is cached in getFileBlockLocations
> ------------------------------------------------------------
>
>                 Key: HDFS-5304
>                 URL: https://issues.apache.org/jira/browse/HDFS-5304
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>    Affects Versions: HDFS-4949
>            Reporter: Andrew Wang
>            Assignee: Andrew Wang
>         Attachments: hdfs-5304-1.patch
>
>
> We need to expose which replicas of a block are cached so applications can 
> place their tasks for memory-locality.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to