Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-3556 Refactor conf in SCMRatisServer to Java-based conf. #907

Merged
merged 3 commits into from May 20, 2020

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

@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
3 participants