flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aljoscha Krettek <aljos...@apache.org>
Subject Re: Help with .getExecutionEnvironment() method
Date Fri, 07 Nov 2014 15:00:14 GMT
Hi,
ExecutionEnvironment has a static field contextEnvironment. When you
call getExecutionEnvironment it checks whether this is null. If it is
null it will return a LocalEnvironment, otherwise it will return the
context environment.

In Client.run() the Client creates a ContextEnvironment and calls
setAsContext() on it. This will put the env into the
contextEnvironment field of ExecutionEnvironment.

I think you don't have to deal with all this though. Can you just wrap
a normal ExecutionEnvironment inside your streaming-specific
environment? In that case, you could just use
ExecutionEnvironemnt.getExecutionEnvironment and wrap the result of
that. This is how it works in the Scala API. Have a look at
ExecutionEnvironment.scala, it's really just a wrapper.

Hope that helps. :D

Cheers,
Aljoscha

On Fri, Nov 7, 2014 at 3:24 PM, Gyula Fóra <gyfora@apache.org> wrote:
> Hey Guys,
>
> The .getExecutionEnvironment() method for the StreamingexecutionEnvironment
> does not work properly because we always return LocalEnvironment for
> running on the minicluster.
>
> I was trying to figure out how to fix this but I got lost in the code
> trying to find how you determine whether the program was executed
> standalone or the command line client.
>
> Could you help me out with some pointers here?
>
> Regards,
> Gyula

Mime
View raw message