You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2026/03/10 06:21:31 UTC
(spark-kubernetes-operator) branch main updated: [SPARK-55906] Remove unused `SparkAppStatusUtils.hasReachedState`
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 7ea22a9 [SPARK-55906] Remove unused `SparkAppStatusUtils.hasReachedState`
7ea22a9 is described below
commit 7ea22a9a972939f26973078cbb4b788627affad6
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Mon Mar 9 23:21:24 2026 -0700
[SPARK-55906] Remove unused `SparkAppStatusUtils.hasReachedState`
### What changes were proposed in this pull request?
This PR removes the unused `hasReachedState` method from `SparkAppStatusUtils`.
### Why are the changes needed?
The `hasReachedState` method is not referenced anywhere in the codebase (neither in production code nor in tests). Removing dead code improves maintainability.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-6)
Closes #543 from dongjoon-hyun/SPARK-55906.
Authored-by: Dongjoon Hyun <do...@apache.org>
Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
.../spark/k8s/operator/utils/SparkAppStatusUtils.java | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/SparkAppStatusUtils.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/SparkAppStatusUtils.java
index 841a0ba..cf2c70a 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/SparkAppStatusUtils.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/SparkAppStatusUtils.java
@@ -96,21 +96,4 @@ public final class SparkAppStatusUtils {
public static ApplicationState appExceededRetainDuration() {
return new ApplicationState(ResourceReleased, APP_EXCEEDED_RETAIN_DURATION_MESSAGE);
}
-
- /**
- * Checks if the application has reached a specific state in its transition history.
- *
- * @param application The SparkApplication to check.
- * @param stateToCheck The ApplicationState to look for.
- * @return True if the application has reached the state, false otherwise.
- */
- public static boolean hasReachedState(
- SparkApplication application, ApplicationState stateToCheck) {
- return isValidApplicationStatus(application)
- && application.getStatus().getStateTransitionHistory().keySet().parallelStream()
- .anyMatch(
- stateId ->
- stateToCheck.equals(
- application.getStatus().getStateTransitionHistory().get(stateId)));
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org