使用其他基本运算符是否可能具有与 CoFlatMapFunction 相同的行为? [英] Is that possible to have the same behavior of CoFlatMapFunction using other basic operators?

查看:32
本文介绍了使用其他基本运算符是否可能具有与 CoFlatMapFunction 相同的行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我使用 CoFlatMapFunction (https://ci.apache.org/projects/flink/flink-docs-stable/api/java/org/apache/flink/streaming/api/functions/co/CoFlatMapFunction.html) 来过滤流并在运行时更改过滤器参数,我为此使用 Flink.我想使用 Apache Edgent TStream (https://edgent.incubator.apache.org/javadoc/latest/org/apache/edgent/topology/TStream.html),但它没有 CoFlatMapFunction.如果我使用 Union 它将不起作用,因为流不同并且我不允许进行联合.如果我使用 Filter 我不会有我想要的动态行为.有什么建议吗?

Basically, I am using CoFlatMapFunction (https://ci.apache.org/projects/flink/flink-docs-stable/api/java/org/apache/flink/streaming/api/functions/co/CoFlatMapFunction.html) to filter a stream and change the filter parameters at runtime and I am using Flink for that. I want to do the same using Apache Edgent TStream (https://edgent.incubator.apache.org/javadoc/latest/org/apache/edgent/topology/TStream.html), but it does not have CoFlatMapFunction. If I use Union it will not work because the streams are different and I am not allowed to do union. If I use Filter I will not have the dynamic behavior that I want. Any suggestion?

谢谢

推荐答案

使用 Flink,您可以通过使用任何一种来强制对不同类型的流进行联合.它有点老套,但它似乎也可以与 Apache Edgent 一起使用.

Using Flink you can force a Union on streams of different types by using Either. It's a bit hacky, but it seems like it could work with Apache Edgent as well.

更新:

我刚刚在学习 Edgent,但它似乎有控制流的概念:https://edgent.apache.org/recipes/recipe_adaptable_filter_range.html.

I'm just learning about Edgent, but it seems to have a notion of control streams: https://edgent.apache.org/recipes/recipe_adaptable_filter_range.html.

这篇关于使用其他基本运算符是否可能具有与 CoFlatMapFunction 相同的行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆