You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by GitBox <gi...@apache.org> on 2022/04/26 11:36:18 UTC

[GitHub] [incubator-linkis] peacewong opened a new pull request, #2039: Fix the issue that the keys of put and remove in Map used in CliHeartbeatMonitor are not the same

peacewong opened a new pull request, #2039:
URL: https://github.com/apache/incubator-linkis/pull/2039

   ### What is the purpose of the change
   closed #2038
   
   ### Brief change log
   - Fix the issue that the keys of put and remove in Map used in CliHeartbeatMonitor are not the same


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] peacewong commented on a diff in pull request #2039: Fix the issue that the keys of put and remove in Map used in CliHeartbeatMonitor are not the same

Posted by GitBox <gi...@apache.org>.
peacewong commented on code in PR #2039:
URL: https://github.com/apache/incubator-linkis/pull/2039#discussion_r858690618


##########
linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/cli/heartbeat/CliHeartbeatMonitor.scala:
##########
@@ -38,38 +35,41 @@ class CliHeartbeatMonitor(handler: HeartbeatLossHandler) extends Logging {
 
   def panicIfNull(obj: Any, msg: String): Unit = {
     if (obj == null) {
-          throw new EntranceErrorException(EntranceErrorCode.VARIABLE_NULL_EXCEPTION.getErrCode, msg)
+      throw new EntranceErrorException(EntranceErrorCode.VARIABLE_NULL_EXCEPTION.getErrCode, msg)
     }
   }
 
   /*
   register for scan
    */
   def registerIfCliJob(job: Job): Unit = {
-    if (job.isInstanceOf[EntranceJob]) {
-      val entranceJob = job.asInstanceOf[EntranceJob]
-      if (isCliJob(entranceJob)) {
-        val id = job.getJobInfo.getId
-        if (infoMap.containsKey(id)) {
-          error("registered duplicate job!! job-id: " + id)
-        } else {
-          infoMap.put(id, entranceJob)
-          info("registered cli job: " + id)
+    job match {
+      case entranceJob: EntranceJob =>
+        if (isCliJob(entranceJob)) {
+          val id = entranceJob.getJobRequest.getId.toString
+          if (infoMap.containsKey(id)) {
+            error("registered duplicate job!! job-id: " + id)

Review Comment:
   > Using `job id:` in log printing is cleaner and should be consistent 日志打印中使用 job id 更清晰,而且应该保持统一
   
   Thanks. I will fix it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] casionone commented on a diff in pull request #2039: Fix the issue that the keys of put and remove in Map used in CliHeartbeatMonitor are not the same

Posted by GitBox <gi...@apache.org>.
casionone commented on code in PR #2039:
URL: https://github.com/apache/incubator-linkis/pull/2039#discussion_r858685064


##########
linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/cli/heartbeat/CliHeartbeatMonitor.scala:
##########
@@ -38,38 +35,41 @@ class CliHeartbeatMonitor(handler: HeartbeatLossHandler) extends Logging {
 
   def panicIfNull(obj: Any, msg: String): Unit = {
     if (obj == null) {
-          throw new EntranceErrorException(EntranceErrorCode.VARIABLE_NULL_EXCEPTION.getErrCode, msg)
+      throw new EntranceErrorException(EntranceErrorCode.VARIABLE_NULL_EXCEPTION.getErrCode, msg)
     }
   }
 
   /*
   register for scan
    */
   def registerIfCliJob(job: Job): Unit = {
-    if (job.isInstanceOf[EntranceJob]) {
-      val entranceJob = job.asInstanceOf[EntranceJob]
-      if (isCliJob(entranceJob)) {
-        val id = job.getJobInfo.getId
-        if (infoMap.containsKey(id)) {
-          error("registered duplicate job!! job-id: " + id)
-        } else {
-          infoMap.put(id, entranceJob)
-          info("registered cli job: " + id)
+    job match {
+      case entranceJob: EntranceJob =>
+        if (isCliJob(entranceJob)) {
+          val id = entranceJob.getJobRequest.getId.toString
+          if (infoMap.containsKey(id)) {
+            error("registered duplicate job!! job-id: " + id)

Review Comment:
   Using `job id:` in log printing is cleaner and should be consistent
   日志打印中使用 job id 更清晰,而且应该保持统一



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-linkis] casionone merged pull request #2039: Fix the issue that the keys of put and remove in Map used in CliHeartbeatMonitor are not the same

Posted by GitBox <gi...@apache.org>.
casionone merged PR #2039:
URL: https://github.com/apache/incubator-linkis/pull/2039


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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