FAQ
I've tried to use this simple line of code to create a URL using hdfs...

URL aurl = new URL("hdfs://myserver:9000/ds");

Executing this line produces this exception.
java.net.MalformedURLException: unknown protocol: hdfs

Trying to solve this problem I've determined that I need a class that
subclasses URLStreamHandler. Figuring that one had already been written
for hdfs I went looking.

Came across (HADOOP-3074) URLStreamHandler for the DFS. Where it says
to do this:

java -Djava.protocol.handler.pkgs=org.apache.hadoop.util.protocols
<MainClass>}}.

This did not work, and in fact org.apache.hadoop.util.protocols is not
even found in hadoop-0.20.1-core.jar, nor do I find it anywhere else.



Any help here please,
Thanks

Search Discussions

  • Ted Yu at Jun 12, 2010 at 12:02 pm
    Take a look at test/org/apache/hadoop/fs/TestUrlStreamHandler.java where you
    can find how to use FsUrlStreamHandlerFactory.
    On Fri, Jun 11, 2010 at 9:59 AM, Bryan Moore wrote:


    I've tried to use this simple line of code to create a URL using hdfs...

    URL aurl = new URL("hdfs://myserver:9000/ds");

    Executing this line produces this exception.
    java.net.MalformedURLException: unknown protocol: hdfs

    Trying to solve this problem I've determined that I need a class that
    subclasses URLStreamHandler. Figuring that one had already been written for
    hdfs I went looking.

    Came across (HADOOP-3074) URLStreamHandler for the DFS. Where it says to
    do this:

    java -Djava.protocol.handler.pkgs=org.apache.hadoop.util.protocols
    <MainClass>}}.

    This did not work, and in fact org.apache.hadoop.util.protocols is not even
    found in hadoop-0.20.1-core.jar, nor do I find it anywhere else.



    Any help here please,
    Thanks

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-user @
categorieshadoop
postedJun 11, '10 at 5:09p
activeJun 12, '10 at 12:02p
posts2
users2
websitehadoop.apache.org...
irc#hadoop

2 users in discussion

Bryan Moore: 1 post Ted Yu: 1 post

People

Translate

site design / logo © 2023 Grokbase