You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Sugandha Naolekar <su...@gmail.com> on 2010/06/12 08:57:25 UTC

Hadoop code execution!!

Hello!!

    I have developed a GUI in JAVA using Swings!! Now, I want to perform
simple HDFS operations such as, data transfer and retrieval of the same.
These all operations I want  to perform on the button click. So, I have
written a simple code, in which I have used FileSystem API and invoked
corresponding methods.

    Now, to execute this code, will I have to build a jar?? Also, If I dont
build a Jar of the entire code, but, simply run it on the click event of a
button, will the HDFS operations be performed. Remember, I dont want to
perform LocalFS tasks but the object of HDFS should get initialized. For
that,  creation of Configuration class 's object will be suffice??

Regards!
Sugandha!!

Re: Hadoop code execution!!

Posted by Sanel Zukan <sa...@gmail.com>.
Just make sure 'fs.default.name' (set in Configuration) is set and point to
master with 'hdfs://' prefix. Otherwise, by default, it will behave as
LocalFileSystem.

On Sat, Jun 12, 2010 at 9:08 AM, Jeff Zhang <zj...@gmail.com> wrote:
> You should put hadoop-*.core.jar on your classpath. and initialize
> your FileSystem by the following method
> public static FileSystem get(URI uri, Configuration conf)
>
> You can make the uri configuration in your UI.
>
>
>
> On Sat, Jun 12, 2010 at 2:57 PM, Sugandha Naolekar
> <su...@gmail.com> wrote:
>> Hello!!
>>
>>    I have developed a GUI in JAVA using Swings!! Now, I want to perform
>> simple HDFS operations such as, data transfer and retrieval of the same.
>> These all operations I want  to perform on the button click. So, I have
>> written a simple code, in which I have used FileSystem API and invoked
>> corresponding methods.
>>
>>    Now, to execute this code, will I have to build a jar?? Also, If I dont
>> build a Jar of the entire code, but, simply run it on the click event of a
>> button, will the HDFS operations be performed. Remember, I dont want to
>> perform LocalFS tasks but the object of HDFS should get initialized. For
>> that,  creation of Configuration class 's object will be suffice??
>>
>> Regards!
>> Sugandha!!
>>
>
>
>
> --
> Best Regards
>
> Jeff Zhang
>

Best.

Re: Hadoop code execution!!

Posted by Jeff Zhang <zj...@gmail.com>.
You should put hadoop-*.core.jar on your classpath. and initialize
your FileSystem by the following method
public static FileSystem get(URI uri, Configuration conf)

You can make the uri configuration in your UI.



On Sat, Jun 12, 2010 at 2:57 PM, Sugandha Naolekar
<su...@gmail.com> wrote:
> Hello!!
>
>    I have developed a GUI in JAVA using Swings!! Now, I want to perform
> simple HDFS operations such as, data transfer and retrieval of the same.
> These all operations I want  to perform on the button click. So, I have
> written a simple code, in which I have used FileSystem API and invoked
> corresponding methods.
>
>    Now, to execute this code, will I have to build a jar?? Also, If I dont
> build a Jar of the entire code, but, simply run it on the click event of a
> button, will the HDFS operations be performed. Remember, I dont want to
> perform LocalFS tasks but the object of HDFS should get initialized. For
> that,  creation of Configuration class 's object will be suffice??
>
> Regards!
> Sugandha!!
>



-- 
Best Regards

Jeff Zhang