|
@@ -163,7 +163,7 @@ public class TopicsService {
|
|
public Mono<TopicDTO> createTopic(
|
|
public Mono<TopicDTO> createTopic(
|
|
KafkaCluster cluster, Mono<TopicCreationDTO> topicCreation) {
|
|
KafkaCluster cluster, Mono<TopicCreationDTO> topicCreation) {
|
|
return adminClientService.get(cluster).flatMap(ac -> createTopic(ac, topicCreation))
|
|
return adminClientService.get(cluster).flatMap(ac -> createTopic(ac, topicCreation))
|
|
- .doOnNext(t -> clustersStorage.onTopicUpdated(cluster, t))
|
|
|
|
|
|
+ .doOnNext(t -> clustersStorage.onTopicUpdated(cluster.getName(), t))
|
|
.map(clusterMapper::toTopic);
|
|
.map(clusterMapper::toTopic);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -200,7 +200,7 @@ public class TopicsService {
|
|
Mono<TopicUpdateDTO> topicUpdate) {
|
|
Mono<TopicUpdateDTO> topicUpdate) {
|
|
return topicUpdate
|
|
return topicUpdate
|
|
.flatMap(t -> updateTopic(cl, topicName, t))
|
|
.flatMap(t -> updateTopic(cl, topicName, t))
|
|
- .doOnNext(t -> clustersStorage.onTopicUpdated(cl, t))
|
|
|
|
|
|
+ .doOnNext(t -> clustersStorage.onTopicUpdated(cl.getName(), t))
|
|
.map(clusterMapper::toTopic);
|
|
.map(clusterMapper::toTopic);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -253,7 +253,7 @@ public class TopicsService {
|
|
getPartitionsReassignments(cluster, topicName,
|
|
getPartitionsReassignments(cluster, topicName,
|
|
replicationFactorChange));
|
|
replicationFactorChange));
|
|
})
|
|
})
|
|
- .doOnNext(topic -> clustersStorage.onTopicUpdated(cluster, topic))
|
|
|
|
|
|
+ .doOnNext(topic -> clustersStorage.onTopicUpdated(cluster.getName(), topic))
|
|
.map(t -> new ReplicationFactorChangeResponseDTO()
|
|
.map(t -> new ReplicationFactorChangeResponseDTO()
|
|
.topicName(t.getName())
|
|
.topicName(t.getName())
|
|
.totalReplicationFactor(t.getReplicationFactor()));
|
|
.totalReplicationFactor(t.getReplicationFactor()));
|
|
@@ -386,7 +386,7 @@ public class TopicsService {
|
|
return ac.createPartitions(newPartitionsMap)
|
|
return ac.createPartitions(newPartitionsMap)
|
|
.then(getUpdatedTopic(ac, topicName));
|
|
.then(getUpdatedTopic(ac, topicName));
|
|
})
|
|
})
|
|
- .doOnNext(t -> clustersStorage.onTopicUpdated(cluster, t))
|
|
|
|
|
|
+ .doOnNext(t -> clustersStorage.onTopicUpdated(cluster.getName(), t))
|
|
.map(t -> new PartitionsIncreaseResponseDTO()
|
|
.map(t -> new PartitionsIncreaseResponseDTO()
|
|
.topicName(t.getName())
|
|
.topicName(t.getName())
|
|
.totalPartitionsCount(t.getPartitionCount()));
|
|
.totalPartitionsCount(t.getPartitionCount()));
|
|
@@ -425,7 +425,7 @@ public class TopicsService {
|
|
.orElseThrow(TopicNotFoundException::new);
|
|
.orElseThrow(TopicNotFoundException::new);
|
|
if (cluster.getFeatures().contains(Feature.TOPIC_DELETION)) {
|
|
if (cluster.getFeatures().contains(Feature.TOPIC_DELETION)) {
|
|
return adminClientService.get(cluster).flatMap(c -> c.deleteTopic(topicName))
|
|
return adminClientService.get(cluster).flatMap(c -> c.deleteTopic(topicName))
|
|
- .doOnSuccess(t -> clustersStorage.onTopicDeleted(cluster, topicName));
|
|
|
|
|
|
+ .doOnSuccess(t -> clustersStorage.onTopicDeleted(cluster.getName(), topicName));
|
|
} else {
|
|
} else {
|
|
return Mono.error(new ValidationException("Topic deletion restricted"));
|
|
return Mono.error(new ValidationException("Topic deletion restricted"));
|
|
}
|
|
}
|