This is an automated email from the ASF dual-hosted git repository.
peacewong 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 4c32ca1c8 [Optimize] add time when print log (#3831)
4c32ca1c8 is described below
commit 4c32ca1c81bf9e0212b66365436e9f44bb1f7d7a
Author: 人生有如两个橘子 <[email protected]>
AuthorDate: Thu Nov 17 11:14:20 2022 +0800
[Optimize] add time when print log (#3831)
* [Optimize] add time when print log
---
.../src/main/scala/org/apache/linkis/scheduler/queue/Job.scala | 2 +-
.../main/scala/org/apache/linkis/entrance/EntranceServer.scala | 5 ++++-
.../apache/linkis/entrance/execute/EntranceExecutorManager.scala | 8 +++++---
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git
a/linkis-commons/linkis-scheduler/src/main/scala/org/apache/linkis/scheduler/queue/Job.scala
b/linkis-commons/linkis-scheduler/src/main/scala/org/apache/linkis/scheduler/queue/Job.scala
index a746f9504..208715381 100644
---
a/linkis-commons/linkis-scheduler/src/main/scala/org/apache/linkis/scheduler/queue/Job.scala
+++
b/linkis-commons/linkis-scheduler/src/main/scala/org/apache/linkis/scheduler/queue/Job.scala
@@ -199,7 +199,7 @@ abstract class Job extends Runnable with SchedulerEvent
with Closeable with Logg
// TODO Add event(加事件)
case Scheduled =>
jobListener.foreach(_.onJobScheduled(this))
- logListener.foreach(_.onLogUpdate(this, "job is scheduled."))
+ logListener.foreach(_.onLogUpdate(this, LogUtils.generateInfo("job is
scheduled.")))
// TODO Add event(加事件)
case Running =>
jobListener.foreach(_.onJobRunning(this))
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/EntranceServer.scala
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/EntranceServer.scala
index 1080155b5..cc470d542 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/EntranceServer.scala
+++
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/EntranceServer.scala
@@ -18,6 +18,7 @@
package org.apache.linkis.entrance
import org.apache.linkis.common.exception.{ErrorException, LinkisException,
LinkisRuntimeException}
+import org.apache.linkis.common.log.LogUtils
import org.apache.linkis.common.utils.{Logging, Utils}
import org.apache.linkis.entrance.cs.CSEntranceHelper
import org.apache.linkis.entrance.errorcode.EntranceErrorCodeSummary._
@@ -149,7 +150,9 @@ abstract class EntranceServer extends Logging {
*/
Utils.tryAndWarn(job.getJobListener.foreach(_.onJobInited(job)))
getEntranceContext.getOrCreateScheduler().submit(job)
- val msg = s"Job with jobId : ${jobRequest.getId} and execID :
${job.getId()} submitted "
+ val msg = LogUtils.generateInfo(
+ s"Job with jobId : ${jobRequest.getId} and execID : ${job.getId()}
submitted "
+ )
logger.info(msg)
job match {
diff --git
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/execute/EntranceExecutorManager.scala
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/execute/EntranceExecutorManager.scala
index ff79a12c6..516b900b6 100644
---
a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/execute/EntranceExecutorManager.scala
+++
b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/execute/EntranceExecutorManager.scala
@@ -18,13 +18,12 @@
package org.apache.linkis.entrance.execute
import org.apache.linkis.common.exception.WarnException
+import org.apache.linkis.common.log.LogUtils
import org.apache.linkis.common.utils.{Logging, Utils}
-import org.apache.linkis.entrance.conf.EntranceConfiguration
import org.apache.linkis.entrance.errorcode.EntranceErrorCodeSummary._
import org.apache.linkis.entrance.exception.EntranceErrorException
import org.apache.linkis.entrance.job.EntranceExecutionJob
import org.apache.linkis.governance.common.entity.job.JobRequest
-import org.apache.linkis.manager.label.utils.LabelUtils
import org.apache.linkis.scheduler.executer.{Executor, ExecutorManager}
import org.apache.linkis.scheduler.queue.{GroupFactory, Job, SchedulerEvent}
@@ -104,7 +103,10 @@ abstract class EntranceExecutorManager(groupFactory:
GroupFactory)
new DefaultEntranceExecutor(idGenerator.incrementAndGet())
// getEngineConn Executor
job.getLogListener.foreach(
- _.onLogUpdate(job, "Your job is being scheduled by
orchestrator.")
+ _.onLogUpdate(
+ job,
+ LogUtils.generateInfo("Your job is being scheduled by
orchestrator.")
+ )
)
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]