[ https://issues.apache.org/jira/browse/HDFS-2149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070873#comment-13070873 ]
Todd Lipcon commented on HDFS-2149: ----------------------------------- - In all of the getInstance methods, you're doing FooOp.class.cast(...). Why not use the normal casting syntax (FooOp)...? - in logOpen and logCloseFile, you should use the subclass types rather than AddCloseOp. The fact that they both inherit from AddCloseOp should be an internal detail of FSEditLogOp - Indentation error: {code} EnumMap<FSEditLogOpCodes, FSEditLogOp> instances = new EnumMap<FSEditLogOpCodes, FSEditLogOp>(FSEditLogOpCodes.class); {code} - I don't like the assymetry that Op.writeFields() writes the opcode, whereas readFields() doesn't (since it's read in readOp()). I think this could be fixed by pulling it up into the EditLogOutputStream {{write}} functions. Or, if you want it to all be in FsEditLogOp, add a new static function there called {{writeOp(FSEditLogOp, DataOutputStream)}} or something? > Move EditLogOp serialisation and deserialation into one place > ------------------------------------------------------------- > > Key: HDFS-2149 > URL: https://issues.apache.org/jira/browse/HDFS-2149 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Ivan Kelly > Assignee: Ivan Kelly > Fix For: 0.23.0 > > Attachments: HDFS-2149.diff, HDFS-2149.diff, HDFS-2149.diff > > > On trunk serialisation of editlog ops is in FSEditLog#log* and > deserialisation is in FSEditLogOp.*Op . This improvement is to move the > serialisation code into one place, i.e under FSEditLogOp.*Op. > This is part of HDFS-1580. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira