hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Virajith Jalaparti (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-10638) Modifications to remove the assumption that StorageLocation is associated with java.io.File in Datanode.
Date Fri, 14 Oct 2016 20:06:21 GMT

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

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
(v6.3.4#6332)

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


Mime
View raw message