[
https://issues.apache.org/jira/browse/HADOOP-10520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13974730#comment-13974730
]
Alejandro Abdelnur commented on HADOOP-10520:
---------------------------------------------
XAttr.java:
* coding style, if blocks always should be within {} even single lines.
* It seems a bit strange that XAttr equals() and hashCode() methods are based
on the namespace and name only. I wonder it shouldn’t be more appropriate to
have an XAttrName class with Namespace and name instead. Or, as in the Linux C
API, use a String and simply prefix the name with the namespace.
FileSystem.java:
* With the current API you cannot achieve the CREATE, REPLACE, ANY semantics of
setxattr()
* Do we need methods for setting/removing to handle multiple attributes? IMO
this will complicate failures.
* How about something simpler, a bit closer to the C API:
{code}
enum XAttrSetMode { CREATE, REPLACE, ANY }
// name must be prefixed with user/trusted/security/system
void setXAttribute(Path path, String name, byte[] value, XAttrSetMode mode);
void removeXAttribute(Path path, String name);
byte[] getXAttribute(Path path, String name);
Map<String, byte[]> getXAttributes(Path path);
{code}
Or the above API using a XAttributeName class:
{code}
enum XAttrNamespace { USER, TRUSTED, SECURITY, SYSTEM }
class XAttrName { namespace, name }
{code}
> Extended attributes definition and FileSystem APIs for extended attributes.
> ---------------------------------------------------------------------------
>
> Key: HADOOP-10520
> URL: https://issues.apache.org/jira/browse/HADOOP-10520
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs
> Reporter: Yi Liu
> Assignee: Yi Liu
> Fix For: 3.0.0
>
> Attachments: HADOOP-10520.patch
>
>
> This JIRA defines XAttr (Extended Attribute), it consists of a name and
> associated data, and 4 namespaces are defined: user, trusted, security and
> system. FileSystem APIs for XAttr include setXAttrs, getXAttrs, removeXAttrs
> and so on. For more information, please refer to HDFS-2006.
--
This message was sent by Atlassian JIRA
(v6.2#6252)