apache flink:我们能从窗口化的join apply函数中获得windowstarttime和windowendtime吗?

hl0ma9xz  于 2021-07-15  发布在  Flink
关注(0)|答案(0)|浏览(259)

我正在ApacheFlink中实现两个流的简单连接。我需要windowstarttime和windowendtime在窗口连接应用函数。有什么办法可以得到它们吗?我尝试了“getruntimecontext()”,但没有成功。    

  1. streamA.join(streamB)
  2. .where(new KeySelector<String, String>() {
  3. @Override
  4. public String getKey(String str) throws Exception {
  5. return str;
  6. }
  7. }).equalTo(new KeySelector<String, String>() {
  8. @Override
  9. public String getKey(String str) throws Exception {
  10. return str;
  11. }
  12. }).window(SlidingEventTimeWindows.of(Time.seconds(windowSize), Time.seconds(windowSlideStep)))
  13. .apply(new JoinFunction<String, String, String>(){
  14. @Override
  15. public String join(String x, String y) throws Exception {
  16. Long windowStartTime = ???
  17. Long windowEndTime = ???
  18. }});

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题