hequn8128 commented on a change in pull request #10061: [FLINK-14581][python]
Let python UDF execution no longer rely on the flink directory structure to
support running python UDFs on yarn.
URL: https://github.com/apache/flink/pull/10061#discussion_r347247820
##########
File path:
flink-python/src/main/java/org/apache/flink/python/AbstractPythonFunctionRunner.java
##########
@@ -324,4 +366,40 @@ private static String randomString(Random random) {
* Returns the TypeSerializer for execution results.
*/
public abstract TypeSerializer<OUT> getOutputTypeSerializer();
+
+ private static Map<String, String> appendEnvironmentVariable(
+ Map<String, String> systemEnv,
+ List<String> pythonDependencies) {
+ String logDir = null;
+ if (System.getProperty("log.file") != null) {
+ try {
+ logDir = new
File(System.getProperty("log.file")).getParentFile().getAbsolutePath();
+ } catch (NullPointerException | SecurityException e) {
+ // the opertion may throw NPE and
SecurityException.
+ LOG.warn("Can not get the log directory from
property log.file.", e);
+ }
+ }
+ return appendEnvironmentVariable(
+ systemEnv,
+ pythonDependencies, logDir);
+ }
+
+ private static Map<String, String> appendEnvironmentVariable(
Review comment:
Merge this method with the previous `appendEnvironmentVariable`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services