This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.3.0
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.3.0 by this push:
new 9e279fb72 fix: Scala code format alarm clear in linkis-engineconn-core
(#2909)
9e279fb72 is described below
commit 9e279fb72d2c5bcd5ae793e3e69259b7ba0ff095
Author: ruY <[email protected]>
AuthorDate: Sat Aug 20 19:40:33 2022 +0800
fix: Scala code format alarm clear in linkis-engineconn-core (#2909)
---
.../apache/linkis/engineconn/core/executor/ExecutorManager.scala | 9 ++++++---
.../org/apache/linkis/engineconn/launch/EngineConnServer.scala | 6 +++---
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git
a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-core/src/main/scala/org/apache/linkis/engineconn/core/executor/ExecutorManager.scala
b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-core/src/main/scala/org/apache/linkis/engineconn/core/executor/ExecutorManager.scala
index 5bca020b6..ba85aac96 100644
---
a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-core/src/main/scala/org/apache/linkis/engineconn/core/executor/ExecutorManager.scala
+++
b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-core/src/main/scala/org/apache/linkis/engineconn/core/executor/ExecutorManager.scala
@@ -98,7 +98,7 @@ class LabelExecutorManagerImpl extends LabelExecutorManager
with Logging {
logger.info(s"Try to create a executor with labels $labelStr.")
val labelExecutor = if (null == labels || labels.isEmpty) {
defaultFactory.createExecutor(engineCreationContext,
engineConn).asInstanceOf[LabelExecutor]
- } else
+ } else {
factories
.find {
case labelExecutorFactory: LabelExecutorFactory =>
@@ -117,6 +117,7 @@ class LabelExecutorManagerImpl extends LabelExecutorManager
with Logging {
.createExecutor(engineCreationContext, engineConn)
.asInstanceOf[LabelExecutor]
}
+ }
val codeType = LabelUtil.getCodeType(labelExecutor.getExecutorLabels())
logger.info(
s"Finished to create
${labelExecutor.getClass.getSimpleName}(${labelExecutor.getId}) with labels
$labelStr."
@@ -222,9 +223,11 @@ class LabelExecutorManagerImpl extends
LabelExecutorManager with Logging {
case labelExecutorFactory: CodeLanguageLabelExecutorFactory =>
Array[Label[_]](labelExecutorFactory.getDefaultCodeLanguageLabel)
case _ =>
- if (null == engineConn.getEngineCreationContext.getLabels())
Array.empty[Label[_]]
- else
+ if (null == engineConn.getEngineCreationContext.getLabels()) {
+ Array.empty[Label[_]]
+ } else {
engineConn.getEngineCreationContext.getLabels().toArray[Label[_]](Array.empty[Label[_]])
+ }
}
createExecutor(engineConn.getEngineCreationContext, labels)
} else {
diff --git
a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-core/src/main/scala/org/apache/linkis/engineconn/launch/EngineConnServer.scala
b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-core/src/main/scala/org/apache/linkis/engineconn/launch/EngineConnServer.scala
index fdbe2f261..24395463e 100644
---
a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-core/src/main/scala/org/apache/linkis/engineconn/launch/EngineConnServer.scala
+++
b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-core/src/main/scala/org/apache/linkis/engineconn/launch/EngineConnServer.scala
@@ -49,7 +49,7 @@ import org.apache.linkis.manager.label.entity.Label
import org.apache.commons.lang3.exception.ExceptionUtils
-import scala.collection.JavaConversions._
+import scala.collection.JavaConverters._
import scala.collection.mutable.ArrayBuffer
object EngineConnServer extends Logging {
@@ -140,10 +140,10 @@ object EngineConnServer extends Logging {
labels += labelBuilderFactory
.createLabel[Label[_]](key.replace(EngineConnArgumentsParser.LABEL_PREFIX, ""),
value)
}
- engineCreationContext.setLabels(labels.toList)
+ engineCreationContext.setLabels(labels.toList.asJava)
}
val jMap = new java.util.HashMap[String, String](engineConf.size)
- jMap.putAll(engineConf)
+ jMap.putAll(engineConf.asJava)
this.engineCreationContext.setOptions(jMap)
this.engineCreationContext.setArgs(args)
EngineConnObject.setEngineCreationContext(this.engineCreationContext)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]