Skip to content

Decouple SparkSubmitOperator resumable deployment backends for better…#68679

Open
onlyarnav wants to merge 1 commit into
apache:mainfrom
onlyarnav:refactor-spark-submit-resumable-backends
Open

Decouple SparkSubmitOperator resumable deployment backends for better…#68679
onlyarnav wants to merge 1 commit into
apache:mainfrom
onlyarnav:refactor-spark-submit-resumable-backends

Conversation

@onlyarnav

Copy link
Copy Markdown
Contributor

Description

The ResumableJobMixin implementation for SparkSubmitOperator previously had YARN, Kubernetes, and Standalone backend logics interleaved directly inside each mixin method. This scattered per-backend logic across multiple methods. Decoupling these by introducing specialized strategy classes per backend isolates the deployment-specific details, making the operator easier to maintain and extend.

This refactor:

  • Defines private strategy classes (_SparkSubmitDeploymentBackend, _KubernetesSparkSubmitBackend, _YarnSparkSubmitBackend, _StandaloneSparkSubmitBackend) to cleanly isolate the status and execution tracking logic of each deployment mode.
  • Resolves and caches the active deployment strategy exactly once using a private _backend cached property on SparkSubmitOperator.
  • Delegates all mixin methods (submit_job, get_job_status, is_job_active, is_job_succeeded, poll_until_complete, on_kill) directly to the active backend strategy.

This improves maintainability while keeping public namespaces completely clean.

fixes #68505

Was generative AI tooling used to co-author this PR?
  • Yes (claude code)

… maintainability

The ResumableJobMixin implementation for SparkSubmitOperator previously had YARN, Kubernetes, and Standalone backend logics interleaved directly inside each mixin method. This scattered per-backend logic across multiple methods. Decoupling these by introducing specialized strategy classes per backend isolates the deployment-specific details, making the operator easier to maintain and extend.
@onlyarnav

Copy link
Copy Markdown
Contributor Author

@SameerMesiah97 could you review the new PR please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor SparkSubmitOperator resumable backends into separate methods/classes

1 participant