You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/09/01 13:54:14 UTC
[incubator-linkis] branch dev-1.3.1 updated: [linkis-engineplugin-python] Modification of scala file floating red (#3196)
This is an automated email from the ASF dual-hosted git repository.
casion pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
new 3a0c37d41 [linkis-engineplugin-python] Modification of scala file floating red (#3196)
3a0c37d41 is described below
commit 3a0c37d414de54f0ab048693c219f731f0b5fd88
Author: 成彬彬 <10...@users.noreply.github.com>
AuthorDate: Thu Sep 1 21:54:10 2022 +0800
[linkis-engineplugin-python] Modification of scala file floating red (#3196)
---
.../engineplugin/python/executor/PythonSession.scala | 5 +++--
.../manager/engineplugin/python/utils/Kind.scala | 6 +++---
.../manager/engineplugin/python/utils/State.scala | 18 +++++++++---------
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/executor/PythonSession.scala b/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/executor/PythonSession.scala
index 653d0612e..a85fd6f43 100644
--- a/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/executor/PythonSession.scala
+++ b/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/executor/PythonSession.scala
@@ -87,9 +87,9 @@ class PythonSession extends Logging {
val userDefinePythonVersion = Some(pythonDefaultVersion).getOrElse("python")
logger.info(s"System userDefinePythonVersion => ${userDefinePythonVersion}")
val pythonExec =
- if ("python3".equalsIgnoreCase(userDefinePythonVersion))
+ if ("python3".equalsIgnoreCase(userDefinePythonVersion)) {
PythonEngineConfiguration.PYTHON_VERSION.getValue
- else "python"
+ } else { "python" }
logger.info(s"pythonExec => ${pythonExec}")
val port = {
val socket = new ServerSocket(0)
@@ -176,6 +176,7 @@ class PythonSession extends Logging {
this.code = Kind.getRealCode(code)
queryLock synchronized queryLock.notify()
try {
+ // scalastyle:off awaitresult
Await.result(promise.future, Duration.Inf)
} catch {
case t: Throwable =>
diff --git a/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/utils/Kind.scala b/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/utils/Kind.scala
index cf03011cc..9f5632cda 100644
--- a/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/utils/Kind.scala
+++ b/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/utils/Kind.scala
@@ -71,11 +71,11 @@ object Kind {
def getRealCode(code: String): String = {
val _code = StringUtils.strip(code)
val kindStr = getKindString(_code)
- if (kindStr.matches("[%|@][a-zA-Z]{1,12}"))
+ if (kindStr.matches("[%|@][a-zA-Z]{1,12}")) {
StringUtils.strip(_code.substring(_code.indexOf(kindStr) + kindStr.length))
- else if (_code.startsWith(RESTART_CODE))
+ } else if (_code.startsWith(RESTART_CODE)) {
StringUtils.strip(_code.substring(RESTART_CODE.length))
- else _code
+ } else _code
}
/**
diff --git a/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/utils/State.scala b/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/utils/State.scala
index 675af5ef1..32767db95 100644
--- a/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/utils/State.scala
+++ b/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/utils/State.scala
@@ -38,37 +38,37 @@ object State {
}
case class NotStarted() extends State {
- override def toString = "not_started"
+ override def toString: String = "not_started"
}
case class Starting() extends State {
- override def toString = "starting"
+ override def toString: String = "starting"
}
case class Idle() extends State {
- override def toString = "idle"
+ override def toString: String = "idle"
}
case class Running() extends State {
- override def toString = "running"
+ override def toString: String = "running"
}
case class Busy() extends State {
- override def toString = "busy"
+ override def toString: String = "busy"
}
case class Error() extends State {
- override def toString = "error"
+ override def toString: String = "error"
}
case class ShuttingDown() extends State {
- override def toString = "shutting_down"
+ override def toString: String = "shutting_down"
}
case class Dead() extends State {
- override def toString = "dead"
+ override def toString: String = "dead"
}
case class Success() extends State {
- override def toString = "success"
+ override def toString: String = "success"
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org