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

Chris Nauroth commented on HDFS-5224:
-------------------------------------

No worries on the delay, and thanks for the feedback.

bq. I think we should make it so the PCD path is qualified at creation time, 
else you might create a PCD with a relative path, change working directories, 
and the PCD now refers to a different path. I think the easiest way of doing 
this is a factory method in DFS.

This is actually consistent with all of the other DFS methods that accept a 
{{Path}}.  If you create a relative {{Path}} instance, then call 
{{DistributedFileSystem#setWorkingDirectory}}, and then pass the {{Path}} to a 
method, the method internally resolves against the new working directory, not 
the working directory that was in effect at {{Path}} creation time.  Thus, 
adding a factory method like this on DFS would create an inconsistency in the 
API.  If a caller doesn't like this behavior for their 
{{PathBasedCacheDirective}} instances, then they can create it using the result 
of {{DistributedFileSystem#makeQualified}}, passing the relative {{Path}}, and 
this would be consistent with the rest of the DFS API.  Let me know what you 
think.



> 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, HDFS-5224.2.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)

Reply via email to