[
https://issues.apache.org/jira/browse/HDFS-5224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13788548#comment-13788548
]
Colin Patrick McCabe commented on HDFS-5224:
--------------------------------------------
bq. Colin Patrick McCabe, if I understand correctly, you're advocating that we
go ahead and pass around PathBasedCacheDirective/Descriptor at all layers
(client, protocol, and NN implementation all the way down to CacheManager). The
path member will be a Path, not a String, and the implementation in the NN will
only use the path part and ignore all other URI components like scheme and
authority.
Right, exactly. If you look at {{NameNodeRpcServer}}, you see that all the
methods there treat path as a {{String}}. The NN doesn't need scheme or
authority, since we assume that if you figured out how to talk to the NN, you
know those already :) Only the {{DistributedFilesystem}} (client-facing API)
needs to handle scheme and authority.
bq. Good idea, only change I'd like is to keep the directive immutable and use
a builder instead. We create the descriptor from the input directive in the
ClientNamenode PB translator, so it could possibly race here, and I don't think
mutating a directive after create time makes much sense anyway (esp after it's
used in addPathBasedCacheDirective).
Good idea. We could have a method in the {{DistributedFileSystem}} return a
{{PathBasedCacheDirective#Builder}}, perhaps.
> Refactor PathBasedCache* methods to use a Path rather than a String
> -------------------------------------------------------------------
>
> Key: HDFS-5224
> URL: https://issues.apache.org/jira/browse/HDFS-5224
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: datanode, namenode
> Affects Versions: HDFS-4949
> Reporter: Andrew Wang
> Assignee: Chris Nauroth
> Attachments: HDFS-5224.1.patch
>
>
> As discussed in HDFS-5213, we should refactor PathBasedCacheDirective and
> related methods in DistributedFileSystem to use a Path to represent paths to
> cache, rather than a String.
--
This message was sent by Atlassian JIRA
(v6.1#6144)