7
7
8
8
9
9
class HistoryServer (BaseYarnAPI ):
10
+ """
11
+ The history server REST API's allow the user to get status on finished
12
+ applications. Currently it only supports MapReduce and provides
13
+ information on finished jobs.
14
+ """
10
15
def __init__ (self , address = None , port = 19888 , timeout = 30 ):
11
16
self .address , self .port , self .timeout = address , port , timeout
12
17
if address is None :
@@ -15,13 +20,21 @@ def __init__(self, address=None, port=19888, timeout=30):
15
20
self .address , self .port = address , port
16
21
17
22
def application_information (self ):
23
+ """
24
+ The history server information resource provides overall information
25
+ about the history server.
26
+ """
18
27
path = '/ws/v1/history/info'
19
28
20
29
return self .request (path )
21
30
22
31
def jobs (self , state = None , user = None , queue = None , limit = None ,
23
32
started_time_begin = None , started_time_end = None ,
24
33
finished_time_begin = None , finished_time_end = None ):
34
+ """
35
+ The jobs resource provides a list of the MapReduce jobs that have
36
+ finished. It does not currently return a full list of parameters.
37
+ """
25
38
path = '/ws/v1/history/mapreduce/jobs'
26
39
27
40
legal_states = set ([s for s , _ in JobStateInternal ])
@@ -44,28 +57,48 @@ def jobs(self, state=None, user=None, queue=None, limit=None,
44
57
return self .request (path , ** params )
45
58
46
59
def job (self , job_id ):
60
+ """
61
+ A Job resource contains information about a particular job identified
62
+ by jobid.
63
+ """
47
64
path = '/ws/v1/history/mapreduce/jobs/{jobid}' .format (jobid = job_id )
48
65
49
66
return self .request (path )
50
67
51
68
def job_attempts (self , job_id ):
69
+ """
70
+ With the job attempts API, you can obtain a collection of resources
71
+ that represent a job attempt.
72
+ """
52
73
path = '/ws/v1/history/mapreduce/jobs/{jobid}/jobattempts' .format (
53
74
jobid = job_id )
54
75
55
76
return self .request (path )
56
77
57
78
def job_counters (self , job_id ):
79
+ """
80
+ With the job counters API, you can object a collection of resources
81
+ that represent al the counters for that job.
82
+ """
58
83
path = '/ws/v1/history/mapreduce/jobs/{jobid}/counters' .format (
59
84
jobid = job_id )
60
85
61
86
return self .request (path )
62
87
63
88
def job_conf (self , job_id ):
89
+ """
90
+ A job configuration resource contains information about the job
91
+ configuration for this job.
92
+ """
64
93
path = '/ws/v1/history/mapreduce/jobs/{jobid}/conf' .format (jobid = job_id )
65
94
66
95
return self .request (path )
67
96
68
97
def job_tasks (self , job_id , type = None ):
98
+ """
99
+ With the tasks API, you can obtain a collection of resources that
100
+ represent a task within a job.
101
+ """
69
102
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks' .format (
70
103
jobid = job_id )
71
104
@@ -83,30 +116,50 @@ def job_tasks(self, job_id, type=None):
83
116
return self .request (path , ** params )
84
117
85
118
def job_task (self , job_id , task_id ):
119
+ """
120
+ A Task resource contains information about a particular task
121
+ within a job.
122
+ """
86
123
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}' .format (
87
124
jobid = job_id , taskid = task_id )
88
125
89
126
return self .request (path )
90
127
91
128
def task_counters (self , job_id , task_id ):
129
+ """
130
+ With the task counters API, you can object a collection of resources
131
+ that represent all the counters for that task.
132
+ """
92
133
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/counters' .format (
93
134
jobid = job_id , taskid = task_id )
94
135
95
136
return self .request (path )
96
137
97
138
def task_attempts (self , job_id , task_id ):
139
+ """
140
+ With the task attempts API, you can obtain a collection of resources
141
+ that represent a task attempt within a job.
142
+ """
98
143
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts' .format (
99
144
jobid = job_id , taskid = task_id )
100
145
101
146
return self .request (path )
102
147
103
148
def task_attempt (self , job_id , task_id , attempt_id ):
149
+ """
150
+ A Task Attempt resource contains information about a particular task
151
+ attempt within a job.
152
+ """
104
153
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempt/{attemptid}' .format (
105
154
jobid = job_id , taskid = task_id , attemptid = attempt_id )
106
155
107
156
return self .request (path )
108
157
109
158
def task_attempt_counters (self , job_id , task_id , attempt_id ):
159
+ """
160
+ With the task attempt counters API, you can object a collection of
161
+ resources that represent al the counters for that task attempt.
162
+ """
110
163
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempt/{attemptid}/counters' .format (
111
164
jobid = job_id , taskid = task_id , attemptid = attempt_id )
112
165
0 commit comments