-
Notifications
You must be signed in to change notification settings - Fork 245
Expand file tree
/
Copy path_abc.py
More file actions
59 lines (47 loc) · 2.15 KB
/
Copy path_abc.py
File metadata and controls
59 lines (47 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from abc import ABC, abstractmethod
from typing import Dict, List, Optional, Tuple
class SparkJobLauncher(ABC):
"""This is the abstract class for all the spark launchers. All the Spark launcher should implement those interfaces
"""
@abstractmethod
def upload_or_get_cloud_path(self, local_path_or_http_path: str):
"""upload a file from local path or an http path to the current work directory. Should support transferring file from an http path to cloud working storage, or upload directly from a local storage.
Args:
local_path_or_http_path (str): local path or http path
"""
pass
@abstractmethod
def submit_feathr_job(self, job_name: str, main_jar_path: str, main_class_name: str, arguments: List[str],
reference_files_path: List[str], job_tags: Dict[str, str] = None,
configuration: Dict[str, str] = {}, properties: Dict[str, str] = None):
"""
Submits the feathr job
Args:
job_name (str): name of the job
main_jar_path (str): main file paths, usually your main jar file
main_class_name (str): name of your main class
arguments (str): all the arguments you want to pass into the spark job
job_tags (str): tags of the job, for example you might want to put your user ID, or a tag with a certain information
configuration (Dict[str, str]): Additional configs for the spark job
properties (Dict[str, str]): Additional System Properties for the spark job
"""
pass
@abstractmethod
def wait_for_completion(self, timeout_seconds: Optional[float]) -> bool:
"""Returns true if the job completed successfully
Args:
timeout_seconds (Optional[float]): time out secs
Returns:
bool: Returns true if the job completed successfully, otherwise False
"""
pass
@abstractmethod
def get_status(self) -> str:
"""
Get current job status
Returns:
str: Status of the current job
Returns:
str: _description_
"""
pass