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
AKafkaMetadataServicethat delegates metadata fetching to a singleAdminClient, which is scoped to a single cluster. The stream ids are equivalent to topics.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SingleClusterTopicMetadataService(String kafkaClusterId, Properties properties)Create aSingleClusterTopicMetadataService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Map<String,KafkaStream>describeStreams(Collection<String> streamIds)Get current metadata for queried streams.Set<KafkaStream>getAllStreams()Get current metadata for all streams.booleanisClusterActive(String kafkaClusterId)Check if the cluster is active.
-
-
-
Constructor Detail
-
SingleClusterTopicMetadataService
public SingleClusterTopicMetadataService(String kafkaClusterId, Properties properties)
Create aSingleClusterTopicMetadataService.- Parameters:
kafkaClusterId- the id of the Kafka cluster.properties- the properties of the Kafka cluster.
-
-
Method Detail
-
getAllStreams
public Set<KafkaStream> getAllStreams()
Get current metadata for all streams.- Specified by:
getAllStreamsin interfaceKafkaMetadataService- Returns:
- set of all streams
-
describeStreams
public Map<String,KafkaStream> describeStreams(Collection<String> streamIds)
Get current metadata for queried streams.- Specified by:
describeStreamsin interfaceKafkaMetadataService- Parameters:
streamIds- stream full names- Returns:
- map of stream name to metadata
-
isClusterActive
public boolean isClusterActive(String kafkaClusterId)
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
-
-