public static int readInt(Path path, Configuration conf) throws IOException { FileSystem fs = FileSystem.get(path.toUri(), conf); //FileSystem fs = path.getFileSystem(conf); FSDataInputStream in = fs.open(path); try { return in.readInt(); } finally { in.close(); } }
public static InputStream openStream(Path path, Configuration conf) throws IOException { FileSystem fs = FileSystem.get(path.toUri(), conf); return fs.open(path.makeQualified(fs)); }