Class DirectoryConfigProvider
java.lang.Object
org.apache.kafka.common.config.provider.DirectoryConfigProvider
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfigProvider,Configurable
public class DirectoryConfigProvider extends Object implements ConfigProvider
An implementation of
ConfigProvider based on a directory of files.
Property keys correspond to the names of the regular (i.e. non-directory)
files in a directory given by the path parameter.
Property values are taken from the file contents corresponding to each key.-
Constructor Summary
Constructors Constructor Description DirectoryConfigProvider() -
Method Summary
Modifier and Type Method Description voidclose()voidconfigure(Map<String,?> configs)Configure this class with the given key-value pairsConfigDataget(String path)Retrieves the data contained in regular files in the directory given bypath.ConfigDataget(String path, Set<String> keys)Retrieves the data contained in the regular files named bykeysin the directory given bypath.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.common.config.provider.ConfigProvider
subscribe, unsubscribe, unsubscribeAll
-
Constructor Details
-
DirectoryConfigProvider
public DirectoryConfigProvider()
-
-
Method Details
-
configure
Description copied from interface:ConfigurableConfigure this class with the given key-value pairs- Specified by:
configurein interfaceConfigurable
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
get
Retrieves the data contained in regular files in the directory given bypath. Non-regular files (such as directories) in the given directory are silently ignored.- Specified by:
getin interfaceConfigProvider- Parameters:
path- the directory where data files reside.- Returns:
- the configuration data.
-
get
Retrieves the data contained in the regular files named bykeysin the directory given bypath. Non-regular files (such as directories) in the given directory are silently ignored.- Specified by:
getin interfaceConfigProvider- Parameters:
path- the directory where data files reside.keys- the keys whose values will be retrieved.- Returns:
- the configuration data.
-