Class SingleClusterTopicMetadataService
java.lang.Object
org.apache.flink.connector.kafka.dynamic.metadata.SingleClusterTopicMetadataService
- All Implemented Interfaces:
Serializable,AutoCloseable,KafkaMetadataService
@Experimental
public class SingleClusterTopicMetadataService
extends Object
implements KafkaMetadataService
A
KafkaMetadataService that delegates metadata fetching to a single AdminClient,
which is scoped to a single cluster. The stream ids are equivalent to topics.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSingleClusterTopicMetadataService(String kafkaClusterId, Properties properties) Create aSingleClusterTopicMetadataService. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()describeStreams(Collection<String> streamIds) Get current metadata for queried streams.Get current metadata for all streams.booleanisClusterActive(String kafkaClusterId) Check if the cluster is active.
-
Constructor Details
-
SingleClusterTopicMetadataService
Create aSingleClusterTopicMetadataService.- Parameters:
kafkaClusterId- the id of the Kafka cluster.properties- the properties of the Kafka cluster.
-
-
Method Details
-
getAllStreams
Get current metadata for all streams.- Specified by:
getAllStreamsin interfaceKafkaMetadataService- Returns:
- set of all streams
-
describeStreams
Get current metadata for queried streams.- Specified by:
describeStreamsin interfaceKafkaMetadataService- Parameters:
streamIds- stream full names- Returns:
- map of stream name to metadata
-
isClusterActive
Check if the cluster is active.- Specified by:
isClusterActivein interfaceKafkaMetadataService- Parameters:
kafkaClusterId- Kafka cluster id- Returns:
- boolean whether the cluster is active
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-