[
https://issues.apache.org/jira/browse/HDFS-6301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13985924#comment-13985924
]
Charles Lamb commented on HDFS-6301:
------------------------------------
Hi Yi,
In general this looks fine.
I noticed that you never say anywhere whether namespaces and xattr names are
case sensitive or insensitive. That should be spelled out somewhere in the
javadoc.
FSEditLog.java:
s/src =src/src = src/
"final" could be added to the decl ofSetXAttrsOp.
FSEditLogOp.java:
XAttrsEditLogUtil: when would an xattr not have a name? I see why
HAS_VALUE_OFFSET is necessary (some xattrs are name only), but why do you need
a flag for whether a name is present? Don't all xattrs have at least a name?
In general things like boolean hasName could benefit from final decls.
if (this.opCode == OP_ADD) {
AclEditLogUtil.write(aclEntries, out);
+ XAttrsEditLogUtil.write(xAttrs, out);
FSImageSerialization.writeString(clientName,out);
FSImageSerialization.writeString(clientMachine,out);
// write clientId and callId
@@ -542,6 +617,7 @@
// clientname, clientMachine and block locations of last block.
if (this.opCode == OP_ADD) {
aclEntries = AclEditLogUtil.read(in, logVersion);
+ xAttrs = XAttrsEditLogUtil.read(in, logVersion);
this.clientName = FSImageSerialization.readString(in);
this.clientMachine = FSImageSerialization.readString(in);
// read clientId and callId
Is it possible for xAttrs (and aclEntries for that matter) to be uninit'd if
opCode != OP_ADD? I'm looking at this.clientName and this.clientMachine and
wondering why there isn't an equivalent for xAttrs (and aclEntries) in the else?
void readFields(DataInputStream in, int logVersion) throws IOException {
XAttrEditLogProto p = XAttrEditLogProto.parseDelimitedFrom(
(DataInputStream)in);
I don't understand why you need the (DataInputStream) cast above. Isn't it
already known to be a DIS from the formal arg decl?
TestFSImageWithXAttr.java:
There's an extra newline just before the last } closing the class def.
> NameNode: persist XAttrs in fsimage and record XAttrs modifications to edit
> log.
> --------------------------------------------------------------------------------
>
> Key: HDFS-6301
> URL: https://issues.apache.org/jira/browse/HDFS-6301
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: namenode
> Affects Versions: HDFS XAttrs (HDFS-2006)
> Reporter: Yi Liu
> Assignee: Yi Liu
> Fix For: HDFS XAttrs (HDFS-2006)
>
> Attachments: HDFS-6301.patch
>
>
> Store XAttrs in fsimage so that XAttrs are retained across NameNode restarts.
> Implement a new edit log opcode, {{OP_SET_XATTRS}}.
--
This message was sent by Atlassian JIRA
(v6.2#6252)