use of org.apache.inlong.manager.common.pojo.source.kafka.KafkaSourceRequest in project incubator-inlong by apache.
the class InlongStreamSourceTransfer method createKafkaSourceRequest.
private static KafkaSourceRequest createKafkaSourceRequest(KafkaSource kafkaSource, InlongStreamInfo streamInfo) {
KafkaSourceRequest sourceRequest = new KafkaSourceRequest();
sourceRequest.setSourceName(kafkaSource.getSourceName());
sourceRequest.setInlongGroupId(streamInfo.getInlongGroupId());
sourceRequest.setInlongStreamId(streamInfo.getInlongStreamId());
sourceRequest.setSourceType(kafkaSource.getSourceType().name());
sourceRequest.setAgentIp(kafkaSource.getAgentIp());
sourceRequest.setBootstrapServers(kafkaSource.getBootstrapServers());
sourceRequest.setTopic(kafkaSource.getTopic());
sourceRequest.setRecordSpeedLimit(kafkaSource.getRecordSpeedLimit());
sourceRequest.setByteSpeedLimit(kafkaSource.getByteSpeedLimit());
sourceRequest.setTopicPartitionOffset(kafkaSource.getTopicPartitionOffset());
sourceRequest.setAutoOffsetReset(kafkaSource.getAutoOffsetReset().getName());
sourceRequest.setGroupId(kafkaSource.getConsumerGroup());
sourceRequest.setSerializationType(kafkaSource.getDataFormat().getName());
sourceRequest.setDatabasePattern(kafkaSource.getDatabasePattern());
sourceRequest.setTablePattern(kafkaSource.getTablePattern());
sourceRequest.setIgnoreParseErrors(kafkaSource.isIgnoreParseErrors());
sourceRequest.setTimestampFormatStandard(kafkaSource.getTimestampFormatStandard());
return sourceRequest;
}
use of org.apache.inlong.manager.common.pojo.source.kafka.KafkaSourceRequest in project incubator-inlong by apache.
the class KafkaStreamSourceOperation method setTargetEntity.
@Override
protected void setTargetEntity(SourceRequest request, StreamSourceEntity targetEntity) {
KafkaSourceRequest sourceRequest = (KafkaSourceRequest) request;
CommonBeanUtils.copyProperties(sourceRequest, targetEntity, true);
try {
KafkaSourceDTO dto = KafkaSourceDTO.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.kafka.KafkaSourceRequest 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.kafka.KafkaSourceRequest in project incubator-inlong by apache.
the class DisableZkForSortTest method createKafkaSource.
public KafkaSourceRequest createKafkaSource(InlongStreamInfo streamInfo) {
KafkaSourceRequest kafkaSourceRequest = new KafkaSourceRequest();
kafkaSourceRequest.setInlongGroupId(streamInfo.getInlongGroupId());
kafkaSourceRequest.setInlongStreamId(streamInfo.getInlongStreamId());
kafkaSourceRequest.setGroupId("default");
kafkaSourceRequest.setSerializationType("csv");
kafkaSourceRequest.setSourceName("KAFKA");
streamSourceService.save(kafkaSourceRequest, OPERATOR);
return kafkaSourceRequest;
}
Aggregations