public static FileSystem connect ( Properties configuration ) throws IOException { String host = configuration . getProperty ( "transformator.dfs.host" ) ; String port = configuration . getProperty ( "transformator.dfs.port" ) ; String hdfsUrl = "hdfs://" + host + ":" + port ; Configuration conf = new Configuration ( ) ; conf . set ( "fs.defaultFS" , hdfsUrl ) ; return FileSystem . get ( conf ) ; }
This method connects to Hadoop . The configuration for the client is looked up in the provided directory . The Hadoop etc directory is expected there .