Example usage for org.apache.hadoop.fs UnsupportedFileSystemException UnsupportedFileSystemException

List of usage examples for org.apache.hadoop.fs UnsupportedFileSystemException UnsupportedFileSystemException

Introduction

In this page you can find the example usage for org.apache.hadoop.fs UnsupportedFileSystemException UnsupportedFileSystemException.

Prototype

public UnsupportedFileSystemException(final String message) 

Source Link

Document

Constructs exception with the specified detail message.

Usage

From source file:com.mellanox.r4h.DistributedFileSystem.java

License:Apache License

@Override
public FileChecksum getFileChecksum(Path f, final long length) throws IOException {
    statistics.incrementReadOps(1);//from w ww  . j a v a 2s  .  c  om
    Path absF = fixRelativePart(f);
    return new FileSystemLinkResolver<FileChecksum>() {
        @Override
        public FileChecksum doCall(final Path p) throws IOException, UnresolvedLinkException {
            return dfs.getFileChecksum(getPathName(p), length);
        }

        @Override
        public FileChecksum next(final FileSystem fs, final Path p) throws IOException {
            if (fs instanceof DistributedFileSystem) {
                return ((DistributedFileSystem) fs).getFileChecksum(p, length);
            } else {
                throw new UnsupportedFileSystemException(
                        "getFileChecksum(Path, long) is not supported by " + fs.getClass().getSimpleName());
            }
        }
    }.resolve(this, absF);
}