public interface ConfigProvider extends Configurable, Closeable
Implementations are required to safely support concurrent calls to any of the methods in this interface.
Kafka Connect discovers implementations of this interface using the Java ServiceLoader
mechanism.
To support this, implementations of this interface should also contain a service provider configuration file in
META-INF/services/org.apache.kafka.common.config.provider.ConfigProvider
.
Modifier and Type | Method and Description |
---|---|
ConfigData |
get(String path)
Retrieves the data at the given path.
|
ConfigData |
get(String path,
Set<String> keys)
Retrieves the data with the given keys at the given path.
|
default void |
subscribe(String path,
Set<String> keys,
ConfigChangeCallback callback)
Subscribes to changes for the given keys at the given path (optional operation).
|
default void |
unsubscribe(String path,
Set<String> keys,
ConfigChangeCallback callback)
Unsubscribes to changes for the given keys at the given path (optional operation).
|
default void |
unsubscribeAll()
Clears all subscribers (optional operation).
|
configure
ConfigData get(String path)
path
- the path where the data residesConfigData get(String path, Set<String> keys)
path
- the path where the data resideskeys
- the keys whose values will be retrieveddefault void subscribe(String path, Set<String> keys, ConfigChangeCallback callback)
path
- the path where the data resideskeys
- the keys whose values will be retrievedcallback
- the callback to invoke upon change{@link
- UnsupportedOperationException} if the subscribe operation is not supporteddefault void unsubscribe(String path, Set<String> keys, ConfigChangeCallback callback)
path
- the path where the data resideskeys
- the keys whose values will be retrievedcallback
- the callback to be unsubscribed from changes{@link
- UnsupportedOperationException} if the unsubscribe operation is not supporteddefault void unsubscribeAll()
{@link
- UnsupportedOperationException} if the unsubscribeAll operation is not supported