Class PhysicalClusterMetadata
java.lang.Object
io.confluent.kafka.multitenant.BasePhysicalClusterMetadata<io.confluent.kafka.multitenant.KafkaLogicalClusterMetadata>
io.confluent.kafka.multitenant.PhysicalClusterMetadata
- All Implemented Interfaces:
org.apache.kafka.common.Configurable, org.apache.kafka.common.Reconfigurable, org.apache.kafka.server.multitenant.MultiTenantMetadata
public class PhysicalClusterMetadata
extends io.confluent.kafka.multitenant.BasePhysicalClusterMetadata<io.confluent.kafka.multitenant.KafkaLogicalClusterMetadata>
File-based implementation of physical cluster metadata that reads LKC metadata from JSON files
on disk. This was the original K1 CCloud sidecar approach where a K8s sidecar would write
<lkc>.json files to a watched directory.
In production, all CCloud clusters now use TopicBasedPhysicalClusterMetadata instead,
which reads LKC metadata as protobuf from the _confluent-logical_clusters internal topic.
This class is retained for use in integration tests, where writing JSON files is simpler than
producing to an internal topic.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from interface org.apache.kafka.server.multitenant.MultiTenantMetadata
CONFLUENT_ENV_ID -
Constructor Summary
ConstructorsConstructorDescriptionPhysicalClusterMetadata(org.apache.kafka.common.metrics.Metrics metrics) PhysicalClusterMetadata(org.apache.kafka.common.metrics.Metrics metrics, org.apache.kafka.common.utils.Time time) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidLoads the cache and starts listening for directory events in directory specified in ConfluentConfigs.MULTITENANT_METADATA_DIR_CONFIG config.booleanisUp()Returns true if cache is loaded and listening for metadata, otherwise returns false.io.confluent.kafka.multitenant.KafkaLogicalClusterMetadataMap<org.apache.kafka.common.Endpoint, CompletableFuture<Void>> start(Map<String, Object> interBrokerClientConfigs, Collection<org.apache.kafka.common.Endpoint> endpoints) voidstartClients(Function<String, org.apache.kafka.clients.admin.Admin> adminClientSupplier) Methods inherited from class io.confluent.kafka.multitenant.BasePhysicalClusterMetadata
getInstance, getTenantMetadataForDedicatedCluster, reconfigurableConfigs, reconfigure, validateReconfigurationMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.server.multitenant.MultiTenantMetadata
ensureOpen, firstActiveUserLkcMetadata, registerTenantCallback, registerTenantDeactivatedCallback, registerTenantMetadataUpdateCallback
-
Field Details
-
tenantLifecycleManager
-
sslCertificateManager
-
-
Constructor Details
-
PhysicalClusterMetadata
public PhysicalClusterMetadata(org.apache.kafka.common.metrics.Metrics metrics) -
PhysicalClusterMetadata
public PhysicalClusterMetadata(org.apache.kafka.common.metrics.Metrics metrics, org.apache.kafka.common.utils.Time time)
-
-
Method Details
-
configure
Loads the cache and starts listening for directory events in directory specified in ConfluentConfigs.MULTITENANT_METADATA_DIR_CONFIG config. Adds the instance for the given broker session UUID, specified in KafkaConfig.BrokerSessionUuidProp, to the static instance map. The caller of this method must call close() when done to remove the instance from the static map. In addition to events in the directory, we are scheduling a full reload of the directory every MULTITENANT_METADATA_RELOAD_DELAY_MS to make sure nothing is missed- Parameters:
configs- broker configuration- Throws:
org.apache.kafka.common.config.ConfigException- if KafkaConfig.BrokerSessionUuidProp is not set, or ConfluentConfigs.MULTITENANT_METADATA_DIR_CONFIG is not set.UnsupportedOperationException- if another instance of this class with the same broker session UUID was already configured.
-
close
-
startClients
-
start
public Map<org.apache.kafka.common.Endpoint, CompletableFuture<Void>> start(Map<String, Object> interBrokerClientConfigs, Collection<org.apache.kafka.common.Endpoint> endpoints) -
isUp
public boolean isUp()Returns true if cache is loaded and listening for metadata, otherwise returns false. -
dedicatedLogicalClusterId
-
kafkaLogicalClusterIds
-
logicalClusterIds
-
logicalClusterIdsIncludingStale
-
metadata
- Specified by:
metadatain interfaceorg.apache.kafka.server.multitenant.MultiTenantMetadata- Specified by:
metadatain classio.confluent.kafka.multitenant.BasePhysicalClusterMetadata<io.confluent.kafka.multitenant.KafkaLogicalClusterMetadata>
-