You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/03/24 10:52:40 UTC

[incubator-linkis] branch dev-1.1.1 updated: Dev 1.1.1 ec task monitor bug fix (#1795)

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

peacewong pushed a commit to branch dev-1.1.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.1.1 by this push:
     new 0c2caca  Dev 1.1.1 ec task monitor bug fix (#1795)
0c2caca is described below

commit 0c2caca5b455e3607e3b43f0b4f7137bb77539ce
Author: Shang <no...@live.com>
AuthorDate: Thu Mar 24 18:52:35 2022 +0800

    Dev 1.1.1 ec task monitor bug fix (#1795)
    
    * Added comment for code-review
    
    * fixes #1781 [engineConn] moved configurable shutdown in monitor to service
    
    * [engineConn] ECTaskMonitor condition java to scala
    
    * [engineConn] ECTaskMonitor added license
    modified TODO position
    
    * [engineConn] ECTaskMonitor fixed a bug
---
 .../service/ECTaskEntranceMonitorService.scala     | 13 ++++++----
 ...CTaskEntranceMonitorServiceStartCondition.scala | 28 ----------------------
 2 files changed, 8 insertions(+), 33 deletions(-)

diff --git a/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/upstream/service/ECTaskEntranceMonitorService.scala b/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/upstream/service/ECTaskEntranceMonitorService.scala
index 2f752a4..82f0bfe 100644
--- a/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/upstream/service/ECTaskEntranceMonitorService.scala
+++ b/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/upstream/service/ECTaskEntranceMonitorService.scala
@@ -20,25 +20,28 @@ package org.apache.linkis.engineconn.computation.executor.upstream.service
 import javax.annotation.PostConstruct
 import org.apache.linkis.common.listener.Event
 import org.apache.linkis.common.utils.Logging
+import org.apache.linkis.engineconn.computation.executor.conf.ComputationExecutorConf
 import org.apache.linkis.engineconn.computation.executor.upstream.ECTaskEntranceMonitor
 import org.apache.linkis.engineconn.computation.executor.upstream.event.TaskStatusChangedForUpstreamMonitorEvent
 import org.apache.linkis.engineconn.computation.executor.upstream.listener.TaskStatusChangedForUpstreamMonitorListener
 import org.apache.linkis.engineconn.executor.listener.ExecutorListenerBusContext
 import org.apache.linkis.engineconn.executor.listener.event.EngineConnSyncEvent
 import org.apache.linkis.governance.common.entity.ExecutionNodeStatus
-import org.springframework.context.annotation.Conditional
+import org.springframework.stereotype.Component
 
-@Conditional(Array(classOf[ECTaskEntranceMonitorServiceStartCondition]))
+@Component
 class ECTaskEntranceMonitorService extends TaskStatusChangedForUpstreamMonitorListener with Logging {
 
   private val eCTaskEntranceMonitor = new ECTaskEntranceMonitor
   private val syncListenerBus = ExecutorListenerBusContext.getExecutorListenerBusContext.getEngineConnSyncListenerBus
 
-
   @PostConstruct
   def init(): Unit = {
-    syncListenerBus.addListener(this)
-    eCTaskEntranceMonitor.start
+    val shouldStartMonitor = ComputationExecutorConf.UPSTREAM_MONITOR_ECTASK_SHOULD_START
+    if (shouldStartMonitor) {
+      syncListenerBus.addListener(this)
+      eCTaskEntranceMonitor.start
+    }
   }
 
   override def onEvent(event: EngineConnSyncEvent): Unit = event match {
diff --git a/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/upstream/service/ECTaskEntranceMonitorServiceStartCondition.scala b/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/upstream/service/ECTaskEntranceMonitorServiceStartCondition.scala
deleted file mode 100644
index b23489f..0000000
--- a/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/upstream/service/ECTaskEntranceMonitorServiceStartCondition.scala
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.engineconn.computation.executor.upstream.service;
-
-
-import org.apache.linkis.engineconn.computation.executor.conf.ComputationExecutorConf
-import org.springframework.context.annotation.Condition
-import org.springframework.context.annotation.ConditionContext
-import org.springframework.core.`type`.AnnotatedTypeMetadata;
-
-class ECTaskEntranceMonitorServiceStartCondition extends Condition {
-  override def matches(conditionContext: ConditionContext, annotatedTypeMetadata: AnnotatedTypeMetadata): Boolean = ComputationExecutorConf.UPSTREAM_MONITOR_ECTASK_SHOULD_START
-}

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org