Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INLONG-10204][Manager] Kafka sink supports automatic allocation of sort standalone cluster #10207

Merged
merged 3 commits into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.apache.inlong.manager.common.util.Preconditions;
import org.apache.inlong.manager.pojo.sink.SinkInfo;
import org.apache.inlong.manager.pojo.sink.kafka.KafkaSinkDTO;
import org.apache.inlong.manager.service.resource.sink.SinkResourceOperator;
import org.apache.inlong.manager.service.resource.sink.AbstractStandaloneSinkResourceOperator;
import org.apache.inlong.manager.service.sink.StreamSinkService;

import org.apache.kafka.clients.admin.Admin;
Expand All @@ -47,7 +47,7 @@
* Kafka resource operator for creating Kafka topic
*/
@Service
public class KafkaResourceOperator implements SinkResourceOperator {
public class KafkaResourceOperator extends AbstractStandaloneSinkResourceOperator {

private static final Logger LOGGER = LoggerFactory.getLogger(KafkaResourceOperator.class);

Expand Down Expand Up @@ -76,7 +76,6 @@ public void createSinkResource(SinkInfo sinkInfo) {
new NewTopic(topicName, Optional.of(partitionNum), Optional.empty())));
result.values().get(topicName).get();
}

sinkService.updateStatus(sinkInfo.getId(), SinkStatus.CONFIG_SUCCESSFUL.getCode(),
"create kafka topic success");
LOGGER.info("success to create kafka topic [{}] for sinkInfo={}", topicName, sinkInfo);
Expand All @@ -85,6 +84,7 @@ public void createSinkResource(SinkInfo sinkInfo) {
sinkService.updateStatus(sinkInfo.getId(), SinkStatus.CONFIG_FAILED.getCode(), e.getMessage());
throw new WorkflowException("create kafka topic failed, reason: " + e.getMessage());
}
this.assignCluster(sinkInfo);
}

/**
Expand Down
Loading