Class BrokerConfigTenantConfigSource
java.lang.Object
io.confluent.kafka.multitenant.metadata.BrokerConfigTenantConfigSource
- All Implemented Interfaces:
org.apache.kafka.common.Configurable, org.apache.kafka.common.Reconfigurable, org.apache.kafka.server.multitenant.TenantConfigSource
public class BrokerConfigTenantConfigSource
extends Object
implements org.apache.kafka.server.multitenant.TenantConfigSource, org.apache.kafka.common.Reconfigurable
A
TenantConfigSource that returns a tenant-independent TenantConfig
derived from selected broker-level configs.
Thread-safety: configFor(String) runs on broker request-handling threads while
reconfigure(Map) / configure(Map) run on the dynamic-config update path.
The shared view is published through a volatile reference; the caller-supplied
isTenantPresent predicate is invoked from configFor and so must itself be
safe for concurrent reads. The tenantConfigNameToBrokerConfigName mapping is
defensively copied at construction and only read thereafter.
-
Field Summary
Fields inherited from interface org.apache.kafka.server.multitenant.TenantConfigSource
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.apache.kafka.server.multitenant.TenantConfig> voidvoidreconfigure(Map<String, ?> configs) voidvalidateReconfiguration(Map<String, ?> configs)
-
Constructor Details
-
BrokerConfigTenantConfigSource
public BrokerConfigTenantConfigSource(Predicate<String> isTenantPresent, Map<String, String> tenantConfigNameToBrokerConfigName) - Parameters:
isTenantPresent- must be thread-safe; called fromconfigFor(String)on broker request-handling threads. Used to enforce theTenantConfigSourcecontract thatconfigForreturnsOptional.empty()for tenants not present on the broker.tenantConfigNameToBrokerConfigName- mapping from tenant config keys to the broker config keys whose values should be returned as the tenant config value. Defensively copied. The mapping must be injective on the broker side: a single broker config cannot back two tenant configs (we reject this at construction rather than silently fan it out).
-
-
Method Details
-
configFor
-
reconfigurableConfigs
-
validateReconfiguration
-
reconfigure
-
configure
-