Spark: Promote private SparkSubmitHook attributes used by strategy backends to public interface - #71059
Open
onlyarnav wants to merge 2 commits into
Open
Spark: Promote private SparkSubmitHook attributes used by strategy backends to public interface#71059onlyarnav wants to merge 2 commits into
onlyarnav wants to merge 2 commits into
Conversation
Fix implicit string literal concatenation missing a space between 'conflicts' and 'with' in _YarnSparkSubmitBackend.
…backends Promote internal SparkSubmitHook attributes (_conf, _kubernetes_driver_pod, _yarn_application_id, _poll_k8s_driver_via_api, etc.) to public properties and methods, and update operator deployment backends to use them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
During the refactoring of
SparkSubmitOperatorinto backend strategy classes (_KubernetesSparkSubmitBackend,_YarnSparkSubmitBackend,_StandaloneSparkSubmitBackend), the strategy backends reached directly into internal/private attributes and methods ofSparkSubmitHook:hook._confhook._kubernetes_driver_podhook._yarn_application_idhook._driver_id/hook._driver_statushook._connectionhook._poll_k8s_driver_via_api()hook._start_yarn_application_status_tracking()hook._kill_yarn_application()hook._start_driver_status_tracking()hook._run_post_submit_commands()Reaching into private
_members across class boundaries breaks object encapsulation.This PR promotes these key internal attributes and methods on
SparkSubmitHookto clean public interface members:@property def conf,@property def kubernetes_driver_pod(with setter),@property def yarn_application_id,@property def driver_id(with setter),@property def driver_status,@property def connection.poll_k8s_driver_via_api(),start_yarn_application_status_tracking(),kill_yarn_application(),start_driver_status_tracking(),run_post_submit_commands().The strategy backend classes in
spark_submit.pyhave been updated to use these clean public hook interfaces, and a unit test has been added totest_spark_submit.py.Related Context
Follow-up thought from PR #68679 review.
fixes: #71058