public final class StickyEndpointStrategy extends AbstractEndpointStrategy
EndpointStrategy
that will always return the same endpoint once it's picked
until the endpoint is no longer valid, then it'll pick another one.
If multiple threads calling the pick()
} method at the same time, it's possible
that they get different result if there was no endpoint being picked yet or the previously
picked endpoint is no longer value. The pick will be eventually settled to the same one.serviceDiscovered
Constructor and Description |
---|
StickyEndpointStrategy(ServiceDiscovered serviceDiscovered) |
Modifier and Type | Method and Description |
---|---|
Discoverable |
pick()
Picks a
Discoverable using its strategy. |
pick
public StickyEndpointStrategy(ServiceDiscovered serviceDiscovered)
public Discoverable pick()
EndpointStrategy
Discoverable
using its strategy.Discoverable
based on the strategy or null
if no endpoint can be found.Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.