This is an automated email from the ASF dual-hosted git repository.

peacewong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/linkis.git


The following commit(s) were added to refs/heads/master by this push:
     new d16f6a3be [Feature][1.5.0] Load user-defined log4j.properties (#5023)
d16f6a3be is described below

commit d16f6a3bef86dfaa621e0d94ce56d3052512da0b
Author: yangwenzea <[email protected]>
AuthorDate: Fri Dec 8 23:26:17 2023 +0800

    [Feature][1.5.0] Load user-defined log4j.properties (#5023)
    
    * flink-log4j
    
    * code format
---
 .../launch/FlinkEngineConnLaunchBuilder.scala      | 28 ++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git 
a/linkis-engineconn-plugins/flink/flink-core/src/main/scala/org/apache/linkis/engineconnplugin/flink/launch/FlinkEngineConnLaunchBuilder.scala
 
b/linkis-engineconn-plugins/flink/flink-core/src/main/scala/org/apache/linkis/engineconnplugin/flink/launch/FlinkEngineConnLaunchBuilder.scala
index cbcae4ea5..70b3ad1b2 100644
--- 
a/linkis-engineconn-plugins/flink/flink-core/src/main/scala/org/apache/linkis/engineconnplugin/flink/launch/FlinkEngineConnLaunchBuilder.scala
+++ 
b/linkis-engineconn-plugins/flink/flink-core/src/main/scala/org/apache/linkis/engineconnplugin/flink/launch/FlinkEngineConnLaunchBuilder.scala
@@ -24,8 +24,19 @@ import org.apache.linkis.hadoop.common.conf.HadoopConf
 import org.apache.linkis.manager.common.protocol.bml.BmlResource
 import org.apache.linkis.manager.engineplugin.common.conf.EnvConfiguration
 import 
org.apache.linkis.manager.engineplugin.common.launch.entity.EngineConnBuildRequest
-import 
org.apache.linkis.manager.engineplugin.common.launch.process.Environment.{variable,
 USER}
-import 
org.apache.linkis.manager.engineplugin.common.launch.process.JavaProcessEngineConnLaunchBuilder
+import org.apache.linkis.manager.engineplugin.common.launch.process.{
+  Environment,
+  JavaProcessEngineConnLaunchBuilder
+}
+import 
org.apache.linkis.manager.engineplugin.common.launch.process.Environment.{
+  variable,
+  PWD,
+  USER
+}
+import 
org.apache.linkis.manager.engineplugin.common.launch.process.LaunchConstants.{
+  addPathToClassPath,
+  CLASS_PATH_SEPARATOR
+}
 import org.apache.linkis.manager.label.entity.engine.UserCreatorLabel
 
 import java.util
@@ -82,6 +93,19 @@ class FlinkEngineConnLaunchBuilder extends 
JavaProcessEngineConnLaunchBuilder {
     bmlResources
   }
 
+  override def getEnvironment(implicit
+      engineConnBuildRequest: EngineConnBuildRequest
+  ): util.Map[String, String] = {
+    val environment = new util.HashMap[String, String]
+    addPathToClassPath(environment, variable(PWD))
+    val linkisEnvironment = super.getEnvironment
+    val linkisClassPath = linkisEnvironment.get(Environment.CLASSPATH.toString)
+    val v = environment.get(Environment.CLASSPATH.toString) + 
CLASS_PATH_SEPARATOR + linkisClassPath
+    environment.put(Environment.CLASSPATH.toString, v)
+    logger.info(environment.asScala.map(e => 
s"${e._1}->${e._2}").mkString(","))
+    environment
+  }
+
   private def contentToBmlResource(userName: String, content: String): 
BmlResource = {
     val contentMap = JsonUtils.jackson.readValue(content, 
classOf[util.Map[String, Object]])
     contentToBmlResource(userName, contentMap)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to