当前位置: 首页 > news >正文

htaccess 禁止其他网站免费seo培训

htaccess 禁止其他网站,免费seo培训,织梦dede新闻网站源码,网站规划与建设类毕业论文怎么写1.为啥不使用cep呢,cep的超时时间设置不好配置化,无法满足扩展要求 2.超时怎么界定。A事件发生后,过了N时间,还没有收到B事件,算超时。 代码如下: import com.alibaba.fastjson.JSONObject; import lombo…

1.为啥不使用cep呢,cep的超时时间设置不好配置化,无法满足扩展要求

2.超时怎么界定。A事件发生后,过了N时间,还没有收到B事件,算超时。

代码如下:


import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.flink.api.common.state.ValueState;
import org.apache.flink.api.common.state.ValueStateDescriptor;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.functions.KeyedProcessFunction;
import org.apache.flink.util.Collector;@Slf4j
public class AsyncModelTimeoutHandler extends KeyedProcessFunction<String, JSONObject, JSONObject> {private static final long serialVersionUID = -61608451659272532L;private transient ValueState<Long> firstDataTime;private transient ValueState<Long> secondDataTime;private transient ValueState<String> eventType;@Overridepublic void open(Configuration parameters) throws Exception {ValueStateDescriptor<Long> firstDataDescriptor = new ValueStateDescriptor<>("firstDataTime", Long.class);firstDataTime = getRuntimeContext().getState(firstDataDescriptor);ValueStateDescriptor<Long> secondDataDescriptor = new ValueStateDescriptor<>("secondDataTime", Long.class);secondDataTime = getRuntimeContext().getState(secondDataDescriptor);ValueStateDescriptor<String> eventTypeDescriptor = new ValueStateDescriptor<>("eventType", String.class);eventType = getRuntimeContext().getState(eventTypeDescriptor);}@Overridepublic void processElement(JSONObject value, KeyedProcessFunction<String, JSONObject, JSONObject>.Context ctx, Collector<JSONObject> out) throws Exception {Long currentTimestamp = value.getLong("ts");if (value.containsKey("timeout")) {//异步请求消息long timeout = value.getLong("timeout");firstDataTime.update(currentTimestamp + timeout);eventType.update(value.getString("event"));ctx.timerService().registerProcessingTimeTimer(currentTimestamp + timeout);} else {secondDataTime.update(currentTimestamp);}}@Overridepublic void onTimer(long timestamp, KeyedProcessFunction<String, JSONObject, JSONObject>.OnTimerContext ctx, Collector<JSONObject> out) throws Exception {Long firstTime = firstDataTime.value();Long lastTime = secondDataTime.value();if (lastTime == null || (firstTime != null && lastTime >= firstTime)) {//超时了log.info("AsyncModelTimeoutHandler onTimer handle triggerTime={}, firstTime={}, secondTime={},key={}", timestamp, firstTime, lastTime, ctx.getCurrentKey());JSONObject r = new JSONObject();r.put("id", ctx.getCurrentKey());r.put("judgeTime", timestamp);r.put("event", eventType.value());out.collect(r);}firstDataTime.clear();secondDataTime.clear();eventType.clear();}
}
http://www.hrbkazy.com/news/841.html

相关文章:

  • 营销型网站建设网络推广运营培训班
  • 买标准的网站建设长沙关键词优化新报价
  • 做泥水上哪个网站找事做江苏seo和网络推广
  • 阿里云备案直通车关键词怎么优化
  • 渭南做网站电话企业网站seo公司
  • 深圳二维码网站建设东莞做网站的联系电话
  • 长春九台建设局网站今日头条收录入口
  • 西部数码网站管理助手 2008站长工具seo客户端
  • wordpress 购物导航网站市场营销计划方案
  • 网站建设验收标准一站式网站建设公司
  • 吉林省建设厅安全证查询网站网站联盟营销
  • 临沂企业建站系统模板深圳网站优化平台
  • 哪个做网站好百度推广中心
  • 商丘哪里教做网站的自己怎么给网站做优化排名
  • 巴中做网站seo搜索优化公司报价
  • 深圳分销网站制作上海关键词优化方法
  • 做网站还得备案推广软文范例
  • 外贸网站设计案例需要优化的网站有哪些
  • 单位网站建设的必要性青岛排名推广
  • 怀化租房网站东莞网站建设工作
  • 科技公司网站开发论文谷歌play
  • 企业网站ui设计欣赏成都私人网站制作
  • 用vs怎么做网站的导航网络推广网站推广方法
  • 继续坚持网站建设监管济南seo整站优化招商电话
  • 可以做网站的渠道黑科技引流工具
  • 个人做网站如何推广中关村在线app
  • 电影网站网页设计杭州线上推广
  • 百度竞价做网站建设搜索引擎优化指南
  • 网站开发研究方法东莞seo计费
  • 什么是一学一做视频网站网络营销章节测试答案