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

Added EurekaVipAddressRoundRobinWithAzAffinityService to the eureka s… #77

Merged

Conversation

cjha
Copy link

@cjha cjha commented Nov 3, 2017

…ub-module. This service will round-robin requests to instances in the same availability zone as the current server. If there are no instances in the current availability zone, it will round-robin instances in all availability zones. Routing requests this way has the advantage of lower response times and lower data transfer costs.

@codecov-io
Copy link

codecov-io commented Nov 3, 2017

Codecov Report

Merging #77 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #77      +/-   ##
============================================
+ Coverage     90.76%   90.83%   +0.07%     
- Complexity     2035     2042       +7     
============================================
  Files           143      145       +2     
  Lines          5953     5969      +16     
  Branches        782      784       +2     
============================================
+ Hits           5403     5422      +19     
+ Misses          370      367       -3     
  Partials        180      180
Impacted Files Coverage Δ Complexity Δ
...ration/eureka/helpers/EurekaVipAddressService.java 100% <100%> (ø) 15 <15> (?)
...rekaVipAddressRoundRobinWithAzAffinityService.java 100% <100%> (ø) 6 <6> (?)
...eka/helpers/EurekaVipAddressRoundRobinService.java 100% <100%> (+9.37%) 4 <0> (-14) ⬇️
...ient/asynchttp/netty/StreamingAsyncHttpClient.java 74.71% <0%> (-0.46%) 43% <0%> (-1%)
...r/handler/ProxyRouterEndpointExecutionHandler.java 61.19% <0%> (+0.31%) 26% <0%> (ø) ⬇️
...mpipeline/DownstreamIdleChannelTimeoutHandler.java 90% <0%> (+5%) 5% <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 868e058...e861328. Read the comment docs.

* @return The *next* active {@link InstanceInfo} that should be called for the given VIP name (using a round-robin
* strategy with current availability zone affinity), or an empty Optional if no active instances were found.
*/
public Optional<InstanceInfo> getActiveInstanceInfoForVipAddressBlocking(String vipName) {
Copy link
Member

Choose a reason for hiding this comment

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

Missing @Override here and elsewhere I think?

Copy link
Author

Choose a reason for hiding this comment

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

Yup, I'll fix it.

import java.util.function.Supplier;
import java.util.stream.Collectors;
/**
* Service that uses the Eureka discovery client to provide all the instances associated with a VIP name ({@link
Copy link
Member

Choose a reason for hiding this comment

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

Adjust the javadocs to point out why this is different than the other impl (and maybe adjust the other impl's javadocs to point here if you need AZ affinity).

Copy link
Author

Choose a reason for hiding this comment

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

I'll clarify it.

* <p/>
* TODO: See if Netflix has a newer version of the Eureka client that allows for async nonblocking retrieval via futures.
*/
List<InstanceInfo> getActiveInstanceInfosForVipAddressBlocking(String vipName) {
Copy link
Member

Choose a reason for hiding this comment

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

I think the public scope on the methods here has been lost.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for catching that. I had initially set this as an interface but switched it to an abstract class and forgot to put back in the public keywords

@cjha cjha force-pushed the add-eureka-az-affinity-round-robin-service branch from 67b9756 to a7ccb19 Compare November 9, 2017 21:47
@cjha
Copy link
Author

cjha commented Nov 13, 2017

I uploaded a new commit addressing the comments.

…ub-module. This service will round-robin requests to instances in the same availability zone as the current server. If there are no instances in the current availability zone, it will round-robin instances in all availability zones. Routing requests this way has the advantage of lower response times and lower data transfer costs.
@cjha cjha force-pushed the add-eureka-az-affinity-round-robin-service branch from a7ccb19 to e861328 Compare November 21, 2017 17:00
@nicmunroe
Copy link
Member

Great, thank you @cjha this is a really good feature!

@nicmunroe nicmunroe merged commit 4285618 into Nike-Inc:master Nov 27, 2017
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.

3 participants