Re: How to retrieve values from yarn.taskmanager.env in a Job?

Posted by Shannon Carey on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/How-to-retrieve-values-from-yarn-taskmanager-env-in-a-Job-tp10566p10599.html

Hi Till,

Yes, System.getenv() was the first thing I tried. It'd be great if someone else can reproduce the issue, but for now I'll submit a JIRA with the assumption that it really is not working right. https://issues.apache.org/jira/browse/FLINK-5322

-Shannon

From: Till Rohrmann <[hidden email]>
Date: Monday, December 12, 2016 at 7:21 AM
To: <[hidden email]>
Subject: Re: How to retrieve values from yarn.taskmanager.env in a Job?

Hi Shannon,

have you tried accessing the environment variables via System.getenv()? This should give you a map of string-string key value pairs where the key is the environment variable name.

If your values are not set in the returned map, then this indicates a bug in Flink and it would be great if you could open a JIRA issue.

Cheers,
Till

​

On Fri, Dec 9, 2016 at 7:33 PM, Shannon Carey <[hidden email]> wrote:

I have configured a value within yarn.taskmanager.env, and I see it appearing in the Flink web UI in the list underneath Job Manager -> Configuration. However, I can't figure out how to retrieve the value from within a Flink job. It doesn't appear in the environment, the system properties, or my ParameterTool instance, and I can't figure out how I would get to it via the StreamExecutionEnvironment. Can anyone point me in the right direction?

All I want to do is inform my Flink jobs which environment they're running on, so that programmers don't have to specify the environment as a job parameter every time they run it. I also see that there is a "env.java.opts" configuration… does that work in YARN apps (would my jobs be able to see it?)

Thanks!
Shannon