On Fri, Aug 8, 2014 at 3:14 PM, China 陈毓端 <[email protected]> wrote:
> > Are you sure about that? Or do you refer to "libhdfs can be used in > > threaded applications using the Posix Threads" from their doc? Which > > means something different (libhdfs is thread safe, given that the > > global functions are called correctly.). > > > > > > > libdhfs is thread safe. > > > Concurrency and Hadoop FS "handles" > The Hadoop FS implementation includes a FS handle cache which caches based > on the URI of the namenode along with the user connecting. So, all calls to > hdfsConnect will return the same handle but calls to hdfsConnectAsUser with > different users will return different handles. But, since HDFS client > handles are completely thread safe, this has no bearing on concurrency. > > > Concurrency and libhdfs/JNI > The libhdfs calls to JNI should always be creating thread local storage, > so (in theory), libhdfs should be as thread safe as the underlying calls to > the Hadoop FS. > > > > http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/LibHdfs.html > libhdfs being thread-safe means that it can be used in ZTS builds(without problems) not that it can only be used in ZTS builds. -- Ferenc Kovács @Tyr43l - http://tyrael.hu
