Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> Checking Which Filesystem Being Used?

Copy link to this message
Re: Checking Which Filesystem Being Used?
On Tue, Feb 7, 2012 at 5:24 PM, Eli Finkelshteyn <[EMAIL PROTECTED]> wrote:

> Hi Folks,
> This might be a stupid question, but I'm new to Java and Hadoop, so...
> Anyway, if I want to check what FileSystem is currently being used at some
> point (i.e. evaluating FileSystem.get(conf)), what would be the most
> elegant way of doing that? Should I just do something like:
>    if (FileSystem.get(conf) == "HDFS") {...}
> Or is there a better way?
> Eli

conf.get("fs.default.name") would return a URI such as hdfs://bla:8000 or
file:///this. Although an application could have two Configurations which
could be used to connect to two separate FileSystems inside the same java