Search in sources :

Example 1 with HDFSIOException

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);
    }
}
Also used : HDFSIOException(water.api.HDFSIOException) IOException(java.io.IOException) HDFSIOException(water.api.HDFSIOException)

Example 2 with HDFSIOException

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);
    }
}
Also used : HDFSIOException(water.api.HDFSIOException) IOException(java.io.IOException) URI(java.net.URI) HDFSIOException(water.api.HDFSIOException)

Example 3 with HDFSIOException

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);
    }
}
Also used : HDFSIOException(water.api.HDFSIOException) IOException(java.io.IOException) URI(java.net.URI) HDFSIOException(water.api.HDFSIOException)

Example 4 with HDFSIOException

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);
    }
}
Also used : HDFSIOException(water.api.HDFSIOException) IOException(java.io.IOException) URI(java.net.URI) HDFSIOException(water.api.HDFSIOException)

Example 5 with HDFSIOException

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);
    }
}
Also used : HDFSIOException(water.api.HDFSIOException) IOException(java.io.IOException) URI(java.net.URI) HDFSIOException(water.api.HDFSIOException)

Aggregations

IOException (java.io.IOException)10 HDFSIOException (water.api.HDFSIOException)10 URI (java.net.URI)9