Class EnvVarConfigProvider
- java.lang.Object
 - 
- org.apache.kafka.common.config.provider.EnvVarConfigProvider
 
 
- 
- All Implemented Interfaces:
 Closeable,AutoCloseable,ConfigProvider,Configurable
public class EnvVarConfigProvider extends Object implements ConfigProvider
An implementation ofConfigProviderbased on environment variables. Keys correspond to the names of the environment variables, paths are currently not being used. Using an allowlist patternALLOWLIST_PATTERN_CONFIGthat supports regular expressions, it is possible to limit access to specific environment variables. Default allowlist pattern is ".*". 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringALLOWLIST_PATTERN_CONFIGstatic StringALLOWLIST_PATTERN_CONFIG_DOC 
- 
Constructor Summary
Constructors Constructor Description EnvVarConfigProvider()EnvVarConfigProvider(Map<String,String> envVarsAsArgument) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconfigure(Map<String,?> configs)Configure this class with the given key-value pairsConfigDataget(String path)Retrieves the data at the given path.ConfigDataget(String path, Set<String> keys)Retrieves the data with the given keys at the given path.- 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface org.apache.kafka.common.config.provider.ConfigProvider
subscribe, unsubscribe, unsubscribeAll 
 - 
 
 - 
 
- 
- 
Field Detail
- 
ALLOWLIST_PATTERN_CONFIG
public static final String ALLOWLIST_PATTERN_CONFIG
- See Also:
 - Constant Field Values
 
 
- 
ALLOWLIST_PATTERN_CONFIG_DOC
public static final String ALLOWLIST_PATTERN_CONFIG_DOC
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
configure
public void configure(Map<String,?> configs)
Description copied from interface:ConfigurableConfigure this class with the given key-value pairs- Specified by:
 configurein interfaceConfigurable
 
- 
close
public void close() throws IOException- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Throws:
 IOException
 
- 
get
public ConfigData get(String path)
Description copied from interface:ConfigProviderRetrieves the data at the given path.- Specified by:
 getin interfaceConfigProvider- Parameters:
 path- unused- Returns:
 - returns environment variables as configuration
 
 
- 
get
public ConfigData get(String path, Set<String> keys)
Description copied from interface:ConfigProviderRetrieves the data with the given keys at the given path.- Specified by:
 getin interfaceConfigProvider- Parameters:
 path- path, not used for environment variableskeys- the keys whose values will be retrieved.- Returns:
 - the configuration data.
 
 
 - 
 
 -