Class MockInMemoryAdminAdapter
java.lang.Object
com.linkedin.venice.pubsub.mock.adapter.admin.MockInMemoryAdminAdapter
- All Implemented Interfaces:
PubSubAdminAdapter,Closeable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleancontainsTopic(PubSubTopic topic) Checks if a PubSub topic exists.booleancontainsTopicWithPartitionCheck(PubSubTopicPartition pubSubTopicPartition) Checks if a PubSub topic exists and has the given partitionvoidcreateTopic(PubSubTopic topic, int numPartitions, int replication, PubSubTopicConfiguration topicPubSubTopicConfiguration) Creates a new topic in the PubSub system with the given parameters.voiddeleteTopic(PubSubTopic topicName, Duration timeout) Delete a given topic.Retrieves the retention settings for all PubSub topics.getSomeTopicConfigs(Set<PubSubTopic> topicNames) Retrieves the configurations for a set of PubSub topics.getTopicConfig(PubSubTopic topic) Retrieves the configuration of a PubSub topic.getTopicConfigWithRetry(PubSubTopic pubSubTopic) Retrieves a set of all available PubSub topics from the PubSub cluster.partitionsFor(PubSubTopic topic) voidsetTopicConfig(PubSubTopic topicName, PubSubTopicConfiguration topicPubSubTopicConfiguration) Sets the configuration for a PubSub topic.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.venice.pubsub.api.PubSubAdminAdapter
containsTopicWithExpectationAndRetry, containsTopicWithExpectationAndRetry, containsTopicWithPartitionCheckExpectationAndRetry, containsTopicWithPartitionCheckExpectationAndRetry, getTopicConfigMaxRetryInMs
-
Constructor Details
-
MockInMemoryAdminAdapter
-
-
Method Details
-
createTopic
public void createTopic(PubSubTopic topic, int numPartitions, int replication, PubSubTopicConfiguration topicPubSubTopicConfiguration) Description copied from interface:PubSubAdminAdapterCreates a new topic in the PubSub system with the given parameters.- Specified by:
createTopicin interfacePubSubAdminAdapter- Parameters:
topic- The topic to be created.numPartitions- The number of partitions to be created for the topic.replication- The number of replicas for each partition.topicPubSubTopicConfiguration- Additional topic configuration such as retention, compaction policy, etc.
-
deleteTopic
Description copied from interface:PubSubAdminAdapterDelete a given topic. The calling thread will block until the topic is deleted or the timeout is reached.- Specified by:
deleteTopicin interfacePubSubAdminAdapter- Parameters:
topicName- The topic to delete.timeout- The maximum duration to wait for the deletion to complete.
-
listAllTopics
Description copied from interface:PubSubAdminAdapterRetrieves a set of all available PubSub topics from the PubSub cluster.- Specified by:
listAllTopicsin interfacePubSubAdminAdapter- Returns:
- A Set of PubSubTopic objects representing all available topics.
-
setTopicConfig
public void setTopicConfig(PubSubTopic topicName, PubSubTopicConfiguration topicPubSubTopicConfiguration) throws PubSubTopicDoesNotExistException Description copied from interface:PubSubAdminAdapterSets the configuration for a PubSub topic.- Specified by:
setTopicConfigin interfacePubSubAdminAdapter- Parameters:
topicName- The PubSubTopic for which to set the configuration.topicPubSubTopicConfiguration- The configuration to be set for the specified PubSub topic.- Throws:
PubSubTopicDoesNotExistException- If the specified PubSub topic does not exist.
-
getAllTopicRetentions
Description copied from interface:PubSubAdminAdapterRetrieves the retention settings for all PubSub topics.- Specified by:
getAllTopicRetentionsin interfacePubSubAdminAdapter- Returns:
- A map of pub-sub topics and their corresponding retention settings in milliseconds.
If a topic does not have a retention setting, it will be mapped to
PubSubConstants.PUBSUB_TOPIC_UNKNOWN_RETENTION.
-
getTopicConfig
public PubSubTopicConfiguration getTopicConfig(PubSubTopic topic) throws PubSubTopicDoesNotExistException Description copied from interface:PubSubAdminAdapterRetrieves the configuration of a PubSub topic.- Specified by:
getTopicConfigin interfacePubSubAdminAdapter- Parameters:
topic- The PubSubTopic for which to retrieve the configuration.- Returns:
- The configuration of the specified PubSubTopic as a PubSubTopicConfiguration object.
- Throws:
PubSubTopicDoesNotExistException- If the specified PubSubTopic topic does not exist.
-
getTopicConfigWithRetry
- Specified by:
getTopicConfigWithRetryin interfacePubSubAdminAdapter
-
containsTopic
Description copied from interface:PubSubAdminAdapterChecks if a PubSub topic exists.- Specified by:
containsTopicin interfacePubSubAdminAdapter- Parameters:
topic- The PubSubTopic to check for existence.- Returns:
- true if the specified topic exists, false otherwise.
-
containsTopicWithPartitionCheck
Description copied from interface:PubSubAdminAdapterChecks if a PubSub topic exists and has the given partition- Specified by:
containsTopicWithPartitionCheckin interfacePubSubAdminAdapter- Parameters:
pubSubTopicPartition- The PubSubTopicPartition representing th topic and partition to check.- Returns:
- true if the specified topic partition exists, false otherwise.
-
getRetriableExceptions
- Specified by:
getRetriableExceptionsin interfacePubSubAdminAdapter- Returns:
- Returns a list of exceptions that are retriable for this PubSubClient.
-
getSomeTopicConfigs
Description copied from interface:PubSubAdminAdapterRetrieves the configurations for a set of PubSub topics.- Specified by:
getSomeTopicConfigsin interfacePubSubAdminAdapter- Parameters:
topicNames- The set of PubSub topics to retrieve configurations for.- Returns:
- A map of PubSub topics and their corresponding configurations.
-
partitionsFor
-
getClassName
- Specified by:
getClassNamein interfacePubSubAdminAdapter
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-