|
|
@ -29,16 +29,10 @@ import com.qniao.iot.rc.event.MachineIotDataReceivedEventSerializationSchema; |
|
|
import com.qniao.iot.rc.event.RootCloudIotDataReceiptedEventDeserializationSchema; |
|
|
import com.qniao.iot.rc.event.RootCloudIotDataReceiptedEventDeserializationSchema; |
|
|
import com.qniao.iot.rc.until.SnowFlake; |
|
|
import com.qniao.iot.rc.until.SnowFlake; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.apache.flink.api.common.eventtime.WatermarkStrategy; |
|
|
import org.apache.flink.api.common.eventtime.WatermarkStrategy; |
|
|
import org.apache.flink.api.common.functions.MapFunction; |
|
|
import org.apache.flink.api.common.functions.MapFunction; |
|
|
import org.apache.flink.api.common.functions.RichFilterFunction; |
|
|
|
|
|
import org.apache.flink.api.common.functions.RichMapFunction; |
|
|
import org.apache.flink.api.common.functions.RichMapFunction; |
|
|
import org.apache.flink.api.common.serialization.SimpleStringEncoder; |
|
|
import org.apache.flink.api.common.serialization.SimpleStringEncoder; |
|
|
import org.apache.flink.api.common.state.ValueState; |
|
|
|
|
|
import org.apache.flink.api.common.state.ValueStateDescriptor; |
|
|
|
|
|
import org.apache.flink.api.common.typeinfo.TypeInformation; |
|
|
|
|
|
import org.apache.flink.configuration.Configuration; |
|
|
|
|
|
import org.apache.flink.configuration.MemorySize; |
|
|
import org.apache.flink.configuration.MemorySize; |
|
|
import org.apache.flink.connector.base.DeliveryGuarantee; |
|
|
import org.apache.flink.connector.base.DeliveryGuarantee; |
|
|
import org.apache.flink.connector.kafka.sink.KafkaRecordSerializationSchema; |
|
|
import org.apache.flink.connector.kafka.sink.KafkaRecordSerializationSchema; |
|
|
@ -48,42 +42,23 @@ import org.apache.flink.connector.kafka.source.enumerator.initializer.OffsetsIni |
|
|
import org.apache.flink.core.fs.Path; |
|
|
import org.apache.flink.core.fs.Path; |
|
|
import org.apache.flink.core.io.SimpleVersionedSerializer; |
|
|
import org.apache.flink.core.io.SimpleVersionedSerializer; |
|
|
import org.apache.flink.streaming.api.CheckpointingMode; |
|
|
import org.apache.flink.streaming.api.CheckpointingMode; |
|
|
import org.apache.flink.streaming.api.datastream.DataStreamSource; |
|
|
|
|
|
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator; |
|
|
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator; |
|
|
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; |
|
|
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; |
|
|
import org.apache.flink.streaming.api.functions.KeyedProcessFunction; |
|
|
|
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.BucketAssigner; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.BucketAssigner; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.StreamingFileSink; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.StreamingFileSink; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.bucketassigners.SimpleVersionedStringSerializer; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.bucketassigners.SimpleVersionedStringSerializer; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.rollingpolicies.DefaultRollingPolicy; |
|
|
import org.apache.flink.streaming.api.functions.sink.filesystem.rollingpolicies.DefaultRollingPolicy; |
|
|
import org.apache.flink.util.Collector; |
|
|
|
|
|
import org.apache.http.HttpHost; |
|
|
|
|
|
import org.apache.http.auth.AuthScope; |
|
|
|
|
|
import org.apache.http.auth.UsernamePasswordCredentials; |
|
|
|
|
|
import org.apache.http.client.CredentialsProvider; |
|
|
|
|
|
import org.apache.http.impl.client.BasicCredentialsProvider; |
|
|
|
|
|
import org.apache.kafka.clients.CommonClientConfigs; |
|
|
import org.apache.kafka.clients.CommonClientConfigs; |
|
|
import org.apache.kafka.clients.consumer.OffsetResetStrategy; |
|
|
import org.apache.kafka.clients.consumer.OffsetResetStrategy; |
|
|
import org.apache.kafka.common.config.SaslConfigs; |
|
|
import org.apache.kafka.common.config.SaslConfigs; |
|
|
import org.elasticsearch.action.search.SearchRequest; |
|
|
|
|
|
import org.elasticsearch.action.search.SearchResponse; |
|
|
|
|
|
import org.elasticsearch.client.RequestOptions; |
|
|
|
|
|
import org.elasticsearch.client.RestClient; |
|
|
|
|
|
import org.elasticsearch.client.RestHighLevelClient; |
|
|
|
|
|
import org.elasticsearch.client.indices.GetIndexRequest; |
|
|
|
|
|
import org.elasticsearch.index.query.QueryBuilders; |
|
|
|
|
|
import org.elasticsearch.rest.RestStatus; |
|
|
|
|
|
import org.elasticsearch.search.SearchHit; |
|
|
|
|
|
import org.elasticsearch.search.SearchHits; |
|
|
|
|
|
import org.elasticsearch.search.builder.SearchSourceBuilder; |
|
|
|
|
|
import org.elasticsearch.search.sort.SortOrder; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
import java.time.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.time.Duration; |
|
|
|
|
|
import java.time.Instant; |
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
import java.time.ZoneOffset; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
import java.util.Properties; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author Lzk |
|
|
* @author Lzk |
|
|
|