Example #1
0
 public H2OHdfsInputStream(Path p, long offset, ProgressMonitor pmon) throws IOException {
   super(offset, pmon);
   _path = p;
   _fs = FileSystem.get(p.toUri(), CONF);
   setExpectedSz(_fs.getFileStatus(p).getLen());
   open();
 }
Example #2
0
 public static void addFolder2(Path p, ArrayList<String> keys, ArrayList<String> failed)
     throws IOException {
   FileSystem fs = FileSystem.get(p.toUri(), PersistHdfs.CONF);
   if (!fs.exists(p)) {
     failed.add("Path does not exist: '" + p.toString() + "'");
     return;
   }
   addFolder2(fs, p, keys, failed);
 }
Example #3
0
 // Loading/Writing ice to HDFS
 PersistHdfs(URI uri) {
   try {
     _iceRoot = new Path(uri + "/ice" + H2O.SELF_ADDRESS.getHostAddress() + "-" + H2O.API_PORT);
     // Make the directory as-needed
     FileSystem fs = FileSystem.get(_iceRoot.toUri(), CONF);
     fs.mkdirs(_iceRoot);
   } catch (Exception e) {
     throw Log.errRTExcept(e);
   }
 }
Example #4
0
 public static void addFolder(Path p, JsonArray succeeded, JsonArray failed) throws IOException {
   FileSystem fs = FileSystem.get(p.toUri(), PersistHdfs.CONF);
   if (!fs.exists(p)) {
     JsonObject o = new JsonObject();
     o.addProperty(Constants.FILE, p.toString());
     o.addProperty(Constants.ERROR, "Path does not exist!");
     failed.add(o);
     return;
   }
   addFolder(fs, p, succeeded, failed);
 }
Example #5
0
 public static void addFolder(Path p, JsonArray succeeded, JsonArray failed) throws IOException {
   FileSystem fs = FileSystem.get(p.toUri(), PersistHdfs.CONF);
   addFolder(fs, p, succeeded, failed);
 }