Skip to content

Commit

Permalink
Rename fileter function => isSparkEnginePod
Browse files Browse the repository at this point in the history
  • Loading branch information
zwangsheng committed Mar 29, 2023
1 parent b026771 commit 10965d3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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 =>
Expand All @@ -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)
}
Expand Down

0 comments on commit 10965d3

Please sign in to comment.