Esempio n. 1
0
 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();
   }
 }
Esempio n. 2
0
 public static InputStream openStream(Path path, Configuration conf) throws IOException {
   FileSystem fs = FileSystem.get(path.toUri(), conf);
   return fs.open(path.makeQualified(fs));
 }