hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@hortonworks.com>
Subject Re: is hadoop FileSystem class thread-safe?
Date Tue, 07 Aug 2012 20:30:25 GMT
> On Sun, Aug 5, 2012 at 6:13 PM, Koert Kuipers <koert@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

View raw message