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

Xiaoyu Yao commented on HDFS-11001:
-----------------------------------

Thanks [~anu] for working on this. The patch looks good overall, I just have a 
few questions: 
*CommandQueue.java*
1. Have you considered ReaderWriterLock to reduce contentions between 
getCommand(Read) and addCommand(Write)?

2. Uninitalized nullList, I would suggest us returning an empty list with 
flight-weight pattern to simplify the caller's logic without null checking. 
Also, running foreach with null list throws NPE.
{code}  private final List<SCMCommand> nullList; {code}
=>
{code}  private static final List<SCMCommand> emptyList = new LinkList<>(); 
{code}

*RegisteredCommand.java*
3. NIT: Can we use the Builder to implement RegisteredCommand#getFromProtobuf() 
for 
consistency?

*SCMNodeManager.java*
4. I can't find any caller of SCMNodeManager#register from the production code. 
How is datanode registered with NodeManager now that the 
{{registerNode(datanodeID);}} call is removed from 
SCMNodeManager#handleHeartbeat()

*StorageContainerDatanodeProtocol.proto*
5. Can we use CamelCase instead of '_' for the enum in protoc?  
{code}
  enum ErrorCode {
    success = 1;
    error_node_already_registered = 2;
    error_node_not_permitted = 3;
{code}

> Ozone:SCM: Add support for registerNode in SCM
> ----------------------------------------------
>
>                 Key: HDFS-11001
>                 URL: https://issues.apache.org/jira/browse/HDFS-11001
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone
>    Affects Versions: HDFS-7240
>            Reporter: Anu Engineer
>            Assignee: Anu Engineer
>             Fix For: HDFS-7240
>
>         Attachments: HDFS-11001-HDFS-7240.001.patch, 
> HDFS-11001-HDFS-7240.002.patch
>
>
> Adds support for a datanode registration. Right now SCM relies on Namenode 
> for the datanode registration. With this change we will be able to run SCM 
> independently if needed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to