Skip to content

Conversation

@timmylicheng
Copy link
Contributor

What changes were proposed in this pull request?

Refactor SCMRatisServer conf to java based.
(Please fill in changes proposed in this fix)

What is the link to the Apache JIRA

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

(Please create an issue in ASF JIRA before opening a pull request,
and you need to set the title of the pull request which starts with
the corresponding JIRA issue number. (e.g. HDDS-XXXX. Fix a typo in YYY.)

Please replace this section with the link to the Apache JIRA)

How was this patch tested?

UT
(Please explain how this patch was tested. Ex: unit tests, manual tests)
(If this patch involves UI changes, please attach a screen-shot; otherwise, remove this)

//TODO enable Ratis group
scmRatisServer = SCMRatisServer.newSCMRatisServer(configuration
.getObject(SCMRatisServer.SCMRatisServerConfiguration.class),
this, scmNodeDetails, Collections.EMPTY_LIST,
Copy link
Contributor

Choose a reason for hiding this comment

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

Passing half created object (this) to SCMRatisServer constructor could cause subtle bugs that are tricky to get right. We should avoid it if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have made updates to have SCM use static method for createSCM and make constructor private. SCMRatisServer will be constructed after SCM is constructed.

/**
* Configuration used by SCM Ratis Server.
*/
@ConfigGroup(prefix = "ozone.scm.ratis")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to make these RATIS related configuration reusable among DN,SCM and OM?
Just different prefix like, ozone.om.ratis, ozone.scm.ratis, ozone.dn.ratis as prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea it looks like we currently have ozone.om.ratis, ozone.scm.ratis, hdds.datanode.ratis, dfs.container.ratis and even dfs.ratis.

If we decide to refactor all config into Java-based configuration, we shall consider refactoring all config to be like ozone.ratis.*

Then we can take a look at reusable configuration among OM, SCM and container. I create Jira to track: https://issues.apache.org/jira/browse/HDDS-3577

Copy link
Contributor

@xiaoyuyao xiaoyuyao left a comment

Choose a reason for hiding this comment

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

LGTM overall, just a few comments inline...

@timmylicheng timmylicheng removed the request for review from nandakumar131 May 14, 2020 02:45
@ChenSammi
Copy link
Contributor

+1, LGTM.

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