gigl.src.common.utils.spark_job_manager#
Attributes#
Classes#
Functions#
|
Return the Dataproc cluster name the split generator uses for |
|
Return the Dataproc cluster name the subgraph sampler uses for |
Module Contents#
- class gigl.src.common.utils.spark_job_manager.DataprocClusterInitData[source]#
-
- init_script_uri: gigl.common.GcsUri | None = None[source]#
- class gigl.src.common.utils.spark_job_manager.SparkJobManager(project, region, cluster_name)[source]#
- Parameters:
project (str)
region (str)
cluster_name (str)
- create_dataproc_cluster(cluster_init_data, use_spark35=False)[source]#
- Parameters:
cluster_init_data (DataprocClusterInitData)
use_spark35 (bool)
- static get_sanitized_dataproc_cluster_name(cluster_name)[source]#
Make a name valid for Dataproc:
_to-, at most 50 characters, no trailing-.Dataproc cluster names must match
(?:[a-z](?:[-a-z0-9]{0,49}[a-z0-9])?). This is the single source of the rule; the subgraph sampler, the split generator, and job cleanup all build cluster names through it.Example
>>> SparkJobManager.get_sanitized_dataproc_cluster_name("sgs_my_job") 'sgs-my-job'
- Parameters:
cluster_name (str) – Raw cluster name.
- Returns:
The sanitized cluster name.
- Return type:
str
- submit_and_wait_scala_spark_job(main_jar_file_uri, max_job_duration, runtime_args=[], extra_jar_file_uris=[], use_spark35=False)[source]#
- Parameters:
main_jar_file_uri (gigl.common.Uri)
max_job_duration (datetime.timedelta)
runtime_args (list[str])
extra_jar_file_uris (list[str])
use_spark35 (bool)
- gigl.src.common.utils.spark_job_manager.build_split_generator_cluster_name(job_name)[source]#
Return the Dataproc cluster name the split generator uses for
job_name.Example
>>> build_split_generator_cluster_name("my_job") 'split-my-job'
- Parameters:
job_name (str) – The GiGL applied task identifier.
- Returns:
The sanitized cluster name.
- Return type:
str
- gigl.src.common.utils.spark_job_manager.build_subgraph_sampler_cluster_name(job_name)[source]#
Return the Dataproc cluster name the subgraph sampler uses for
job_name.Example
>>> build_subgraph_sampler_cluster_name("my_job") 'sgs-my-job'
- Parameters:
job_name (str) – The GiGL applied task identifier.
- Returns:
The sanitized cluster name.
- Return type:
str