Package org.apache.hadoop.hbase.client
Class RegistryEndpointsRefresher
java.lang.Object
org.apache.hadoop.hbase.client.RegistryEndpointsRefresher
Thread safe utility that keeps registry end points used by
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.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final long
private static final org.slf4j.Logger
private static final int
private final long
private static final int
private final long
private final RegistryEndpointsRefresher.Refresher
private boolean
private boolean
private final Thread
-
Constructor Summary
ModifierConstructorDescriptionprivate
RegistryEndpointsRefresher
(long initialDelayMs, long periodicRefreshMs, long minTimeBetweenRefreshesMs, RegistryEndpointsRefresher.Refresher refresher) -
Method Summary
Modifier and TypeMethodDescription(package private) static RegistryEndpointsRefresher
create
(org.apache.hadoop.conf.Configuration conf, String initialDelaySecsConfigName, String intervalSecsConfigName, String minIntervalSecsConfigName, RegistryEndpointsRefresher.Refresher refresher) Create aRegistryEndpointsRefresher
.private long
getRefreshIntervalMs
(boolean firstRefresh) private void
mainLoop()
(package private) void
Notifies the refresher thread to refresh the configuration.(package private) void
stop()
-
Field Details
-
LOG
-
PERIODIC_REFRESH_INTERVAL_SECS_DEFAULT
- See Also:
-
MIN_SECS_BETWEEN_REFRESHES_DEFAULT
- See Also:
-
thread
-
refresher
-
initialDelayMs
-
periodicRefreshMs
-
minTimeBetweenRefreshesMs
-
refreshNow
-
stopped
-
-
Constructor Details
-
RegistryEndpointsRefresher
private RegistryEndpointsRefresher(long initialDelayMs, long periodicRefreshMs, long minTimeBetweenRefreshesMs, RegistryEndpointsRefresher.Refresher refresher)
-
-
Method Details
-
stop
void stop() -
getRefreshIntervalMs
-
mainLoop
-
refreshNow
void refreshNow()Notifies the refresher thread to refresh the configuration. This does not guarantee a refresh. See class comment for details. -
create
static RegistryEndpointsRefresher create(org.apache.hadoop.conf.Configuration conf, String initialDelaySecsConfigName, String intervalSecsConfigName, String minIntervalSecsConfigName, RegistryEndpointsRefresher.Refresher refresher) Create aRegistryEndpointsRefresher
. If the interval secs configured viaintervalSecsConfigName
is less than zero, will return null here, which means disable refreshing of endpoints.
-