...
|
...
|
@@ -3,7 +3,6 @@ package com.yoho.trace.online; |
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.yoho.trace.online.handler.TraceFlinkHandlerStarter;
|
|
|
import com.yoho.trace.sleuth.Spans;
|
|
|
import com.yoho.trace.utils.Constant;
|
|
|
import com.yoho.trace.utils.KafkaUtils;
|
|
|
import org.apache.flink.api.common.functions.FlatMapFunction;
|
|
|
import org.apache.flink.streaming.api.TimeCharacteristic;
|
...
|
...
|
@@ -11,6 +10,7 @@ import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator; |
|
|
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
|
|
|
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase;
|
|
|
import org.apache.flink.util.Collector;
|
|
|
import properties.PropertiesFactory;
|
|
|
|
|
|
/**
|
|
|
* Created by mingdan.ge on 2019/11/7.
|
...
|
...
|
@@ -22,7 +22,7 @@ public class TraceFlinkExecutor { |
|
|
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
|
|
|
env.setStreamTimeCharacteristic(TimeCharacteristic.ProcessingTime);
|
|
|
|
|
|
FlinkKafkaConsumerBase<String> kafkaConsumer = KafkaUtils.finkKafkaConsumer(Constant.KAFKA_CLICK_SERVERS, Constant.KAFKA_CLICK_ANALYSIS_GROUP, Constant.TOPIC_YOHO_LOG_MOBILE);
|
|
|
FlinkKafkaConsumerBase<String> kafkaConsumer = KafkaUtils.finkKafkaConsumer(PropertiesFactory.kafka().getBrokers(), PropertiesFactory.kafka().getGroup(), PropertiesFactory.kafka().getTopic());
|
|
|
SingleOutputStreamOperator<Spans> clickStream = env.addSource(kafkaConsumer)
|
|
|
.flatMap(new FlatMapFunction<String, Spans>() {
|
|
|
@Override
|
...
|
...
|
|