Package org.apache.druid.common.config
Class JacksonConfigManager
- java.lang.Object
-
- org.apache.druid.common.config.JacksonConfigManager
-
public class JacksonConfigManager extends Object
-
-
Constructor Summary
Constructors Constructor Description JacksonConfigManager(ConfigManager configManager, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, com.fasterxml.jackson.databind.ObjectMapper jsonMapperOnlyNonNullValue, AuditManager auditManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
convertByteToConfig(byte[] configInByte, Class<? extends T> clazz, T defaultVal)
<T> ConfigManager.SetResult
set(String key, byte[] oldValue, T newValue, AuditInfo auditInfo)
Set the config and add audit entry<T> ConfigManager.SetResult
set(String key, T val, AuditInfo auditInfo)
Set the config and add audit entry<T> AtomicReference<T>
watch(String key, com.fasterxml.jackson.core.type.TypeReference<T> clazz, T defaultVal)
<T> AtomicReference<T>
watch(String key, Class<? extends T> clazz)
<T> AtomicReference<T>
watch(String key, Class<? extends T> clazz, T defaultVal)
-
-
-
Constructor Detail
-
JacksonConfigManager
@Inject public JacksonConfigManager(ConfigManager configManager, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, com.fasterxml.jackson.databind.ObjectMapper jsonMapperOnlyNonNullValue, AuditManager auditManager)
-
-
Method Detail
-
watch
public <T> AtomicReference<T> watch(String key, Class<? extends T> clazz)
-
watch
public <T> AtomicReference<T> watch(String key, Class<? extends T> clazz, T defaultVal)
-
watch
public <T> AtomicReference<T> watch(String key, com.fasterxml.jackson.core.type.TypeReference<T> clazz, T defaultVal)
-
convertByteToConfig
public <T> T convertByteToConfig(byte[] configInByte, Class<? extends T> clazz, T defaultVal)
-
set
public <T> ConfigManager.SetResult set(String key, T val, AuditInfo auditInfo)
Set the config and add audit entry- Parameters:
key
- of the config to setval
- new config value to insertauditInfo
- metadata regarding the change to config, for audit purposes
-
set
public <T> ConfigManager.SetResult set(String key, @Nullable byte[] oldValue, T newValue, AuditInfo auditInfo)
Set the config and add audit entry- Parameters:
key
- of the config to setoldValue
- old config value. If not null, then the update will only succeed if the insert happens when current database entry is the same as this value. Note that the current database entry (in array of bytes) have to be exactly the same as the array of bytes of this value for update to succeed. If null, then the insert will not consider the current database entry. Note that this field intentionally uses byte array to be resilient across serde of existing data retrieved from the database (instead of Java object which may have additional fields added as a result of serde)newValue
- new config value to insertauditInfo
- metadata regarding the change to config, for audit purposes
-
-