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

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

Introduction

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

Prototype

FileSystemLinkResolver

Source Link

Usage

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

License:Apache License

/**
 * {@inheritDoc}//  ww w.  j  a va2  s .c  o  m
 */
@Override
public void removeAcl(Path path) throws IOException {
    final Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {
        @Override
        public Void doCall(final Path p) throws IOException {
            dfs.removeAcl(getPathName(p));
            return null;
        }

        @Override
        public Void next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException {
            fs.removeAcl(p);
            return null;
        }
    }.resolve(this, absF);
}

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

License:Apache License

/**
 * {@inheritDoc}//  w  w  w  . j  ava  2  s  .c o m
 */
@Override
public void setAcl(Path path, final List<AclEntry> aclSpec) throws IOException {
    Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {
        @Override
        public Void doCall(final Path p) throws IOException {
            dfs.setAcl(getPathName(p), aclSpec);
            return null;
        }

        @Override
        public Void next(final FileSystem fs, final Path p) throws IOException {
            fs.setAcl(p, aclSpec);
            return null;
        }
    }.resolve(this, absF);
}

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

License:Apache License

/**
 * {@inheritDoc}/*from  www .  j  a va  2 s . c  o  m*/
 */
@Override
public AclStatus getAclStatus(Path path) throws IOException {
    final Path absF = fixRelativePart(path);
    return new FileSystemLinkResolver<AclStatus>() {
        @Override
        public AclStatus doCall(final Path p) throws IOException {
            return dfs.getAclStatus(getPathName(p));
        }

        @Override
        public AclStatus next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException {
            return fs.getAclStatus(p);
        }
    }.resolve(this, absF);
}

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

License:Apache License

@Override
public void setXAttr(Path path, final String name, final byte[] value, final EnumSet<XAttrSetFlag> flag)
        throws IOException {
    Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {

        @Override//  w  ww. j  ava 2  s  .  c om
        public Void doCall(final Path p) throws IOException {
            dfs.setXAttr(getPathName(p), name, value, flag);
            return null;
        }

        @Override
        public Void next(final FileSystem fs, final Path p) throws IOException {
            fs.setXAttr(p, name, value, flag);
            return null;
        }
    }.resolve(this, absF);
}

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

License:Apache License

@Override
public byte[] getXAttr(Path path, final String name) throws IOException {
    final Path absF = fixRelativePart(path);
    return new FileSystemLinkResolver<byte[]>() {
        @Override// www.  j  a  va2 s .com
        public byte[] doCall(final Path p) throws IOException {
            return dfs.getXAttr(getPathName(p), name);
        }

        @Override
        public byte[] next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException {
            return fs.getXAttr(p, name);
        }
    }.resolve(this, absF);
}

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

License:Apache License

@Override
public Map<String, byte[]> getXAttrs(Path path) throws IOException {
    final Path absF = fixRelativePart(path);
    return new FileSystemLinkResolver<Map<String, byte[]>>() {
        @Override//from w  ww  . j a  v a  2 s  .com
        public Map<String, byte[]> doCall(final Path p) throws IOException {
            return dfs.getXAttrs(getPathName(p));
        }

        @Override
        public Map<String, byte[]> next(final FileSystem fs, final Path p)
                throws IOException, UnresolvedLinkException {
            return fs.getXAttrs(p);
        }
    }.resolve(this, absF);
}

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

License:Apache License

@Override
public Map<String, byte[]> getXAttrs(Path path, final List<String> names) throws IOException {
    final Path absF = fixRelativePart(path);
    return new FileSystemLinkResolver<Map<String, byte[]>>() {
        @Override/* ww w.j a  v a  2  s . c o m*/
        public Map<String, byte[]> doCall(final Path p) throws IOException {
            return dfs.getXAttrs(getPathName(p), names);
        }

        @Override
        public Map<String, byte[]> next(final FileSystem fs, final Path p)
                throws IOException, UnresolvedLinkException {
            return fs.getXAttrs(p, names);
        }
    }.resolve(this, absF);
}

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

License:Apache License

@Override
public List<String> listXAttrs(Path path) throws IOException {
    final Path absF = fixRelativePart(path);
    return new FileSystemLinkResolver<List<String>>() {
        @Override/*from w w  w.  j  a  v  a  2 s  . c o  m*/
        public List<String> doCall(final Path p) throws IOException {
            return dfs.listXAttrs(getPathName(p));
        }

        @Override
        public List<String> next(final FileSystem fs, final Path p)
                throws IOException, UnresolvedLinkException {
            return fs.listXAttrs(p);
        }
    }.resolve(this, absF);
}

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

License:Apache License

@Override
public void removeXAttr(Path path, final String name) throws IOException {
    Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {
        @Override/*from ww w .  j  a v  a 2 s.  c o m*/
        public Void doCall(final Path p) throws IOException {
            dfs.removeXAttr(getPathName(p), name);
            return null;
        }

        @Override
        public Void next(final FileSystem fs, final Path p) throws IOException {
            fs.removeXAttr(p, name);
            return null;
        }
    }.resolve(this, absF);
}

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

License:Apache License

@Override
public void access(Path path, final FsAction mode) throws IOException {
    final Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {
        @Override//from   ww w  .j a  va  2 s. c o  m
        public Void doCall(final Path p) throws IOException {
            dfs.checkAccess(getPathName(p), mode);
            return null;
        }

        @Override
        public Void next(final FileSystem fs, final Path p) throws IOException {
            fs.access(p, mode);
            return null;
        }
    }.resolve(this, absF);
}