TaskManager information during runtime

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

TaskManager information during runtime

omaralvarez
Hi,

I have a program that creates one StreamingSource for each port in which I want to receive data.

I'm trying to know the hostname of all the created sources, so I can send data to them from external processes.

Is there any other way during runtime other than using the REST API for obtaining the hostname in which the sources are executed? I cannot see in the documentation on how to do this with the Java API.

I tried to do it manually in the StreamingSource constructor, but I only get the hostname of the master thread.

Cheers,

Omar.
Reply | Threaded
Open this post in threaded view
|

Re: TaskManager information during runtime

Aljoscha Krettek
Hi,
you can implement a RichSourceFunction. With this you can also implement open() and close() methods that get called when your source is started on the worker node and closed respectively. In there, you could determine the hostname and send it to some centralized service so that it knows the hostnames of all the running sources.

Cheers,
Aljoscha

On Tue, 21 Jun 2016 at 19:50 omaralvarez <[hidden email]> wrote:
Hi,

I have a program that creates one StreamingSource for each port in which I
want to receive data.

I'm trying to know the hostname of all the created sources, so I can send
data to them from external processes.

Is there any other way during runtime other than using the REST API for
obtaining the hostname in which the sources are executed? I cannot see in
the documentation on how to do this with the Java API.

I tried to do it manually in the StreamingSource constructor, but I only get
the hostname of the master thread.

Cheers,

Omar.



--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/TaskManager-information-during-runtime-tp7655.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: TaskManager information during runtime

omaralvarez
Thanks, this is exactly what I was looking for.

Cheers,

Omar.