[
https://issues.apache.org/jira/browse/HDDS-755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16668309#comment-16668309
]
Yiqun Lin commented on HDDS-755:
--------------------------------
Hi [~nandakumar131], I glanced your patch. The most change focus on the
renaming. Only three comments from me:
* Compared with original logic, we introduce the new state {{QUASI_CLOSED}},
is intended change?
* Can we reuse State definition like before? And not define the same State
both in ContainerReplicaProto and ContainerDataProto.
* I think following change will break current logic. Explicitly saying, I mean
we won't throw error for the case of default case after this change. Maybe we
should add the state check.
{code:java}
- String state = (String) nodes.get(OzoneConsts.STATE);
- switch (state) {
- case "OPEN":
- kvData.setState(ContainerProtos.ContainerLifeCycleState.OPEN);
- break;
- case "CLOSING":
- kvData.setState(ContainerProtos.ContainerLifeCycleState.CLOSING);
- break;
- case "CLOSED":
- kvData.setState(ContainerProtos.ContainerLifeCycleState.CLOSED);
- break;
- default:
- throw new IllegalStateException("Unexpected " +
- "ContainerLifeCycleState " + state + " for the containerId " +
- nodes.get(OzoneConsts.CONTAINER_ID));
- }
+ kvData.setState(ContainerProtos.ContainerDataProto.State.valueOf(
+ nodes.get(OzoneConsts.STATE).toString()));
{code}
> ContainerInfo and ContainerReplica protobuf changes
> ---------------------------------------------------
>
> Key: HDDS-755
> URL: https://issues.apache.org/jira/browse/HDDS-755
> Project: Hadoop Distributed Data Store
> Issue Type: Improvement
> Components: Ozone Datanode, SCM
> Reporter: Nanda kumar
> Assignee: Nanda kumar
> Priority: Major
> Attachments: HDDS-755.000.patch
>
>
> We have different classes that maintain container related information, we can
> consolidate them so that it is easy to read the code.
> Proposal:
> In SCM: will be used in communication between SCM and Client, also used for
> storing in db
> * ContainerInfoProto
> * ContainerInfo
>
> In Datanode: Used in communication between Datanode and SCM
> * ContainerReplicaProto
> * ContainerReplica
>
> In Datanode: Used in communication between Datanode and Client
> * ContainerDataProto
> * ContainerData
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]