use of water.api.HDFSIOException in project h2o-3 by h2oai.
the class PersistHdfs method importFiles.
@Override
public void importFiles(String path, String pattern, ArrayList<String> files, ArrayList<String> keys, ArrayList<String> fails, ArrayList<String> dels) {
// Fix for S3 kind of URL
if (isBareS3NBucketWithoutTrailingSlash(path)) {
path += "/";
}
Log.info("ImportHDFS processing (" + path + ")");
// List of processed files
try {
// Recursively import given file/folder
addFolder(new Path(path), keys, fails);
files.addAll(keys);
// write barrier was here : DKV.write_barrier();
} catch (IOException e) {
throw new HDFSIOException(path, PersistHdfs.CONF.toString(), e);
}
}
use of water.api.HDFSIOException in project h2o-3 by h2oai.
the class PersistHdfs method delete.
@Override
public boolean delete(String path) {
Path p = new Path(path);
URI uri = p.toUri();
try {
FileSystem fs = FileSystem.get(uri, CONF);
return fs.delete(p, true);
} catch (IOException e) {
throw new HDFSIOException(path, CONF.toString(), e);
}
}
use of water.api.HDFSIOException in project h2o-3 by h2oai.
the class PersistHdfs method isDirectory.
@Override
public boolean isDirectory(String path) {
Path p = new Path(path);
URI uri = p.toUri();
try {
FileSystem fs = FileSystem.get(uri, CONF);
return fs.isDirectory(p);
} catch (IOException e) {
throw new HDFSIOException(path, CONF.toString(), e);
}
}
use of water.api.HDFSIOException in project h2o-3 by h2oai.
the class PersistHdfs method rename.
@Override
public boolean rename(String fromPath, String toPath) {
Path f = new Path(fromPath);
Path t = new Path(toPath);
URI uri = f.toUri();
try {
FileSystem fs = FileSystem.get(uri, CONF);
return fs.rename(f, t);
} catch (IOException e) {
throw new HDFSIOException(toPath, CONF.toString(), e);
}
}
use of water.api.HDFSIOException in project h2o-3 by h2oai.
the class PersistHdfs method open.
@Override
public InputStream open(String path) {
Path p = new Path(path);
URI uri = p.toUri();
try {
FileSystem fs = FileSystem.get(uri, CONF);
return fs.open(p);
} catch (IOException e) {
throw new HDFSIOException(path, CONF.toString(), e);
}
}
Aggregations