Package org.apache.storm.scheduler.utils
Class SchedulerConfigCache<T>
java.lang.Object
org.apache.storm.scheduler.utils.SchedulerConfigCache<T>
A utility class to cache the scheduler config and refresh after the cache expires.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionSchedulerConfigCache
(Map<String, Object> conf, SchedulerConfigCache.Reloadable<T> reloader) -
Method Summary
-
Constructor Details
-
SchedulerConfigCache
-
-
Method Details
-
prepare
public void prepare() -
refresh
public void refresh()Refresh the config only after the cache expires. This is not thread-safe and should only be called in single thread. -
get
Get the scheduler config from cache. This method is thead-safe and can be called in multiple threads.- Returns:
- the scheduler config
-