Class HealthCheckedEndpointGroup
- java.lang.Object
-
- com.linecorp.armeria.common.util.AbstractListenable<List<Endpoint>>
-
- com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
-
- com.linecorp.armeria.client.endpoint.healthcheck.HealthCheckedEndpointGroup
-
- All Implemented Interfaces:
EndpointGroup
,Listenable<List<Endpoint>>
,SafeCloseable
,AutoCloseable
- Direct Known Subclasses:
HttpHealthCheckedEndpointGroup
public abstract class HealthCheckedEndpointGroup extends DynamicEndpointGroup
AnEndpointGroup
decorator that only provides healthyEndpoint
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
HealthCheckedEndpointGroup.EndpointHealthChecker
Returns whether anEndpoint
is healthy or not.
-
Constructor Summary
Constructors Modifier Constructor Description protected
HealthCheckedEndpointGroup(ClientFactory clientFactory, EndpointGroup delegate, Backoff retryBackoff)
Creates a new instance.protected
HealthCheckedEndpointGroup(ClientFactory clientFactory, EndpointGroup delegate, Duration retryInterval)
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ClientFactory
clientFactory()
Returns theClientFactory
that will processHealthCheckedEndpointGroup.EndpointHealthChecker
's healthcheck requests.void
close()
protected abstract HealthCheckedEndpointGroup.EndpointHealthChecker
createEndpointHealthChecker(Endpoint endpoint)
Creates a newHealthCheckedEndpointGroup.EndpointHealthChecker
instance that will checkendpoint
healthiness.protected void
init()
Update healthy servers and start to schedule healthcheck.MeterBinder
newMeterBinder(MeterIdPrefix idPrefix)
Returns a newly-createdMeterBinder
which binds the stats about thisHealthCheckedEndpointGroup
.MeterBinder
newMeterBinder(String groupName)
Returns a newly-createdMeterBinder
which binds the stats about thisHealthCheckedEndpointGroup
with the default meter names.String
toString()
-
Methods inherited from class com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
addEndpoint, awaitInitialEndpoints, awaitInitialEndpoints, endpoints, initialEndpointsFuture, removeEndpoint, setEndpoints
-
Methods inherited from class com.linecorp.armeria.common.util.AbstractListenable
addListener, notifyListeners, removeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.linecorp.armeria.client.endpoint.EndpointGroup
addListener, orElse, removeListener
-
-
-
-
Constructor Detail
-
HealthCheckedEndpointGroup
@Deprecated protected HealthCheckedEndpointGroup(ClientFactory clientFactory, EndpointGroup delegate, Duration retryInterval)
Deprecated.Creates a new instance. A subclass being initialized with this constructor must callinit()
before start being used.
-
HealthCheckedEndpointGroup
protected HealthCheckedEndpointGroup(ClientFactory clientFactory, EndpointGroup delegate, Backoff retryBackoff)
Creates a new instance. A subclass being initialized with this constructor must callinit()
before start being used.
-
-
Method Detail
-
init
protected void init()
Update healthy servers and start to schedule healthcheck. A subclass being initialized with this constructor must callinit()
before start being used.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceEndpointGroup
- Specified by:
close
in interfaceSafeCloseable
- Overrides:
close
in classDynamicEndpointGroup
-
clientFactory
protected final ClientFactory clientFactory()
Returns theClientFactory
that will processHealthCheckedEndpointGroup.EndpointHealthChecker
's healthcheck requests.
-
createEndpointHealthChecker
protected abstract HealthCheckedEndpointGroup.EndpointHealthChecker createEndpointHealthChecker(Endpoint endpoint)
Creates a newHealthCheckedEndpointGroup.EndpointHealthChecker
instance that will checkendpoint
healthiness.
-
newMeterBinder
public MeterBinder newMeterBinder(String groupName)
Returns a newly-createdMeterBinder
which binds the stats about thisHealthCheckedEndpointGroup
with the default meter names.
-
newMeterBinder
public MeterBinder newMeterBinder(MeterIdPrefix idPrefix)
Returns a newly-createdMeterBinder
which binds the stats about thisHealthCheckedEndpointGroup
.
-
-