You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Gera Shegalov (JIRA)" <ji...@apache.org> on 2015/03/02 04:34:05 UTC

[jira] [Commented] (HADOOP-11618) DelegateToFileSystem always uses default FS's default port

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

Gera Shegalov commented on HADOOP-11618:
----------------------------------------

Thanks for the 001 patch [~brahmareddy]. 

The current regression test covers one important facet, the inability to create an {{DelegateToFileSystem}} instance with required authority if the default uri does not have a port.

However, It would pass for the original implementation of {{DelegateToFileSystem}} if you add 
{code}
FileSystem.setDefaultUri(conf, "hdfs://dummy-host:4321");
{code}
that has nothing to do with FTP  before the FtpFs construction. 

Because the issue is about the default port, I recommend to use a port-less URI to init FtpFs {{ftp://dummy-host}} for both cases.
# default URI with port "hdfs://dummy-host:4321"
# default URI without port "hdfs://dummy-host"

In both cases, we are going to assert that {{ftpFs.getUri()}} results in {{ftp://dummy-host:21}}

Since the problem is not specific to FtpFs, we are better off to have these tests in {{org.apache.hadoop.fs.TestDelegateToFileSystem}}. Instead of using the FtpFs constructor directly, we should use the standard idiom: {{AbstractFileSystem#get(uri, conf)}}. We can specify  {{fs.AbstractFileSystem.ftp.impl}} either in the test configuration,  or add it to core-default.xml

> DelegateToFileSystem always uses default FS's default port 
> -----------------------------------------------------------
>
>                 Key: HADOOP-11618
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11618
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 2.6.0
>            Reporter: Gera Shegalov
>            Assignee: Brahma Reddy Battula
>         Attachments: HADOOP-11618-001.patch, HADOOP-11618.patch
>
>
> DelegateToFileSystem constructor has the following code:
> {code}
>     super(theUri, supportedScheme, authorityRequired,
>         FileSystem.getDefaultUri(conf).getPort());
> {code}
> The default port should be taken from theFsImpl instead.
> {code}
>     super(theUri, supportedScheme, authorityRequired,
>         theFsImpl.getDefaultPort());
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)