use of org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceRequest in project incubator-inlong by apache.
the class AbstractSourceOperateListener method createSourceRequest.
public SourceRequest createSourceRequest(SourceResponse sourceResponse) {
String sourceType = sourceResponse.getSourceType();
SourceType type = SourceType.valueOf(sourceType);
switch(type) {
case BINLOG:
return CommonBeanUtils.copyProperties((BinlogSourceResponse) sourceResponse, BinlogSourceRequest::new);
case KAFKA:
return CommonBeanUtils.copyProperties((KafkaSourceResponse) sourceResponse, KafkaSourceRequest::new);
default:
throw new IllegalArgumentException(String.format("Unsupported type=%s for DataSourceOperateListener", type));
}
}
use of org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceRequest in project incubator-inlong by apache.
the class StreamSourceServiceTest method saveSource.
public Integer saveSource() {
streamServiceTest.saveInlongStream(globalGroupId, globalStreamId, globalOperator);
BinlogSourceRequest sourceInfo = new BinlogSourceRequest();
sourceInfo.setInlongGroupId(globalGroupId);
sourceInfo.setInlongStreamId(globalStreamId);
sourceInfo.setSourceName(sourceName);
sourceInfo.setSourceType(Constant.SOURCE_BINLOG);
return sourceService.save(sourceInfo, globalOperator);
}
use of org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceRequest in project incubator-inlong by apache.
the class DataSourceListenerTest method createBinlogSource.
public Integer createBinlogSource(InlongGroupInfo groupInfo) {
final InlongStreamInfo streamInfo = createStreamInfo(groupInfo);
BinlogSourceRequest sourceRequest = new BinlogSourceRequest();
sourceRequest.setInlongGroupId(streamInfo.getInlongGroupId());
sourceRequest.setInlongStreamId(streamInfo.getInlongStreamId());
sourceRequest.setSourceName("binlog-collect");
return streamSourceService.save(sourceRequest, OPERATOR);
}
use of org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceRequest in project incubator-inlong by apache.
the class BinlogStreamSourceOperation method setTargetEntity.
@Override
protected void setTargetEntity(SourceRequest request, StreamSourceEntity targetEntity) {
BinlogSourceRequest sourceRequest = (BinlogSourceRequest) request;
CommonBeanUtils.copyProperties(sourceRequest, targetEntity, true);
try {
BinlogSourceDTO dto = BinlogSourceDTO.getFromRequest(sourceRequest);
targetEntity.setExtParams(objectMapper.writeValueAsString(dto));
} catch (Exception e) {
throw new BusinessException(ErrorCodeEnum.SOURCE_INFO_INCORRECT.getMessage());
}
}
use of org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceRequest in project incubator-inlong by apache.
the class AgentServiceTest method saveSource.
public Integer saveSource() {
streamServiceTest.saveInlongStream(globalGroupId, globalStreamId, globalOperator);
BinlogSourceRequest sourceInfo = new BinlogSourceRequest();
sourceInfo.setInlongGroupId(globalGroupId);
sourceInfo.setInlongStreamId(globalStreamId);
sourceInfo.setSourceType(Constant.SOURCE_BINLOG);
return sourceService.save(sourceInfo, globalOperator);
}
Aggregations