[ 
https://issues.apache.org/jira/browse/HDFS-543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747551#action_12747551
 ] 

Suresh Srinivas commented on HDFS-543:
--------------------------------------

# BlockReceiver.java - when {{clientName}} is empty, the block being written to 
is considered temporary. Should it be more explicit that this? Can a real 
client set its name to empty also?
# BlockReceiver.java - for client append the current code checks for 
{{finalized}} and {{isRecovery}} to be true. Is there a need to use 
{{isRecovery}}? Also what happens in the case {{finalized}} is true and 
{{isRecovery}} false?
# ReplicaBeingWritten.java has an unused import {{List}}
# {{ReplicaInPipeline.stopAndWaitWriter}} - prefer method name to be 
{{stopWriter}}
# FSDataset.updateBlock - we could use a utility class to interrupt thread that 
could be used for {{ReplicaInPipeline.stopAndWaitWriter}}. If not at least we 
should have similar checks as in {{stopAndWaitWriter}} (such as if it is same 
as current thread, if the thread is alive).
# FSDataset.tryUpdateBlock - should the check for {{thread.isAlive()}} moved to 
{{ReplicaInPipeline.getWriter()}}?
# nit: {{FSDataset.tryUpdateBlock}} - no need for else where write is set to 
null
# FSDataset.append - when renaming metadata file succeeds and renaming block 
file fails, should we rename the metadata file back to old file?
# FSDataset.append - creating RBW file and metadata file from the existing 
finalized block, should this functionality to move to ReplicaInfo as a method? 
It could be done by having a method {{static ReplicaBeingWritten 
FinalizedReplica.createRbwFile(ReplicaInfo info))}}?
# For all new debug logs, add check for isDebugEnabled.

I will review the tests in the next version of the patch




> Break FSDatasetInterface#writeToBlock() into writeToTemporary, writeToRBW, 
> and append
> -------------------------------------------------------------------------------------
>
>                 Key: HDFS-543
>                 URL: https://issues.apache.org/jira/browse/HDFS-543
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: data-node
>    Affects Versions: Append Branch
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: Append Branch
>
>         Attachments: writeToReplica.patch
>
>
> FSDatasetInterface#writeToBlock() currently allows to create/recover a 
> temporary replica, create/recover a RBW replica, or append to a replica. The 
> implementation of the method in FSDataset is very complicated and error 
> prone. I'd like to break this method into 3:
> 1. writeToTemporary allows to create a Temporary replica or recover from a 
> packet error for a Tempoary replica;
> 2. writeToRBW allows to create a RBW replica or recover from a packet error 
> for a RBW replica;
> 3. append allows to append to an existing Finalized replica.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to