我需要阅读 hdfs 中可用的 .properties 文件。我正在使用下面的代码,但它会引发运行时错误。
FileSystem fs = FileSystem.get(config);
Properties conf = wc.createConfiguration();
Properties prop = new Properties();
String appPath = "hdfs://clusterdb05.com:8020/user/cmahajan/" + version + "/apps/apps/";
conf.setProperty(OozieClient.APP_PATH,appPath);
FileInputStream f = new FileInputStream("hdfs://clusterdb05.com:8020/user/cmahajan/app.properties");
ObjectInputStream f = new ObjectInputStream(fs.open(new Path("/user/cmahajan/app.properties")));
运行时错误是:
LaunchJob.java:28: cannot find symbol
symbol : class ObjectInputStream
location: class LaunchJob
ObjectInputStream f = new ObjectInputStream(fs.open(new Path("/user/cmahajan/app.properties")));
^
LaunchJob.java:28: cannot find symbol
symbol : class ObjectInputStream
location: class LaunchJob
ObjectInputStream f = new ObjectInputStream(fs.open(new Path("/user/cmahajan/app.properties")));