1,
org.apache.flink.streaming.api.operators; AbstractStreamOperator public void processWatermark1(Watermark mark) throws Exception {
input1Watermark = mark.getTimestamp();
long newMin = Math.min(input1Watermark, input2Watermark);
if (newMin > combinedWatermark) {
combinedWatermark = newMin;
processWatermark(new Watermark(combinedWatermark));
}
} public void processWatermark2(Watermark mark) throws Exception {
input2Watermark = mark.getTimestamp();
long newMin = Math.min(input1Watermark, input2Watermark);
if (newMin > combinedWatermark) {
combinedWatermark = newMin;
processWatermark(new Watermark(combinedWatermark));
}
} 2,
http://vinoyang.com/2016/10/29/flink-streaming-window-operator-analysis/ 3, kakfa中多个partition提取 watermark
private static class PeriodicWatermarkEmitter<KPH> implements ProcessingTimeCallback 
public void onProcessingTime(long timestamp) throws Exception {

   long minAcrossAll = Long.MAX_VALUE;
boolean isEffectiveMinAggregation = false;
for (KafkaTopicPartitionState<?> state : allPartitions) { // we access the current watermark for the periodic assigners under the state
// lock, to prevent concurrent modification to any internal variables
final long curr;
//noinspection SynchronizationOnLocalVariableOrMethodParameter
synchronized (state) {
curr = ((KafkaTopicPartitionStateWithPeriodicWatermarks<?, ?>) state).getCurrentWatermarkTimestamp();
} minAcrossAll = Math.min(minAcrossAll, curr);
isEffectiveMinAggregation = true;
} // emit next watermark, if there is one
if (isEffectiveMinAggregation && minAcrossAll > lastWatermarkTimestamp) {
lastWatermarkTimestamp = minAcrossAll;
emitter.emitWatermark(new Watermark(minAcrossAll));
} // schedule the next watermark
timerService.registerTimer(timerService.getCurrentProcessingTime() + interval, this);
}

多个inputstream的情况下,watermark的值怎么赋值? kakfa中多个partition提取 watermark的更多相关文章

  1. 关于datagridview中checkbox列在选中行的情况下无法操作值

    这几天做项目的时候碰到了个小问题,在datagridview中实现对checkbox列的全选和反选功能.代码如下              //全选              if (dataGrid ...

  2. Java中只有按值传递,没有按引用传递!(两种参数情况下都是值传递)

    今天,我在一本面试书上看到了关于java的一个参数传递的问题: 写道 java中对象作为参数传递给一个方法,到底是值传递,还是引用传递? 我毫无疑问的回答:“引用传递!”,并且还觉得自己对java的这 ...

  3. 知道一个数组某个index对应的值 不知道下标的情况下删除该值

    for (index,item) in Arr.enumerated() { if item == item { Arr.remove(at: index) } } 更好的方法是用数组的filter尾 ...

  4. 【心得】在脱离TFS的情况下,如何解除TFS绑定?

    我们知道在有TFS的情况下,在文件-源代码管理-高级中可以解除TFS绑定. 但是如果我们出差去了,拿着笔记本电脑,打开解决方案的时候,会总是提示无法连接TFS,并且在源代码管理处尝试解除的时候也提示无 ...

  5. 如何在关闭ssh连接的情况下,让进程继续运行?

    #screen 1 回车后进入Screen子界面,此时putty标题栏会指示处于子界面状态,然后运行你的程序 #应用程序名 1 然后按下Ctrl+A后抬起,然后按下d键,此时切换回主界面,Putty的 ...

  6. NGINX转发代理情况下,获取客户单真实IP

    编译时加上http_realip_module 模块 realip模块生效的前提是:直接连接nginx的ip是在set_real_ip_from中指定的. 原机配置: set_real_ip_from ...

  7. 条目二十一《总是让比较函数在等值情况下返回false》

    条目二十一<总是让比较函数在等值情况下返回false> 这条目对序列容器是不适合的,因为序列容器就是通过等值判断来比较的. 对于关联容器来说,比较是等价比较,所以要注意等值的时候,比较子的 ...

  8. 编写高质量代码改善C#程序的157个建议——建议16:元素数量可变的情况下不应使用数组

    建议16:元素数量可变的情况下不应使用数组 在C#中,数组一旦被创建,长度就不能改变.如果我们需要一个动态且可变长度的集合,就应该使用ArrayList或List<T>来创建. 而数组本身 ...

  9. mysql什么情况下会触发表锁

    锁是计算机协调多个进程或线程并发访问某一资源的机制.在数据库中,除传统的计算资源(如CPU.RAM.I/O等)的争用以外,数据也是一种供许多用户共享的资源.如何保证数据并发访问的一致性.有效性是所有数 ...

随机推荐

  1. NTCPMSG 开源高性能TCP消息发送组件

    https://www.cnblogs.com/eaglet/archive/2013/01/07/2849010.html 目前的.net 架构下缺乏高效的TCP消息发送组件,而这种组件是构建高性能 ...

  2. 下载完整版Chrome离线安装文件的官方地址

    只在自己账号下安装Download Google Chrome Standalone Offline Installer (32-bit)  http://www.google.com/chrome/ ...

  3. 使用maven编译Java项目

    摘要: 综述 本文演示了用Maven编译Java项目 需要 时间:15分钟 文本编辑器或者IDE JDK 6 或者更高版本 创建项目 本例主要为了展示Maven,所以Java的项目力求简单. 创建项目 ...

  4. ios中自定义图层

    图层和VIEW的区别 1:view不具备显示功能,是因view内部有一个图层,才能显示出来 2:图层不具备事件功能,VIEW继承UIRespone具有处理事件功能 3:自定义的图层有一个影式动画,VI ...

  5. Xcode修改新建项目注释模板(作者和公司名等)

    我们新建项目后,每个页面头部都有一段注释说明, 如下: 如果我们想修改Created by XXX 和 Copyright 版权内容,该如何做呢? 1.对于修改作者:Created by xxx 这里 ...

  6. Eclipse中10个最有用的快捷键组合(转)

    Eclipse中10个最有用的快捷键组合   一个Eclipse骨灰级开发者总结了他认为最有用但又不太为人所知的快捷键组合.通过这些组合可以更加容易的浏览源代码,使得整体的开发效率和质量得到提升.   ...

  7. spring hiberante 集成出现异常 java.lang.ClassNotFoundException: org.hibernate.engine.SessionFactoryImplementor

    出现如题的异常是由于hibernate和spring集成时的的版本不一致所导致. 如下面,所示,如果你用的hibneate 4.0及以上版本,那么将会报错,因为这里用的事务管理是hibernate 3 ...

  8. java.lang.IllegalStateException: Failed to load ApplicationContext selenium 异常 解决

    WARN <init>, HHH000409: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF R ...

  9. POJ 1486 Sorting Slides (KM)

    Sorting Slides Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2831   Accepted: 1076 De ...

  10. 利用hadoop来解决“共同好友”的问题

    假设A有好友B C D:B有好友A C D E:C有好友A B D E:D有好友A B C E;E有好友B C D. A -> B C D B -> A C D E C -> A B ...