use of io.strimzi.api.kafka.model.KafkaTopicSpec in project strimzi by strimzi.
the class CruiseControlST method testAutoCreationOfCruiseControlTopics.
@IsolatedTest
void testAutoCreationOfCruiseControlTopics(ExtensionContext extensionContext) {
final String clusterName = mapWithClusterNames.get(extensionContext.getDisplayName());
resourceManager.createResource(extensionContext, KafkaTemplates.kafkaWithCruiseControl(clusterName, 3, 3).editMetadata().withNamespace(namespace).endMetadata().editOrNewSpec().editKafka().addToConfig("auto.create.topics.enable", "false").endKafka().endSpec().build());
KafkaTopicUtils.waitForKafkaTopicReady(namespace, CRUISE_CONTROL_METRICS_TOPIC);
KafkaTopicSpec metricsTopic = KafkaTopicResource.kafkaTopicClient().inNamespace(namespace).withName(CRUISE_CONTROL_METRICS_TOPIC).get().getSpec();
KafkaTopicUtils.waitForKafkaTopicReady(namespace, CRUISE_CONTROL_MODEL_TRAINING_SAMPLES_TOPIC);
KafkaTopicSpec modelTrainingTopic = KafkaTopicResource.kafkaTopicClient().inNamespace(namespace).withName(CRUISE_CONTROL_MODEL_TRAINING_SAMPLES_TOPIC).get().getSpec();
KafkaTopicUtils.waitForKafkaTopicReady(namespace, CRUISE_CONTROL_PARTITION_METRICS_SAMPLES_TOPIC);
KafkaTopicSpec partitionMetricsTopic = KafkaTopicResource.kafkaTopicClient().inNamespace(namespace).withName(CRUISE_CONTROL_PARTITION_METRICS_SAMPLES_TOPIC).get().getSpec();
LOGGER.info("Checking partitions and replicas for {}", CRUISE_CONTROL_METRICS_TOPIC);
assertThat(metricsTopic.getPartitions(), is(1));
assertThat(metricsTopic.getReplicas(), is(3));
LOGGER.info("Checking partitions and replicas for {}", CRUISE_CONTROL_MODEL_TRAINING_SAMPLES_TOPIC);
assertThat(modelTrainingTopic.getPartitions(), is(32));
assertThat(modelTrainingTopic.getReplicas(), is(2));
LOGGER.info("Checking partitions and replicas for {}", CRUISE_CONTROL_PARTITION_METRICS_SAMPLES_TOPIC);
assertThat(partitionMetricsTopic.getPartitions(), is(32));
assertThat(partitionMetricsTopic.getReplicas(), is(2));
}
use of io.strimzi.api.kafka.model.KafkaTopicSpec in project strimzi by strimzi.
the class TopicSerializationTest method testNoConfig.
@Test
public void testNoConfig() {
KafkaTopicSpec spec = new KafkaTopicSpec();
spec.setPartitions(3);
spec.setReplicas(3);
KafkaTopic kafkaTopic = new KafkaTopic();
kafkaTopic.setMetadata(new ObjectMetaBuilder().withName("my-topic").build());
kafkaTopic.setSpec(spec);
TopicSerialization.fromTopicResource(kafkaTopic);
}
use of io.strimzi.api.kafka.model.KafkaTopicSpec in project strimzi-kafka-operator by strimzi.
the class TopicSerializationTest method testNoConfig.
@Test
public void testNoConfig() {
KafkaTopicSpec spec = new KafkaTopicSpec();
spec.setPartitions(3);
spec.setReplicas(3);
KafkaTopic kafkaTopic = new KafkaTopic();
kafkaTopic.setMetadata(new ObjectMetaBuilder().withName("my-topic").build());
kafkaTopic.setSpec(spec);
TopicSerialization.fromTopicResource(kafkaTopic);
}
use of io.strimzi.api.kafka.model.KafkaTopicSpec in project strimzi-kafka-operator by strimzi.
the class CruiseControlST method testAutoCreationOfCruiseControlTopics.
@IsolatedTest
void testAutoCreationOfCruiseControlTopics(ExtensionContext extensionContext) {
final String clusterName = mapWithClusterNames.get(extensionContext.getDisplayName());
resourceManager.createResource(extensionContext, KafkaTemplates.kafkaWithCruiseControl(clusterName, 3, 3).editMetadata().withNamespace(namespace).endMetadata().editOrNewSpec().editKafka().addToConfig("auto.create.topics.enable", "false").endKafka().endSpec().build());
KafkaTopicUtils.waitForKafkaTopicReady(namespace, CRUISE_CONTROL_METRICS_TOPIC);
KafkaTopicSpec metricsTopic = KafkaTopicResource.kafkaTopicClient().inNamespace(namespace).withName(CRUISE_CONTROL_METRICS_TOPIC).get().getSpec();
KafkaTopicUtils.waitForKafkaTopicReady(namespace, CRUISE_CONTROL_MODEL_TRAINING_SAMPLES_TOPIC);
KafkaTopicSpec modelTrainingTopic = KafkaTopicResource.kafkaTopicClient().inNamespace(namespace).withName(CRUISE_CONTROL_MODEL_TRAINING_SAMPLES_TOPIC).get().getSpec();
KafkaTopicUtils.waitForKafkaTopicReady(namespace, CRUISE_CONTROL_PARTITION_METRICS_SAMPLES_TOPIC);
KafkaTopicSpec partitionMetricsTopic = KafkaTopicResource.kafkaTopicClient().inNamespace(namespace).withName(CRUISE_CONTROL_PARTITION_METRICS_SAMPLES_TOPIC).get().getSpec();
LOGGER.info("Checking partitions and replicas for {}", CRUISE_CONTROL_METRICS_TOPIC);
assertThat(metricsTopic.getPartitions(), is(1));
assertThat(metricsTopic.getReplicas(), is(3));
LOGGER.info("Checking partitions and replicas for {}", CRUISE_CONTROL_MODEL_TRAINING_SAMPLES_TOPIC);
assertThat(modelTrainingTopic.getPartitions(), is(32));
assertThat(modelTrainingTopic.getReplicas(), is(2));
LOGGER.info("Checking partitions and replicas for {}", CRUISE_CONTROL_PARTITION_METRICS_SAMPLES_TOPIC);
assertThat(partitionMetricsTopic.getPartitions(), is(32));
assertThat(partitionMetricsTopic.getReplicas(), is(2));
}
Aggregations