Search in sources :

Example 6 with SourceType

use of org.apache.inlong.manager.common.enums.SourceType in project incubator-inlong by apache.

the class InlongStreamSourceTransfer method parseStreamSource.

public static StreamSource parseStreamSource(SourceResponse sourceResponse) {
    String type = sourceResponse.getSourceType();
    SourceType sourceType = SourceType.forType(type);
    if (sourceType == SourceType.KAFKA && sourceResponse instanceof KafkaSourceResponse) {
        return parseKafkaSource((KafkaSourceResponse) sourceResponse);
    }
    if (sourceType == SourceType.BINLOG && sourceResponse instanceof BinlogSourceResponse) {
        return parseMySQLBinlogSource((BinlogSourceResponse) sourceResponse);
    }
    throw new IllegalArgumentException(String.format("Unsupported source type : %s for Inlong", sourceType));
}
Also used : KafkaSourceResponse(org.apache.inlong.manager.common.pojo.source.kafka.KafkaSourceResponse) SourceType(org.apache.inlong.manager.common.enums.SourceType) BinlogSourceResponse(org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceResponse)

Aggregations

SourceType (org.apache.inlong.manager.common.enums.SourceType)6 PageInfo (com.github.pagehelper.PageInfo)2 JsonObject (com.google.gson.JsonObject)2 SourceListResponse (org.apache.inlong.manager.common.pojo.source.SourceListResponse)2 SourceResponse (org.apache.inlong.manager.common.pojo.source.SourceResponse)2 BinlogSourceListResponse (org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceListResponse)2 BinlogSourceResponse (org.apache.inlong.manager.common.pojo.source.binlog.BinlogSourceResponse)2 KafkaSourceListResponse (org.apache.inlong.manager.common.pojo.source.kafka.KafkaSourceListResponse)2 KafkaSourceResponse (org.apache.inlong.manager.common.pojo.source.kafka.KafkaSourceResponse)2 Page (com.github.pagehelper.Page)1 PageHelper (com.github.pagehelper.PageHelper)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 TypeToken (com.google.common.reflect.TypeToken)1 JsonArray (com.google.gson.JsonArray)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 Date (java.util.Date)1 List (java.util.List)1 Map (java.util.Map)1