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

Add a ApiCommandHandler which fetch all registered CommandHandlers so that user can get all available CommandHandlers by request /api #491

Merged
merged 9 commits into from
Mar 1, 2019

Conversation

all4you
Copy link
Contributor

@all4you all4you commented Feb 18, 2019

Describe what this PR does / why we need it

Add a ApiCommandHandler which fetch all registered CommandHandlers so that user can get all available CommandHandlers by request /api

Does this pull request fix one issue?

No. Only add new features

Describe how you did it

Create a new CommandHandler called ApiCommandHandler

Describe how to verify it

  1. Run Application in sentinel-demo-command-handler module
  2. Request 127.0.0.1:8080/init to init the Sentinel and CommandCenter
  3. Request 127.0.0.1:8719/api to get all the available CommandHandlers

@codecov-io
Copy link

codecov-io commented Feb 18, 2019

Codecov Report

Merging #491 into master will increase coverage by 0.53%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #491      +/-   ##
============================================
+ Coverage     37.66%   38.19%   +0.53%     
- Complexity     1099     1114      +15     
============================================
  Files           259      259              
  Lines          8159     8173      +14     
  Branches       1111     1113       +2     
============================================
+ Hits           3073     3122      +49     
+ Misses         4690     4643      -47     
- Partials        396      408      +12
Impacted Files Coverage Δ Complexity Δ
...mmand/handler/FetchClusterClientConfigHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
.../command/handler/FetchTopParamsCommandHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...mmand/handler/ModifyServerNamespaceSetHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ler/ModifyClusterParamFlowRulesCommandHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...mand/handler/FetchClusterMetricCommandHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...mmand/handler/FetchClusterServerConfigHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...d/handler/FetchClusterFlowRulesCommandHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...mand/handler/ModifyClusterClientConfigHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...nd/handler/ModifyParamFlowRulesCommandHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ler/ModifyClusterServerTransportConfigHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b260a9...71dae31. Read the comment docs.

@sczyh30 sczyh30 added the to-review To review label Feb 18, 2019
Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

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

And please reformat your code using the Alibaba P3C plugin.

@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label Feb 22, 2019
…andlers so that user can get all available CommandHandlers by request /api
Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

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

Maybe it's better to add an example to show how to register a customized CommandHandler via SPI in sentinel-demo-command-handler as it's a demo module.

@all4you
Copy link
Contributor Author

all4you commented Feb 27, 2019

Maybe it's better to add an example to show how to register a customized CommandHandler via SPI in sentinel-demo-command-handler as it's a demo module.

done!

Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

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

LGTM

@sczyh30 sczyh30 merged commit 59d923e into alibaba:master Mar 1, 2019
@sczyh30
Copy link
Member

sczyh30 commented Mar 1, 2019

Nice, thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants