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 "Carl Steinbach (Commented) (JIRA)" <ji...@apache.org> on 2012/02/10 03:39:59 UTC

[jira] [Commented] (HADOOP-8053) "har://hdfs-/foo" is not a valid URI

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

Carl Steinbach commented on HADOOP-8053:
----------------------------------------

HADOOP-6560 added a check which requires HAR URIs to include a '-' after the underlying scheme even if a host is not specified. Unfortunately this appears to violate the grammar for the host field defined in RFC-2396. Here are the relevant bits from section 3.2.2:

{noformat}

      hostport      = host [ ":" port ]
      host          = hostname | IPv4address
      hostname      = *( domainlabel "." ) toplabel [ "." ]
      toplabel      = alpha | alpha *( alphanum | "-" ) alphanum
{noformat}

Note that the toplabel field can't end in a "-", which implies the host field can't end a in a "-".


{noformat}
public class HarURITest {

  public static void main(String [] args) {
    try {
      new URI("har", "hdfs-", "/foo", null);
    } catch (URISyntaxException e) {
      e.printStackTrace();
    }
  }
}
{noformat}

Generates:

{noformat}
java.net.URISyntaxException: Illegal character in hostname at index 10: har://hdfs-/foo
	at java.net.URI$Parser.fail(URI.java:2809)
	at java.net.URI$Parser.parseHostname(URI.java:3337)
	at java.net.URI$Parser.parseServer(URI.java:3197)
	at java.net.URI$Parser.parseAuthority(URI.java:3116)
	at java.net.URI$Parser.parseHierarchical(URI.java:3058)
	at java.net.URI$Parser.parse(URI.java:3014)
	at java.net.URI.<init>(URI.java:663)
	at java.net.URI.<init>(URI.java:764)
	at HarURITest.main(HarURITest.java:9)
{noformat}


                
> "har://hdfs-/foo" is not a valid URI
> ------------------------------------
>
>                 Key: HADOOP-8053
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8053
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.21.0, 0.23.0
>            Reporter: Carl Steinbach
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira