Skip to content

Add HelixRestObjectNameFactory to create namespaced ObjectName#1357

Merged
huizhilu merged 1 commit intoapache:masterfrom
huizhilu:objectNameFactory
Sep 22, 2020
Merged

Add HelixRestObjectNameFactory to create namespaced ObjectName#1357
huizhilu merged 1 commit intoapache:masterfrom
huizhilu:objectNameFactory

Conversation

@huizhilu
Copy link
Contributor

@huizhilu huizhilu commented Sep 10, 2020

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

Resolves #1356

Description

  • Here are some details about my PR, including screenshots of any UI changes:

We need helix rest service metrics for each namespace. To achieve this, the namespace info needs to be contained in the MBean's object name, eg: domain:name=getClusters,namespace=myNamespace,type=counters. But DropWizard's default ObjectNameFactory doesn't have the namespace parameter.

This PR implements a custom object name factory and add the namespace to object name.

Tests

  • The following tests are written for this issue:

TestHelixRestObjectNameFactory

  • The following is the result of the "mvn test" command on the appropriate module:
[INFO] Tests run: 167, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 43.615 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 167, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  49.751 s
[INFO] Finished at: 2020-09-11T00:08:46-07:00
[INFO] ------------------------------------------------------------------------

Final run:

[INFO] Tests run: 168, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 39.041 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 168, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  45.121 s
[INFO] Finished at: 2020-09-21T18:16:05-07:00
[INFO] ------------------------------------------------------------------------

Documentation (Optional)

  • In case of new functionality, my PR adds documentation in the following wiki page:

(Link the GitHub wiki you added)

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

@huizhilu huizhilu self-assigned this Sep 10, 2020
@huizhilu huizhilu force-pushed the objectNameFactory branch 3 times, most recently from c498cbb to 5343c88 Compare September 10, 2020 17:42
@huizhilu huizhilu closed this Sep 17, 2020
@huizhilu huizhilu reopened this Sep 19, 2020
@huizhilu huizhilu force-pushed the objectNameFactory branch 3 times, most recently from 2795799 to 4510e75 Compare September 19, 2020 00:27
Copy link
Contributor Author

@huizhilu huizhilu left a comment

Choose a reason for hiding this comment

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

@jiajunwang Thanks for the review and discussion. I've updated the lib version. Also ELR the libs to our internal artifactory to be ready.

@huizhilu huizhilu force-pushed the objectNameFactory branch 2 times, most recently from dcc27a7 to 1b40fc5 Compare September 19, 2020 01:36
Copy link
Contributor

@junkaixue junkaixue left a comment

Choose a reason for hiding this comment

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

Left one question. Overall, LGTM. But please address other reviewers concerns.

@huizhilu
Copy link
Contributor Author

Thank @dasahcc @jiajunwang for the review!

This PR is ready to be merged, approved by @dasahcc @jiajunwang

@huizhilu huizhilu merged commit 213a839 into apache:master Sep 22, 2020
@huizhilu huizhilu deleted the objectNameFactory branch September 22, 2020 01:18
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.

Create namespaced ObjectName

3 participants