From 10965d3dfb6a7dead47dbfc5b931cbc3ffa3a468 Mon Sep 17 00:00:00 2001 From: zwangsheng <2213335496@qq.com> Date: Wed, 29 Mar 2023 17:46:46 +0800 Subject: [PATCH] Rename fileter function => isSparkEnginePod --- .../kyuubi/engine/KubernetesApplicationOperation.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala index a3dc515fd6e..31753391113 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala @@ -154,7 +154,7 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging { } private class SparkEnginePodEventHandler extends ResourceEventHandler[Pod] { - private def filter(pod: Pod): Boolean = { + private def isSparkEnginePod(pod: Pod): Boolean = { pod.getMetadata.getLabels.containsKey(LABEL_KYUUBI_UNIQUE_KEY) } @@ -178,13 +178,13 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging { } override def onAdd(pod: Pod): Unit = { - if (filter(pod)) { + if (isSparkEnginePod(pod)) { updateState(pod) } } override def onUpdate(oldPod: Pod, newPod: Pod): Unit = { - if (filter(newPod)) { + if (isSparkEnginePod(newPod)) { updateState(newPod) toApplicationState(newPod.getStatus.getPhase) match { case FINISHED | FAILED | UNKNOWN => @@ -196,7 +196,7 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging { } override def onDelete(pod: Pod, deletedFinalStateUnknown: Boolean): Unit = { - if (filter(pod)) { + if (isSparkEnginePod(pod)) { updateState(pod) markDeleted(pod) }