public abstract class CommonTopicBasedPhysicalClusterMetadata<LCMType extends LogicalClusterMetadata> extends BasePhysicalClusterMetadata<LCMType>
Modifier and Type | Class and Description |
---|---|
static class |
CommonTopicBasedPhysicalClusterMetadata.State |
Modifier and Type | Field and Description |
---|---|
static String |
NUMBER_OF_TENANTS_METRIC_NAME |
Constructor and Description |
---|
CommonTopicBasedPhysicalClusterMetadata(org.apache.kafka.common.metrics.Metrics metrics) |
CommonTopicBasedPhysicalClusterMetadata(org.apache.kafka.common.metrics.Metrics metrics,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
void |
close(String sessionUuid) |
void |
configure(Map<String,?> configs)
Creates a consumer for the LC metadata topic (named in the ConfluentConfigs.CDC_LC_METADATA_TOPIC_CONFIG
config.)
Adds the instance for the given broker session UUID, specified in KafkaConfig.BrokerSessionUuidProp to the
static instance map.
|
void |
consume(org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]> record) |
boolean |
isUp()
Returns true if cache is loaded and listening for metadata, otherwise returns false.
|
abstract Set<String> |
logicalClusterIds()
Returns all active logical clusters with up-to-date/valid metadata hosted by this physical
cluster
|
Set<String> |
logicalClusterIdsIncludingStale()
Returns all active logical clusters hosted by this physical cluster, including logical clusters
with stale/invalid metadata
|
LCMType |
metadata(String logicalClusterId)
Returns metadata LCMType of a given logical cluster ID
|
CompletableFuture<Void> |
start(Map<String,Object> clientConfig) |
getInstance
public static final String NUMBER_OF_TENANTS_METRIC_NAME
public CommonTopicBasedPhysicalClusterMetadata(org.apache.kafka.common.metrics.Metrics metrics)
public CommonTopicBasedPhysicalClusterMetadata(org.apache.kafka.common.metrics.Metrics metrics, org.apache.kafka.common.utils.Time time)
public void configure(Map<String,?> configs)
configs
- broker configurationorg.apache.kafka.common.config.ConfigException
- if KafkaConfig.BrokerSessionUuidProp is not set, or
ConfluentConfigs.CDC_LC_METADATA_TOPIC_CONFIG is not set, or
ConfluentConfigs.CDC_TOPIC_LOAD_TIMEOUT_MS_CONFIG is not set, or
unable to monitor the SSL certificates on disk.UnsupportedOperationException
- if another instance of this class with the same broker
session UUID was already configured.public void close(String sessionUuid)
public CompletableFuture<Void> start(Map<String,Object> clientConfig)
public boolean isUp()
public abstract Set<String> logicalClusterIds()
BasePhysicalClusterMetadata
logicalClusterIds
in class BasePhysicalClusterMetadata<LCMType extends LogicalClusterMetadata>
public Set<String> logicalClusterIdsIncludingStale()
BasePhysicalClusterMetadata
logicalClusterIdsIncludingStale
in class BasePhysicalClusterMetadata<LCMType extends LogicalClusterMetadata>
public LCMType metadata(String logicalClusterId)
BasePhysicalClusterMetadata
metadata
in class BasePhysicalClusterMetadata<LCMType extends LogicalClusterMetadata>
logicalClusterId
- logical cluster IDpublic void consume(org.apache.kafka.clients.consumer.ConsumerRecord<String,byte[]> record)