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

Ajay Kumar edited comment on HDDS-228 at 7/10/18 9:59 PM:
----------------------------------------------------------

[~nandakumar131] thanks for review. Addressed most of you suggestions, except 
one.
{quote}ContainerStateManager#getContainerReplicas javadoc is incorrect.
ContainerStateMap#getContainerReplicas javadoc is incorrect
ContainerStateMap#removeContainerReplica: 
For the third case, the call should throw Exception.{quote}
Done
{quote}ContainerStateMap#addContainerReplica: If the container is not already 
present, this method adds the container to the contReplicaMap and updates the 
set with the given datanode. It would be easy to detect inconsistency if we 
throw Exception in case if the container is not present in the contReplicaMap. 
A container should be added to the contReplicaMap when addContainer is called. 
This way we can maintain consistency between containerMap and 
contReplicaMap.{quote}
IMO adding a new replica even if one doesn't exist do not violate any 
condition. So we should add it silently. Also there is little value in adding 
open containers to replicaMap as there replication will be handled by RATIS. So 
only container report handler should add or remove entries from this instead of 
adding it via addContainer. Let me know if you still think throwing exception 
is right way there.



was (Author: ajayydv):
[~nandakumar131] thanks for review. Addressed most of you suggestions, except 
one.
{quote}ContainerStateManager#getContainerReplicas javadoc is incorrect.
ContainerStateMap#getContainerReplicas javadoc is incorrect
ContainerStateMap#removeContainerReplica: 
For the third case, the call should throw Exception.{quote}
Done
{quote}ContainerStateMap#addContainerReplica: If the container is not already 
present, this method adds the container to the contReplicaMap and updates the 
set with the given datanode. It would be easy to detect inconsistency if we 
throw Exception in case if the container is not present in the contReplicaMap. 
A container should be added to the contReplicaMap when addContainer is called. 
This way we can maintain consistency between containerMap and 
contReplicaMap.{quote}
IMO adding a new replica even if one doesn't exist do not violate any 
condition. So we should add it silently. Also there is little value in adding 
open containers to replicaMap as there replication will be handled by RATIS. So 
only contrainer report handler should add or remove entries from this instead 
of adding it via addContainer.


> Add the ReplicaMaps to ContainerStateManager
> --------------------------------------------
>
>                 Key: HDDS-228
>                 URL: https://issues.apache.org/jira/browse/HDDS-228
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>          Components: SCM
>            Reporter: Anu Engineer
>            Assignee: Ajay Kumar
>            Priority: Major
>             Fix For: 0.2.1
>
>         Attachments: HDDS-228.00.patch, HDDS-228.01.patch, HDDS-228.02.patch, 
> HDDS-228.03.patch, HDDS-228.04.patch
>
>
> We need to maintain a list of data nodes in the SCM that tells us where a 
> container is located. This created from the container reports.  The HDDS-175 
> refactored the class to make this separation easy and this JIRA is a followup 
> that keeps a hash table to track this information.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to