public class SchedulerConfigCache<T> extends Object
A utility class to cache the scheduler config and refresh after the cache expires.
Modifier and Type | Class and Description |
---|---|
static interface |
SchedulerConfigCache.Reloadable<T> |
Constructor and Description |
---|
SchedulerConfigCache(Map<String,Object> conf,
SchedulerConfigCache.Reloadable<T> reloader) |
Modifier and Type | Method and Description |
---|---|
T |
get()
Get the scheduler config from cache.
|
void |
prepare() |
void |
refresh()
Refresh the config only after the cache expires.
|
public SchedulerConfigCache(Map<String,Object> conf, SchedulerConfigCache.Reloadable<T> reloader)
public void prepare()
public void refresh()
Refresh the config only after the cache expires. This is not thread-safe and should only be called in single thread.
public T get()
Get the scheduler config from cache. This method is thead-safe and can be called in multiple threads.
Copyright © 2022 The Apache Software Foundation. All rights reserved.