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 Koert Kuipers <ko...@tresata.com> on 2012/08/06 00:13:25 UTC

is hadoop FileSystem class thread-safe?

Can i share one instance safely amount multiple threads?

Re: is hadoop FileSystem class thread-safe?

Posted by Steve Loughran <st...@hortonworks.com>.
> On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <ko...@tresata.com> wrote:
>>
>> Can i share one instance safely amount multiple threads?
>
>

In Hadoop 1.x, FS instances get cached so you end up getting the same
one unless you explicitly say no at the time of retrieval

    conf.setBoolean("fs.hdfs.impl.disable.cache", true);
    FileSystem filesys = FileSystem.get(conf);

This is the way to guarantee isolation. newInstance() is a later feature

Re: is hadoop FileSystem class thread-safe?

Posted by Steve Loughran <st...@hortonworks.com>.
> On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <ko...@tresata.com> wrote:
>>
>> Can i share one instance safely amount multiple threads?
>
>

In Hadoop 1.x, FS instances get cached so you end up getting the same
one unless you explicitly say no at the time of retrieval

    conf.setBoolean("fs.hdfs.impl.disable.cache", true);
    FileSystem filesys = FileSystem.get(conf);

This is the way to guarantee isolation. newInstance() is a later feature

Re: is hadoop FileSystem class thread-safe?

Posted by Steve Loughran <st...@hortonworks.com>.
> On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <ko...@tresata.com> wrote:
>>
>> Can i share one instance safely amount multiple threads?
>
>

In Hadoop 1.x, FS instances get cached so you end up getting the same
one unless you explicitly say no at the time of retrieval

    conf.setBoolean("fs.hdfs.impl.disable.cache", true);
    FileSystem filesys = FileSystem.get(conf);

This is the way to guarantee isolation. newInstance() is a later feature

Re: is hadoop FileSystem class thread-safe?

Posted by Steve Loughran <st...@hortonworks.com>.
> On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <ko...@tresata.com> wrote:
>>
>> Can i share one instance safely amount multiple threads?
>
>

In Hadoop 1.x, FS instances get cached so you end up getting the same
one unless you explicitly say no at the time of retrieval

    conf.setBoolean("fs.hdfs.impl.disable.cache", true);
    FileSystem filesys = FileSystem.get(conf);

This is the way to guarantee isolation. newInstance() is a later feature

Re: is hadoop FileSystem class thread-safe?

Posted by Koert Kuipers <ko...@tresata.com>.
On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <ko...@tresata.com> wrote:

> Can i share one instance safely amount multiple threads?
>

Re: is hadoop FileSystem class thread-safe?

Posted by Koert Kuipers <ko...@tresata.com>.
On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <ko...@tresata.com> wrote:

> Can i share one instance safely amount multiple threads?
>

Re: is hadoop FileSystem class thread-safe?

Posted by Koert Kuipers <ko...@tresata.com>.
On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <ko...@tresata.com> wrote:

> Can i share one instance safely amount multiple threads?
>

Re: is hadoop FileSystem class thread-safe?

Posted by Koert Kuipers <ko...@tresata.com>.
On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <ko...@tresata.com> wrote:

> Can i share one instance safely amount multiple threads?
>