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

Xiaoyu Yao edited comment on HDDS-238 at 7/11/18 4:35 PM:
----------------------------------------------------------

Thanks [~msingh] for working on this. The patch v2 looks good to me. I just 
have a few comments below:

 

ContainerStateMap.java

Line 147: can we wrap the logic around containerState->PiplelineState in a 
helper function for better reuse and future changes?

 

PipelineManager.java

Line 139: should we update the {color:#1948a6}node2PipelineMap in 
{color}{color:#000000}removePipeline() as well?{color}

 

Node2PipelineMap.java

Line 109: this can be simplified with Java8 computeIfAbsent like below without 
helper function isKnownDatanode()

 
{code:java}
dn2PipelineMap.computeIfAbsent(dnId,k->Collections.synchronizedSet(new 
{color}HashSet<>())).add(pipeline);

{code}
 

Line 87: NIT: "pipeline name to open container mappings"

Line 122: should we return an immutable collection for getDn2PipelineMap?


was (Author: xyao):
Thanks [~msingh] for working on this. The patch v2 looks good to me. I just 
have a few comments below:

 

ContainerStateMap.java

Line 147: can we wrap the logic around containerState->PiplelineState in a 
helper function for better reuse and future changes?

 

PipelineManager.java

Line 139: should we update the {color:#1948a6}node2PipelineMap in 
{color}{color:#000000}removePipeline() as well?{color}

 

Node2PipelineMap.java

Line 109: this can be simplified with Java8 computeIfAbsent like below without 
helper function isKnownDatanode()

 

{code}

{color:#1948a6}dn2PipelineMap{color}{color:#000000}.computeIfAbsent(dnId,k->Collections.{color}{color:#000000}synchronizedSet{color}{color:#000000}({color}{color:#000080}new
 {color}HashSet<>())).add(pipeline);

{code}

 

Line 87: NIT: "pipeline name to open container mappings"

Line 122: should we return an immutable collection for getDn2PipelineMap?

> Add Node2Pipeline Map in SCM to track ratis/standalone pipelines.
> -----------------------------------------------------------------
>
>                 Key: HDDS-238
>                 URL: https://issues.apache.org/jira/browse/HDDS-238
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>          Components: SCM
>    Affects Versions: 0.2.1
>            Reporter: Mukul Kumar Singh
>            Assignee: Mukul Kumar Singh
>            Priority: Major
>             Fix For: 0.2.1
>
>         Attachments: HDDS-238.001.patch, HDDS-238.002.patch
>
>
> This jira proposes to add a Node2Pipeline map which can be used to during 
> pipeline failure to identify a pipeline for a corresponding failed datanode.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to