[KYUUBI #6549] Correctly handle empty Java options for engines
[KYUUBI #6549] Fix 'Could not find or load main class when launching engine' # 🔍 Description ## Issue References 🔗 This pull request fixes #6549 ## Describe Your Solution 🔧 When obtaining configuration items, if it is null or empty, return none ## Types of changes 🔖 - [ ] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 #### Behavior Without This Pull Request ⚰️ #### Behavior With This Pull Request 🎉 #### Related Unit Tests --- # Checklist 📝 - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6556 from LiJie20190102/launch_engine. Closes #6549 c57a08aff [lijie0203] [KYUUBI #6549] Fix 'Could not find or load main class when launching engine' 642d807e2 [lijie0203] [KYUUBI #6549] Fix 'Could not find or load main class when launching engine' 67926094c [lijie0203] [KYUUBI #6549] Fix 'Could not find or load main class when launching engine' 4ba9fb587 [lijie0203] [KYUUBI #6549] Fix 'Could not find or load main class when launching engine' Authored-by: lijie0203 <lijie@qishudi.com> Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
parent
2a990beb71
commit
edff97d3e9
@ -25,6 +25,7 @@ import java.nio.file.{Files, Paths}
|
||||
import scala.collection.JavaConverters._
|
||||
import scala.collection.mutable
|
||||
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.apache.flink.configuration.{Configuration, RestOptions}
|
||||
import org.apache.flink.runtime.minicluster.{MiniCluster, MiniClusterConfiguration}
|
||||
|
||||
@ -119,7 +120,7 @@ trait WithFlinkSQLEngineLocal extends KyuubiFunSuite with WithFlinkTestResources
|
||||
|
||||
val memory = conf.get(ENGINE_FLINK_MEMORY)
|
||||
command += s"-Xmx$memory"
|
||||
val javaOptions = conf.get(ENGINE_FLINK_JAVA_OPTIONS)
|
||||
val javaOptions = conf.get(ENGINE_FLINK_JAVA_OPTIONS).filter(StringUtils.isNotBlank(_))
|
||||
if (javaOptions.isDefined) {
|
||||
command += javaOptions.get
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ import scala.collection.JavaConverters._
|
||||
import scala.collection.mutable
|
||||
import scala.collection.mutable.ListBuffer
|
||||
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.apache.hadoop.conf.Configuration
|
||||
import org.apache.hadoop.fs.{FileSystem, Path}
|
||||
import org.apache.hadoop.fs.permission.FsPermission
|
||||
@ -201,7 +202,8 @@ abstract class EngineYarnModeSubmitter extends Logging {
|
||||
|
||||
val javaOpts = ListBuffer[String]()
|
||||
|
||||
val javaOptions = kyuubiConf.get(ENGINE_DEPLOY_YARN_MODE_JAVA_OPTIONS)
|
||||
val javaOptions =
|
||||
kyuubiConf.get(ENGINE_DEPLOY_YARN_MODE_JAVA_OPTIONS).filter(StringUtils.isNotBlank(_))
|
||||
if (javaOptions.isDefined) {
|
||||
javaOpts += javaOptions.get
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ import java.nio.file.{Files, Paths}
|
||||
import scala.collection.mutable
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
|
||||
import org.apache.kyuubi.{Logging, SCALA_COMPILE_VERSION, Utils}
|
||||
import org.apache.kyuubi.config.KyuubiConf
|
||||
@ -65,7 +66,7 @@ class ChatProcessBuilder(
|
||||
val memory = conf.get(ENGINE_CHAT_MEMORY)
|
||||
buffer += s"-Xmx$memory"
|
||||
|
||||
val javaOptions = conf.get(ENGINE_CHAT_JAVA_OPTIONS)
|
||||
val javaOptions = conf.get(ENGINE_CHAT_JAVA_OPTIONS).filter(StringUtils.isNotBlank(_))
|
||||
javaOptions.foreach(buffer += _)
|
||||
|
||||
val classpathEntries = new mutable.LinkedHashSet[String]
|
||||
|
||||
@ -23,6 +23,7 @@ import java.nio.file.{Files, Paths}
|
||||
import scala.collection.mutable
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
|
||||
import org.apache.kyuubi._
|
||||
import org.apache.kyuubi.config.KyuubiConf
|
||||
@ -152,7 +153,7 @@ class FlinkProcessBuilder(
|
||||
|
||||
val memory = conf.get(ENGINE_FLINK_MEMORY)
|
||||
buffer += s"-Xmx$memory"
|
||||
val javaOptions = conf.get(ENGINE_FLINK_JAVA_OPTIONS)
|
||||
val javaOptions = conf.get(ENGINE_FLINK_JAVA_OPTIONS).filter(StringUtils.isNotBlank(_))
|
||||
if (javaOptions.isDefined) {
|
||||
buffer += javaOptions.get
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ import java.nio.file.{Files, Paths}
|
||||
import scala.collection.mutable
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.apache.hadoop.security.UserGroupInformation
|
||||
|
||||
import org.apache.kyuubi._
|
||||
@ -62,7 +63,7 @@ class HiveProcessBuilder(
|
||||
|
||||
val memory = conf.get(ENGINE_HIVE_MEMORY)
|
||||
buffer += s"-Xmx$memory"
|
||||
val javaOptions = conf.get(ENGINE_HIVE_JAVA_OPTIONS)
|
||||
val javaOptions = conf.get(ENGINE_HIVE_JAVA_OPTIONS).filter(StringUtils.isNotBlank(_))
|
||||
if (javaOptions.isDefined) {
|
||||
buffer += javaOptions.get
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ import java.nio.file.Paths
|
||||
import scala.collection.mutable
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.apache.hadoop.security.UserGroupInformation
|
||||
|
||||
import org.apache.kyuubi.{KyuubiException, Logging, SCALA_COMPILE_VERSION, Utils}
|
||||
@ -71,7 +72,7 @@ class JdbcProcessBuilder(
|
||||
val memory = conf.get(ENGINE_JDBC_MEMORY)
|
||||
buffer += s"-Xmx$memory"
|
||||
|
||||
val javaOptions = conf.get(ENGINE_JDBC_JAVA_OPTIONS)
|
||||
val javaOptions = conf.get(ENGINE_JDBC_JAVA_OPTIONS).filter(StringUtils.isNotBlank(_))
|
||||
javaOptions.foreach(buffer += _)
|
||||
|
||||
val classpathEntries = new mutable.LinkedHashSet[String]
|
||||
|
||||
@ -23,6 +23,8 @@ import java.util
|
||||
import scala.collection.JavaConverters._
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
|
||||
import org.apache.kyuubi.{Logging, SCALA_COMPILE_VERSION, Utils}
|
||||
import org.apache.kyuubi.config.KyuubiConf
|
||||
import org.apache.kyuubi.config.KyuubiConf.{ENGINE_JDBC_EXTRA_CLASSPATH, ENGINE_JDBC_MEMORY}
|
||||
@ -93,7 +95,7 @@ class JdbcYarnModeProcessBuilder(
|
||||
private def jarFiles(isClasspath: Boolean): util.LinkedHashSet[String] = {
|
||||
val jarEntries = new util.LinkedHashSet[String]
|
||||
mainResource.foreach(jarEntries.add)
|
||||
val javaOptions = conf.get(ENGINE_JDBC_EXTRA_CLASSPATH)
|
||||
val javaOptions = conf.get(ENGINE_JDBC_EXTRA_CLASSPATH).filter(StringUtils.isNotBlank(_))
|
||||
if (isClasspath) {
|
||||
javaOptions.foreach(jarEntries.add)
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ import java.nio.file.Paths
|
||||
import scala.collection.mutable
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
|
||||
import org.apache.kyuubi.{Logging, SCALA_COMPILE_VERSION, Utils}
|
||||
import org.apache.kyuubi.config.KyuubiConf
|
||||
@ -62,7 +63,7 @@ class TrinoProcessBuilder(
|
||||
|
||||
val memory = conf.get(ENGINE_TRINO_MEMORY)
|
||||
buffer += s"-Xmx$memory"
|
||||
val javaOptions = conf.get(ENGINE_TRINO_JAVA_OPTIONS)
|
||||
val javaOptions = conf.get(ENGINE_TRINO_JAVA_OPTIONS).filter(StringUtils.isNotBlank(_))
|
||||
if (javaOptions.isDefined) {
|
||||
buffer += javaOptions.get
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user