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 Curator Service Discovery and Spring Cloud ZooKeeper #2749

Merged
merged 16 commits into from Jun 3, 2020

Conversation

minwoox
Copy link
Member

@minwoox minwoox commented May 29, 2020

Motivation:
Related #2673.
It will be nice if we support Curator Service Discovery and Spring Cloud Zookeeper.

Modifications:

  • Add ZookeeperRegistrationSpec and ZookeeperDiscoverySpec to specify whether use legacy format or Curator compatible format.
    • (Breaking) You should specify ZookeeperRegistrationSpec When creating ZookeeperUpdatingListener.
    • (Breaking) You should specify ZookeeperDiscoverySpec When creating ZookeeperEndpointGroup.
  • (Breaking)
    • NodeValueCodec is gone.
      • You now have to use ZookeeperRegistrationSpec and ZookeeperDiscoverySpec to encode and decode.
      • ZooKeeperEndpointGroupBuilder.codec(...) and ZooKeeperUpatingListenerBuilder.codec(...) are gone as well.

Result:

  • You can now use Armeria client and server with Curator Service Discovery.

Todo:

  • Documentation

Motivation:
Related line#2673.
It will be nice if we support Curator-X-Discovery and Spring Cloud Zookeeper.

Modifications:
- Add `InstanceSpec` and `DiscoverySpec` to specify whether use default format or Curator compatible format.
- (Breaking)
  - `NodeValueCodec` is gone.
    - You now have to use `InstanceSpec` and `DiscoverySpec` to encode and decode.
    - `ZooKeeperEndpointGroupBuilder.codec(...)` and `ZooKeeperUpatingListenerBuilder.codec(...)` are gone as well.

Result:
- You can now use Armeria client and server with Curator-X-Discovery.
@codecov
Copy link

codecov bot commented May 29, 2020

Codecov Report

Merging #2749 into master will increase coverage by 0.00%.
The diff coverage is 60.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##             master    #2749    +/-   ##
==========================================
  Coverage     72.69%   72.69%            
- Complexity    11753    11802    +49     
==========================================
  Files          1032     1041     +9     
  Lines         45875    46004   +129     
  Branches       5720     5734    +14     
==========================================
+ Hits          33349    33444    +95     
- Misses         9594     9614    +20     
- Partials       2932     2946    +14     
Impacted Files Coverage Δ Complexity Δ
.../main/java/com/linecorp/armeria/server/Server.java 81.25% <40.00%> (+1.61%) 36.00 <7.00> (+1.00)
...a/internal/common/zookeeper/ZookeeperPathUtil.java 50.00% <50.00%> (ø) 1.00 <1.00> (?)
...meria/client/zookeeper/ZooKeeperEndpointGroup.java 61.90% <53.33%> (+1.03%) 10.00 <3.00> (+1.00)
...ia/server/zookeeper/ZooKeeperUpdatingListener.java 59.09% <53.70%> (-1.52%) 13.00 <11.00> (+8.00) ⬇️
...mon/zookeeper/AbstractCuratorFrameworkBuilder.java 50.00% <53.84%> (+2.50%) 11.00 <3.00> (+2.00)
.../client/zookeeper/CuratorDiscoverySpecBuilder.java 57.69% <57.69%> (ø) 9.00 <9.00> (?)
...armeria/client/zookeeper/CuratorDiscoverySpec.java 60.00% <60.00%> (ø) 3.00 <3.00> (?)
...lient/zookeeper/ZooKeeperEndpointGroupBuilder.java 47.05% <60.00%> (+2.05%) 3.00 <0.00> (ø)
...er/zookeeper/ZooKeeperUpdatingListenerBuilder.java 50.00% <60.00%> (+4.54%) 4.00 <1.00> (-1.00) ⬆️
...ernal/common/zookeeper/CuratorXNodeValueCodec.java 63.63% <63.63%> (ø) 3.00 <3.00> (?)
... and 40 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 8124b66...e06daaf. Read the comment docs.

@trustin
Copy link
Collaborator

trustin commented May 29, 2020

/cc @jonefeewang (who did the initial implementation of ZooKeeperEndpointGroup)

Copy link
Collaborator

@trustin trustin left a comment

Choose a reason for hiding this comment

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

  • DiscoverySpec -> ZookeeperDiscoverySpec
  • InstanceSpec -> ZookeeperRegistrationSpec

Should we remove Zookeeper for brevity? 🤔

@minwoox
Copy link
Member Author

minwoox commented May 29, 2020

DiscoverySpec -> ZookeeperDiscoverySpec
InstanceSpec -> ZookeeperRegistrationSpec

Thanks I will change to use RegistrationSpec.

Should we remove Zookeeper for brevity? 🤔

Isn't it okay not to use Zookeeper?
CuratorXRegistrationSpec, LegacyRegistrationSpec will be fine I guess.

Copy link
Collaborator

@trustin trustin left a comment

Choose a reason for hiding this comment

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

Excellent work, @minwoox 👍

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Nice work! @minwoox

@minwoox minwoox changed the title Support Curator-X-Discovery and Spring Cloud ZooKeeper Support Curator Service Discovery and Spring Cloud ZooKeeper Jun 3, 2020
@trustin trustin merged commit 7fe6daf into line:master Jun 3, 2020
@trustin
Copy link
Collaborator

trustin commented Jun 3, 2020

ServerSets is the last missing piece of ZK service discovery. Way to go, @minwoox 🎉

@minwoox minwoox deleted the x_discovery branch June 3, 2020 06:01
@minwoox
Copy link
Member Author

minwoox commented Jun 3, 2020

I'm on my way. 🚗

fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
Related: line#2673

Motivation:

It will be nice if we support Curator Service Discovery and Spring Cloud Zookeeper.

Modifications:
- Add `ZookeeperRegistrationSpec` and `ZookeeperDiscoverySpec` to specify whether use legacy format or Curator compatible format.
  - (Breaking) You should specify `ZookeeperRegistrationSpec` When creating `ZookeeperUpdatingListener`.
  - (Breaking) You should specify `ZookeeperDiscoverySpec` When creating `ZookeeperEndpointGroup`.
- (Breaking)
  - `NodeValueCodec` is gone.
    - You now have to use `ZookeeperRegistrationSpec` and `ZookeeperDiscoverySpec` to encode and decode.
    - `ZooKeeperEndpointGroupBuilder.codec(...)` and `ZooKeeperUpatingListenerBuilder.codec(...)` are gone as well.

Result:
- You can now use Armeria client and server with Curator Service Discovery.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants