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

Nanda kumar commented on HDDS-228:
----------------------------------

Thanks [~ajayydv] for updating the patch.

{{ContainerStateManager#getContainerReplicas}} javadoc is incorrect.

{{ContainerStateMap#getContainerReplicas}} javadoc is incorrect

{{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}}.

{{ContainerStateMap#removeContainerReplica}}: There are three possible cases 
that has to be handled here.

1. Container exists in {{contReplicaMap}} and it has an entry for the given 
datanode in its set.
2. Container exists in {{contReplicaMap}} but it doesn't have the datanode in 
its set.
3. Container doesn't exist in {{contReplicaMap}}.

Current behavior:
For the first call will return true.
For the second and third case, the call will false.

We can change the behavior to:
For the first case, the call will return true.
For the second case, the call will return false.
For the third case, the call should throw Exception.

This way, we will consistently throw an exception in all the related calls, if 
we don't have the container in our map.

> 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
>
>
> 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