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

Support Etcd datasource #1018

Merged
merged 36 commits into from
Oct 10, 2019
Merged

Support Etcd datasource #1018

merged 36 commits into from
Oct 10, 2019

Conversation

linlinisme
Copy link
Collaborator

Describe what this PR does / why we need it

Function expand, Add DataSource integration for etcd.

Does this pull request fix one issue?

Fixes #30

Describe how you did it

Through Jetcd Client https://mvnrepository.com/artifact/io.etcd/jetcd-core
Make sentinel enable communication with etcd server.

Using EtcdConfig.java to integration Sentinel Config Load mechanism.
So that the Etcd Connect Properties can Config by properies file rather than
hard code in Code.

Through Jetcd watcher listening mechanism to implemnt rule dynamic update function.

Describe how to verify it

run test cases and demo

Special notes for reviews

The Jetcd need to run JDK8 env.

Lin.Liang and others added 30 commits May 9, 2019 14:54
using the LongAdder rather than AtomicInteger to Provides better performance
@sczyh30 sczyh30 added area/integrations Issues or PRs related to integrations with open-source components kind/feature Category issues or prs related to feature request. to-review To review labels Aug 26, 2019
@codecov-io
Copy link

codecov-io commented Aug 26, 2019

Codecov Report

Merging #1018 into master will decrease coverage by 0.29%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #1018     +/-   ##
===========================================
- Coverage     42.72%   42.43%   -0.3%     
- Complexity     1473     1476      +3     
===========================================
  Files           317      319      +2     
  Lines          9280     9346     +66     
  Branches       1267     1274      +7     
===========================================
+ Hits           3965     3966      +1     
- Misses         4825     4891     +66     
+ Partials        490      489      -1
Impacted Files Coverage Δ Complexity Δ
...a/csp/sentinel/datasource/etcd/EtcdDataSource.java 0% <0%> (ø) 0 <0> (?)
...ibaba/csp/sentinel/datasource/etcd/EtcdConfig.java 0% <0%> (ø) 0 <0> (?)
...otation/aspectj/AbstractSentinelAspectSupport.java 64.02% <0%> (-2.89%) 37% <0%> (ø)
...tinel/slots/block/flow/param/ParamFlowChecker.java 53.37% <0%> (-2.03%) 29% <0%> (ø)
...a/csp/sentinel/slots/statistic/base/LeapArray.java 72.27% <0%> (+1.98%) 35% <0%> (+1%) ⬆️
...m/alibaba/csp/sentinel/log/DateFileLogHandler.java 57.57% <0%> (+3.03%) 7% <0%> (+1%) ⬆️

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 820ff92...55d0b08. Read the comment docs.

* @author lianglin
* @since 1.7.0
*/
@Ignore(value = "Before run this test, you need to set up your etcd server.")
Copy link
Member

Choose a reason for hiding this comment

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

Is there any embedded etcd server for unit test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there is none, the java version embedded etcd server I don't found.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, I'll test this in local these days.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

any progress?

> Note: It needs to update JDK version to JDK8


We've also provided an example: [sentinel-demo-etcd-datasource].
Copy link
Member

Choose a reason for hiding this comment

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

We could add the expected URL for the demo :)

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 aeae6cf into alibaba:master Oct 10, 2019
@sczyh30
Copy link
Member

sczyh30 commented Oct 10, 2019

Thanks for contributing!

@sczyh30 sczyh30 removed the to-review To review label Oct 10, 2019
@sczyh30 sczyh30 added this to the 1.7.0 milestone Oct 10, 2019
hughpearse pushed a commit to hughpearse/Sentinel that referenced this pull request Jun 2, 2021
CST11021 pushed a commit to CST11021/Sentinel that referenced this pull request Nov 3, 2021
[RIP-65] Delete chinese period in CLITools.md file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integrations Issues or PRs related to integrations with open-source components kind/feature Category issues or prs related to feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] DataSource integration for etcd
3 participants