-
Notifications
You must be signed in to change notification settings - Fork 34
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
Added EurekaVipAddressRoundRobinWithAzAffinityService to the eureka s… #77
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
* @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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
67b9756
to
a7ccb19
Compare
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.
a7ccb19
to
e861328
Compare
Great, thank you @cjha this is a really good feature! |
…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.