This might seem like a very complex problem to some of you. I want to use Apache Flink to apply some algorithms on data from a SocketStream. However, these algorithms are external executables that I am running using Scala's sys.process package. Here is what I want Flink to do:
Get individual lines from SocketStream:
val text = env.socketTextStream(hostName, port) val lines = text.flatMap { _.toLowerCase.split("\\n") filter { _.nonEmpty } }Call my executable algorithm with these lines as command line parameters. Somewhat like this:
var op = "./Somefile.py "+lines!Print the output I get from the executable.
op.print()
Obviously this is not the correct way to do what I am trying to do as op unlike lines is not a data sink and thus nothing is getting printed. Is there some way I can achieve this?