Search in sources :

Example 1 with KafkaTopicSpecBuilder

use of io.strimzi.api.kafka.model.KafkaTopicSpecBuilder in project strimzi by strimzi.

the class TopicScalabilityIsolatedST method testModifyBigAmountOfTopicConfigs.

@IsolatedTest
void testModifyBigAmountOfTopicConfigs(ExtensionContext extensionContext) {
    Map<String, Object> modifiedConfig = new HashMap<>();
    // Create topics
    KafkaTopicScalabilityUtils.createTopicsViaK8s(extensionContext, clusterOperator.getDeploymentNamespace(), sharedClusterName, topicPrefix, NUMBER_OF_TOPICS, 2, 3, 2);
    KafkaTopicScalabilityUtils.waitForTopicsReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
    // Add set of configs and expect topics to have ready status
    modifiedConfig.put("compression.type", "gzip");
    modifiedConfig.put("cleanup.policy", "delete");
    modifiedConfig.put("message.timestamp.type", "LogAppendTime");
    modifiedConfig.put("min.insync.replicas", 6);
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withConfig(modifiedConfig).build());
    KafkaTopicScalabilityUtils.waitForTopicsContainConfig(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, modifiedConfig);
    // Set time configs
    modifiedConfig.clear();
    modifiedConfig.put("max.compaction.lag.ms", 54321);
    modifiedConfig.put("min.compaction.lag.ms", 54);
    modifiedConfig.put("retention.ms", 3690);
    modifiedConfig.put("segment.ms", 123456);
    modifiedConfig.put("flush.ms", 456123);
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withConfig(modifiedConfig).build());
    KafkaTopicScalabilityUtils.waitForTopicsContainConfig(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, modifiedConfig);
    // Set size configs
    modifiedConfig.clear();
    modifiedConfig.put("retention.bytes", 9876543);
    modifiedConfig.put("segment.bytes", 321654);
    modifiedConfig.put("max.message.bytes", 654321);
    modifiedConfig.put("flush.messages", 456123);
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withConfig(modifiedConfig).build());
    KafkaTopicScalabilityUtils.waitForTopicsContainConfig(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, modifiedConfig);
    // Set back to default state
    modifiedConfig.clear();
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withConfig(modifiedConfig).build());
    KafkaTopicScalabilityUtils.waitForTopicsReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
}
Also used : HashMap(java.util.HashMap) KafkaTopicSpecBuilder(io.strimzi.api.kafka.model.KafkaTopicSpecBuilder) IsolatedTest(io.strimzi.test.annotations.IsolatedTest)

Example 2 with KafkaTopicSpecBuilder

use of io.strimzi.api.kafka.model.KafkaTopicSpecBuilder in project strimzi by strimzi.

the class TopicScalabilityIsolatedST method testModifyBigAmountOfTopicPartitions.

@IsolatedTest
void testModifyBigAmountOfTopicPartitions(ExtensionContext extensionContext) {
    final int defaultPartitionCount = 2;
    // Create topics
    KafkaTopicScalabilityUtils.createTopicsViaK8s(extensionContext, clusterOperator.getDeploymentNamespace(), sharedClusterName, topicPrefix, NUMBER_OF_TOPICS, defaultPartitionCount, 1, 1);
    KafkaTopicScalabilityUtils.waitForTopicsReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
    // Decrease partitions and expect not ready status
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withPartitions(defaultPartitionCount - 1).build());
    KafkaTopicScalabilityUtils.waitForTopicsNotReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
    // Set back to default and check if topic becomes ready
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withPartitions(defaultPartitionCount).build());
    KafkaTopicScalabilityUtils.waitForTopicsReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
}
Also used : KafkaTopicSpecBuilder(io.strimzi.api.kafka.model.KafkaTopicSpecBuilder) IsolatedTest(io.strimzi.test.annotations.IsolatedTest)

Example 3 with KafkaTopicSpecBuilder

use of io.strimzi.api.kafka.model.KafkaTopicSpecBuilder in project strimzi-kafka-operator by strimzi.

the class TopicScalabilityIsolatedST method testModifyBigAmountOfTopicConfigs.

@IsolatedTest
void testModifyBigAmountOfTopicConfigs(ExtensionContext extensionContext) {
    Map<String, Object> modifiedConfig = new HashMap<>();
    // Create topics
    KafkaTopicScalabilityUtils.createTopicsViaK8s(extensionContext, clusterOperator.getDeploymentNamespace(), sharedClusterName, topicPrefix, NUMBER_OF_TOPICS, 2, 3, 2);
    KafkaTopicScalabilityUtils.waitForTopicsReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
    // Add set of configs and expect topics to have ready status
    modifiedConfig.put("compression.type", "gzip");
    modifiedConfig.put("cleanup.policy", "delete");
    modifiedConfig.put("message.timestamp.type", "LogAppendTime");
    modifiedConfig.put("min.insync.replicas", 6);
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withConfig(modifiedConfig).build());
    KafkaTopicScalabilityUtils.waitForTopicsContainConfig(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, modifiedConfig);
    // Set time configs
    modifiedConfig.clear();
    modifiedConfig.put("max.compaction.lag.ms", 54321);
    modifiedConfig.put("min.compaction.lag.ms", 54);
    modifiedConfig.put("retention.ms", 3690);
    modifiedConfig.put("segment.ms", 123456);
    modifiedConfig.put("flush.ms", 456123);
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withConfig(modifiedConfig).build());
    KafkaTopicScalabilityUtils.waitForTopicsContainConfig(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, modifiedConfig);
    // Set size configs
    modifiedConfig.clear();
    modifiedConfig.put("retention.bytes", 9876543);
    modifiedConfig.put("segment.bytes", 321654);
    modifiedConfig.put("max.message.bytes", 654321);
    modifiedConfig.put("flush.messages", 456123);
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withConfig(modifiedConfig).build());
    KafkaTopicScalabilityUtils.waitForTopicsContainConfig(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, modifiedConfig);
    // Set back to default state
    modifiedConfig.clear();
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withConfig(modifiedConfig).build());
    KafkaTopicScalabilityUtils.waitForTopicsReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
}
Also used : HashMap(java.util.HashMap) KafkaTopicSpecBuilder(io.strimzi.api.kafka.model.KafkaTopicSpecBuilder) IsolatedTest(io.strimzi.test.annotations.IsolatedTest)

Example 4 with KafkaTopicSpecBuilder

use of io.strimzi.api.kafka.model.KafkaTopicSpecBuilder in project strimzi-kafka-operator by strimzi.

the class TopicScalabilityIsolatedST method testModifyBigAmountOfTopicPartitions.

@IsolatedTest
void testModifyBigAmountOfTopicPartitions(ExtensionContext extensionContext) {
    final int defaultPartitionCount = 2;
    // Create topics
    KafkaTopicScalabilityUtils.createTopicsViaK8s(extensionContext, clusterOperator.getDeploymentNamespace(), sharedClusterName, topicPrefix, NUMBER_OF_TOPICS, defaultPartitionCount, 1, 1);
    KafkaTopicScalabilityUtils.waitForTopicsReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
    // Decrease partitions and expect not ready status
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withPartitions(defaultPartitionCount - 1).build());
    KafkaTopicScalabilityUtils.waitForTopicsNotReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
    // Set back to default and check if topic becomes ready
    KafkaTopicScalabilityUtils.modifyBigAmountOfTopics(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS, new KafkaTopicSpecBuilder().withPartitions(defaultPartitionCount).build());
    KafkaTopicScalabilityUtils.waitForTopicsReady(clusterOperator.getDeploymentNamespace(), topicPrefix, NUMBER_OF_TOPICS);
}
Also used : KafkaTopicSpecBuilder(io.strimzi.api.kafka.model.KafkaTopicSpecBuilder) IsolatedTest(io.strimzi.test.annotations.IsolatedTest)

Aggregations

KafkaTopicSpecBuilder (io.strimzi.api.kafka.model.KafkaTopicSpecBuilder)4 IsolatedTest (io.strimzi.test.annotations.IsolatedTest)4 HashMap (java.util.HashMap)2