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-11307][Manager] Fix the problem of unable to obtain extparams from multiple data sources #11308

Merged
merged 1 commit into from
Oct 9, 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 @@ -74,6 +74,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

Expand Down Expand Up @@ -119,6 +120,9 @@ public abstract class AbstractSourceOperator implements StreamSourceOperator {
private InlongStreamEntityMapper streamMapper;
@Autowired
private ObjectMapper objectMapper;
@Autowired
private AutowireCapableBeanFactory autowireCapableBeanFactory;
private SourceOperatorFactory operatorFactory;

/**
* Getting the source type.
Expand Down Expand Up @@ -523,7 +527,12 @@ private DataConfig getDataConfig(StreamSourceEntity entity, int op) {

InlongGroupEntity groupEntity = groupMapper.selectByGroupIdWithoutTenant(groupId);
InlongStreamEntity streamEntity = streamMapper.selectByIdentifier(groupId, streamId);
String extParams = getExtParams(entity);
if (operatorFactory == null) {
operatorFactory = new SourceOperatorFactory();
autowireCapableBeanFactory.autowireBean(operatorFactory);
}
StreamSourceOperator sourceOperator = operatorFactory.getInstance(entity.getSourceType());
String extParams = sourceOperator.getExtParams(entity);
if (groupEntity != null && streamEntity != null) {
dataConfig.setState(
SourceStatus.NORMAL_STATUS_SET.contains(SourceStatus.forCode(entity.getStatus()))
Expand Down
Loading