Example usage for org.apache.hadoop.hdfs XAttrHelper getFirstXAttrValue

List of usage examples for org.apache.hadoop.hdfs XAttrHelper getFirstXAttrValue

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs XAttrHelper getFirstXAttrValue.

Prototype

public static byte[] getFirstXAttrValue(List<XAttr> xAttrs) 

Source Link

Document

Get value of first xattr from XAttr list

Usage

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

License:Apache License

public byte[] getXAttr(String src, String name) throws IOException {
    checkOpen();//from   ww  w.jav  a  2  s .  co  m
    TraceScope scope = getPathTraceScope("getXAttr", src);
    try {
        final List<XAttr> xAttrs = XAttrHelper.buildXAttrAsList(name);
        final List<XAttr> result = namenode.getXAttrs(src, xAttrs);
        return XAttrHelper.getFirstXAttrValue(result);
    } catch (RemoteException re) {
        throw re.unwrapRemoteException(AccessControlException.class, FileNotFoundException.class,
                UnresolvedPathException.class);
    } finally {
        scope.close();
    }
}