I'm trying to read a Java properties file that is on HDFS like this:
try {
properties.load(new FileInputStream("hdfs://user/hdfs/my_props.properties"));
} catch (IOException e) {
throw new RuntimeException("Properties file not found.");
}
But it doesn't seem to work and I get the "Properties file not found." exception. If I replace the path to a local file, it works fine and I'm able to read the file.
Is it possible to read a HDFS file using FileInputStream?
Thanks!