public abstract class AbstractHealthCheckedEndpointGroupBuilder extends Object
HealthCheckedEndpointGroup.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractHealthCheckedEndpointGroupBuilder(EndpointGroup delegate)
Creates a new
AbstractHealthCheckedEndpointGroupBuilder. |
| Modifier and Type | Method and Description |
|---|---|
HealthCheckedEndpointGroup |
build()
Returns a newly created
HealthCheckedEndpointGroup based on the properties set so far. |
AbstractHealthCheckedEndpointGroupBuilder |
clientFactory(ClientFactory clientFactory)
Sets the
ClientFactory to use when making health check requests. |
AbstractHealthCheckedEndpointGroupBuilder |
clientOptions(ClientOptions clientOptions)
Sets the
ClientOptions of the Client that sends health check requests. |
AbstractHealthCheckedEndpointGroupBuilder |
healthCheckPort(int port)
Deprecated.
Use
port(int). |
AbstractHealthCheckedEndpointGroupBuilder |
maxEndpointCount(int maxEndpointCount)
Sets the maximum endpoint count of target selected candidates.
|
AbstractHealthCheckedEndpointGroupBuilder |
maxEndpointRatio(double maxEndpointRatio)
Sets the maximum endpoint ratio of target selected candidates.
|
protected abstract Function<? super HealthCheckerContext,? extends AsyncCloseable> |
newCheckerFactory()
Returns the
Function that starts to send health check requests to the Endpoint
specified in a given HealthCheckerContext when invoked. |
AbstractHealthCheckedEndpointGroupBuilder |
port(int port)
Sets the port where a health check request will be sent instead of the original port number
specified by
EndpointGroup's Endpoints. |
AbstractHealthCheckedEndpointGroupBuilder |
protocol(SessionProtocol protocol)
Sets the
SessionProtocol to be used when making health check requests. |
AbstractHealthCheckedEndpointGroupBuilder |
retryBackoff(Backoff retryBackoff)
Sets the backoff between health check requests.
|
AbstractHealthCheckedEndpointGroupBuilder |
retryInterval(Duration retryInterval)
Sets the interval between health check requests.
|
AbstractHealthCheckedEndpointGroupBuilder |
retryIntervalMillis(long retryIntervalMillis)
Sets the interval between health check requests in milliseconds.
|
AbstractHealthCheckedEndpointGroupBuilder |
withClientOptions(Function<? super ClientOptionsBuilder,ClientOptionsBuilder> configurator)
|
protected AbstractHealthCheckedEndpointGroupBuilder(EndpointGroup delegate)
AbstractHealthCheckedEndpointGroupBuilder.delegate - the EndpointGroup which provides the candidate Endpointspublic AbstractHealthCheckedEndpointGroupBuilder clientFactory(ClientFactory clientFactory)
ClientFactory to use when making health check requests. This should generally be the
same as the ClientFactory used when creating a Client stub using the
EndpointGroup.public AbstractHealthCheckedEndpointGroupBuilder protocol(SessionProtocol protocol)
SessionProtocol to be used when making health check requests.@Deprecated public AbstractHealthCheckedEndpointGroupBuilder healthCheckPort(int port)
port(int).EndpointGroup's Endpoints. This property is useful when your
server listens to health check requests on a different port.public AbstractHealthCheckedEndpointGroupBuilder port(int port)
EndpointGroup's Endpoints. This property is useful when your
server listens to health check requests on a different port.public AbstractHealthCheckedEndpointGroupBuilder retryInterval(Duration retryInterval)
public AbstractHealthCheckedEndpointGroupBuilder retryIntervalMillis(long retryIntervalMillis)
public AbstractHealthCheckedEndpointGroupBuilder retryBackoff(Backoff retryBackoff)
public AbstractHealthCheckedEndpointGroupBuilder clientOptions(ClientOptions clientOptions)
ClientOptions of the Client that sends health check requests.
This method can be useful if you already have an Armeria client and want to reuse its configuration,
such as using the same decorators.
WebClient myClient = ...;
// Use the same settings and decorators with `myClient` when sending health check requests.
builder.clientOptions(myClient.options());
public AbstractHealthCheckedEndpointGroupBuilder withClientOptions(Function<? super ClientOptionsBuilder,ClientOptionsBuilder> configurator)
public AbstractHealthCheckedEndpointGroupBuilder maxEndpointRatio(double maxEndpointRatio)
PartialHealthCheckStrategyBuilder.maxEndpointRatio(double)public AbstractHealthCheckedEndpointGroupBuilder maxEndpointCount(int maxEndpointCount)
PartialHealthCheckStrategyBuilder.maxEndpointCount(int)public HealthCheckedEndpointGroup build()
HealthCheckedEndpointGroup based on the properties set so far.protected abstract Function<? super HealthCheckerContext,? extends AsyncCloseable> newCheckerFactory()
Function that starts to send health check requests to the Endpoint
specified in a given HealthCheckerContext when invoked. The Function must update
the health of the Endpoint with a value between [0, 1] via
HealthCheckerContext.updateHealth(double). HealthCheckedEndpointGroup will call
AsyncCloseable.closeAsync() on the AsyncCloseable returned by the Function
when it needs to stop sending health check requests.Copyright © 2020 LeanCloud. All rights reserved.