@InterfaceAudience.Private final class RegistryEndpointsRefresher extends Object
ConnectionRegistry
up to date.
By default the refresh happens periodically (configured via intervalSecsConfigName
). The
refresh can also be triggered on demand via refreshNow()
. To prevent a flood of
on-demand refreshes we expect that any attempts two should be spaced at least
minIntervalSecsConfigName
seconds apart.Modifier and Type | Class and Description |
---|---|
static interface |
RegistryEndpointsRefresher.Refresher |
Modifier and Type | Field and Description |
---|---|
private long |
initialDelayMs |
private static org.slf4j.Logger |
LOG |
private static int |
MIN_SECS_BETWEEN_REFRESHES_DEFAULT |
private long |
minTimeBetweenRefreshesMs |
private static int |
PERIODIC_REFRESH_INTERVAL_SECS_DEFAULT |
private long |
periodicRefreshMs |
private RegistryEndpointsRefresher.Refresher |
refresher |
private boolean |
refreshNow |
private boolean |
stopped |
private Thread |
thread |
Modifier | Constructor and Description |
---|---|
private |
RegistryEndpointsRefresher(long initialDelayMs,
long periodicRefreshMs,
long minTimeBetweenRefreshesMs,
RegistryEndpointsRefresher.Refresher refresher) |
Modifier and Type | Method and Description |
---|---|
(package private) static RegistryEndpointsRefresher |
create(org.apache.hadoop.conf.Configuration conf,
String initialDelaySecsConfigName,
String intervalSecsConfigName,
String minIntervalSecsConfigName,
RegistryEndpointsRefresher.Refresher refresher)
Create a
RegistryEndpointsRefresher . |
private long |
getRefreshIntervalMs(boolean firstRefresh) |
private void |
mainLoop() |
(package private) void |
refreshNow()
Notifies the refresher thread to refresh the configuration.
|
(package private) void |
stop() |
private static final org.slf4j.Logger LOG
private static final int PERIODIC_REFRESH_INTERVAL_SECS_DEFAULT
private static final int MIN_SECS_BETWEEN_REFRESHES_DEFAULT
private final RegistryEndpointsRefresher.Refresher refresher
private final long initialDelayMs
private final long periodicRefreshMs
private final long minTimeBetweenRefreshesMs
private boolean refreshNow
private boolean stopped
private RegistryEndpointsRefresher(long initialDelayMs, long periodicRefreshMs, long minTimeBetweenRefreshesMs, RegistryEndpointsRefresher.Refresher refresher)
void stop()
private long getRefreshIntervalMs(boolean firstRefresh)
private void mainLoop()
void refreshNow()
static RegistryEndpointsRefresher create(org.apache.hadoop.conf.Configuration conf, String initialDelaySecsConfigName, String intervalSecsConfigName, String minIntervalSecsConfigName, RegistryEndpointsRefresher.Refresher refresher)
RegistryEndpointsRefresher
. If the interval secs configured via
intervalSecsConfigName
is less than zero, will return null here, which means disable
refreshing of endpoints.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.