Skip to content

Conversation

@GlenGeng-awx
Copy link
Contributor

What changes were proposed in this pull request?

Simplify SCMHAManager and SCMRatisServer with RaftServer.Division

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-4575

How was this patch tested?

CI

@Override
public RaftGroupId getRaftGroupId() {
public RaftServer.Division getDivision() {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we allow Division to be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't allow null Divison in real env.

.setStateMachine(new SCMStateMachine())
.build();

this.division = server.getDivision(haGrpBuilder.getRaftGroupId());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way to guarantee division is not null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You won't get a null, instead, the call will throw a GroupMismatchException in this situation.

@ChenSammi
Copy link
Contributor

+1

@ChenSammi ChenSammi merged commit 7f5e522 into apache:HDDS-2823 Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants