import com.google.common.collect.Lists;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.state.ListState;
import org.apache.flink.api.common.state.ListStateDescriptor;
import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.KeyedProcessFunction;
import org.apache.flink.util.Collector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.SimpleDateFormat;
/**
* Author itcast
* Date 2021/12/5 15:30
* Desc - 在服务器运维中,需要实时监控服务器机架的温度,如果一定时间内温度超过了一定阈值(100度),
* 且后一次上报的温度超过了前一次上报的温度,需要触发告警(温度持续升高中)
* <p>
* 1,100
* 2,101
* 1,102
* <p>
* 1,105
* 1,101
* 1,103
* 1,95
*/
public class TemperatureAlarmProcess {
//定义logger
private sta
Flink实现高温预警
最新推荐文章于 2022-05-09 16:17:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)