Class AsyncRetryingServiceDiscoveryAnnouncer
java.lang.Object
com.linkedin.venice.servicediscovery.AsyncRetryingServiceDiscoveryAnnouncer
- All Implemented Interfaces:
ServiceDiscoveryAnnouncer
public class AsyncRetryingServiceDiscoveryAnnouncer
extends Object
implements ServiceDiscoveryAnnouncer
This class is responsible for announcing and de-announcing a
ServiceDiscoveryAnnouncer
to a Service Discovery system
and taking care of failed registrations by retrying them asynchronously.-
Constructor Summary
ConstructorDescriptionAsyncRetryingServiceDiscoveryAnnouncer
(List<ServiceDiscoveryAnnouncer> serviceDiscoveryAnnouncers, long serviceDiscoveryRegistrationRetryMS) -
Method Summary
Modifier and TypeMethodDescriptionvoid
register()
Registers eachServiceDiscoveryAnnouncer
inserviceDiscoveryAnnouncers
.void
Unregisters eachServiceDiscoveryAnnouncer
inserviceDiscoveryAnnouncers
.
-
Constructor Details
-
AsyncRetryingServiceDiscoveryAnnouncer
public AsyncRetryingServiceDiscoveryAnnouncer(List<ServiceDiscoveryAnnouncer> serviceDiscoveryAnnouncers, long serviceDiscoveryRegistrationRetryMS)
-
-
Method Details
-
register
public void register()Registers eachServiceDiscoveryAnnouncer
inserviceDiscoveryAnnouncers
. If a service discovery announcer fails to register, it is added to the retry queue and registration will be retried asynchronously in a separate thread.- Specified by:
register
in interfaceServiceDiscoveryAnnouncer
-
unregister
public void unregister()Unregisters eachServiceDiscoveryAnnouncer
inserviceDiscoveryAnnouncers
. One reason that a service discovery announcer may fail to unregister is if it was never successfully registered.- Specified by:
unregister
in interfaceServiceDiscoveryAnnouncer
-