Virajith Jalaparti commented on HDFS-10638:

Hi [~eddyxu], Thank you for the comments! 

bq. Should we mark {{StorageLocation#getFile}} as deprecated?
bq. Should we just remove {{StorageLocation#file}} and 
{{StorageLocation#getFile()}} once for all? 

So, are you proposing to replace all invocations of 
{{StorageLocation#getFile()}} with, say, {{StorageLocation#getURI()}}? I think 
this makes sense. The reason I didn't do this was because some of the tests use 
{{File#getCanonicalPath}} to compare {{File}} objects. I don't think an 
equivalent exists for URIs unless we explicitly add a 
{{StorageLocation#getCanonicalURI}}. However, as an equivalent call does not 
exist in {{java.net.URI}}, this would be a non-standard way of doing it. 

One solution for this would be to modify the tests to replace calls to 
{{File#getCanonicalPath}}  to use normalized URIs. 

In {{StorageDirectory}}, we can replace {{StorageLocation#getFile()}} with 
{{StorageLocation#getURI()}}, and try to resolve it as a {{File}} internally. 

Does this solution make sense?

bq. Should {{StorageLocation#matchesStorageDirectory()}}s be moved to 
{{StorageDirectory}} class? 

Any particular reason for this? If we move it to {{StorageDirectory}}, we would 
have a {{StorageDirectory#matchesStorageLocation}} function, which seems 
equivalent to what we have currently. 

bq. Catching {{NullPointerException}} here seems suspicious to me. 

I added this to address the case where {{replicaLocation.getUri()}} might 
return {{null}}. However, if {{replicaLocation}} is constructed correctly, that 
should not be the case. I will remove this. 

I agree with the others, and will address them in the next patch. 

> Modifications to remove the assumption that StorageLocation is associated 
> with java.io.File in Datanode.
> --------------------------------------------------------------------------------------------------------
>                 Key: HDFS-10638
>                 URL: https://issues.apache.org/jira/browse/HDFS-10638
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: datanode, fs
>            Reporter: Virajith Jalaparti
>            Assignee: Virajith Jalaparti
>         Attachments: HDFS-10638.001.patch, HDFS-10638.002.patch, 
> HDFS-10638.003.patch, HDFS-10638.004.patch
> Changes to ensure that {{StorageLocation}} need not be associated with a 
> {{java.io.File}}. 

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to