Read a properties file from HDFS Read a properties file from HDFS hadoop hadoop

Read a properties file from HDFS


I hope you need to use hadoop jars and also need the FileSystem to read from HDFS. Something like this should be put before your code.

Path pt=new Path("hdfs://user/hdfs/my_props.properties");FileSystem fs = FileSystem.get(new Configuration());

Refer to: FileInputStream for a generic file System


 val fs = FileSystem.get(new Configuration) val hdfsPath = new Path("hdfs://user/hdfs/my_props.properties") val fis = new InputStreamReader(fs.open(hdfsPath)) prop.load(fis) // This will be your properties object