elephant-driver 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +44 -0
- data/Rakefile +75 -0
- data/VERSION +1 -0
- data/lib/elephant-driver.rb +19 -0
- data/lib/elephant-driver/client.rb +69 -0
- data/lib/elephant-driver/job.rb +127 -0
- data/lib/elephant-driver/task.rb +46 -0
- data/lib/elephant-driver/thrift/common.thrift +129 -0
- data/lib/elephant-driver/thrift/common_constants.rb +12 -0
- data/lib/elephant-driver/thrift/common_types.rb +209 -0
- data/lib/elephant-driver/thrift/hadoop_service_base.rb +314 -0
- data/lib/elephant-driver/thrift/jobtracker.rb +1466 -0
- data/lib/elephant-driver/thrift/jobtracker.thrift +478 -0
- data/lib/elephant-driver/thrift/jobtracker_constants.rb +14 -0
- data/lib/elephant-driver/thrift/jobtracker_types.rb +735 -0
- data/lib/elephant-driver/tracker.rb +10 -0
- data/lib/elephant-driver/version.rb +5 -0
- metadata +85 -0
@@ -0,0 +1,735 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'common_types'
|
8
|
+
|
9
|
+
|
10
|
+
module Hadoop
|
11
|
+
module API
|
12
|
+
module Jobtracker
|
13
|
+
module ThriftTaskType
|
14
|
+
MAP = 0
|
15
|
+
REDUCE = 1
|
16
|
+
JOB_SETUP = 2
|
17
|
+
JOB_CLEANUP = 3
|
18
|
+
TASK_CLEANUP = 4
|
19
|
+
VALUE_MAP = {0 => "MAP", 1 => "REDUCE", 2 => "JOB_SETUP", 3 => "JOB_CLEANUP", 4 => "TASK_CLEANUP"}
|
20
|
+
VALID_VALUES = Set.new([MAP, REDUCE, JOB_SETUP, JOB_CLEANUP, TASK_CLEANUP]).freeze
|
21
|
+
end
|
22
|
+
|
23
|
+
module ThriftTaskState
|
24
|
+
RUNNING = 0
|
25
|
+
SUCCEEDED = 1
|
26
|
+
FAILED = 2
|
27
|
+
UNASSIGNED = 3
|
28
|
+
KILLED = 4
|
29
|
+
COMMIT_PENDING = 5
|
30
|
+
FAILED_UNCLEAN = 6
|
31
|
+
KILLED_UNCLEAN = 7
|
32
|
+
VALUE_MAP = {0 => "RUNNING", 1 => "SUCCEEDED", 2 => "FAILED", 3 => "UNASSIGNED", 4 => "KILLED", 5 => "COMMIT_PENDING", 6 => "FAILED_UNCLEAN", 7 => "KILLED_UNCLEAN"}
|
33
|
+
VALID_VALUES = Set.new([RUNNING, SUCCEEDED, FAILED, UNASSIGNED, KILLED, COMMIT_PENDING, FAILED_UNCLEAN, KILLED_UNCLEAN]).freeze
|
34
|
+
end
|
35
|
+
|
36
|
+
module ThriftTaskPhase
|
37
|
+
STARTING = 0
|
38
|
+
MAP = 1
|
39
|
+
SHUFFLE = 2
|
40
|
+
SORT = 3
|
41
|
+
REDUCE = 4
|
42
|
+
CLEANUP = 5
|
43
|
+
VALUE_MAP = {0 => "STARTING", 1 => "MAP", 2 => "SHUFFLE", 3 => "SORT", 4 => "REDUCE", 5 => "CLEANUP"}
|
44
|
+
VALID_VALUES = Set.new([STARTING, MAP, SHUFFLE, SORT, REDUCE, CLEANUP]).freeze
|
45
|
+
end
|
46
|
+
|
47
|
+
module ThriftTaskQueryState
|
48
|
+
SUCCEEDED = 0
|
49
|
+
FAILED = 1
|
50
|
+
RUNNING = 2
|
51
|
+
PENDING = 3
|
52
|
+
KILLED = 4
|
53
|
+
VALUE_MAP = {0 => "SUCCEEDED", 1 => "FAILED", 2 => "RUNNING", 3 => "PENDING", 4 => "KILLED"}
|
54
|
+
VALID_VALUES = Set.new([SUCCEEDED, FAILED, RUNNING, PENDING, KILLED]).freeze
|
55
|
+
end
|
56
|
+
|
57
|
+
module ThriftJobPriority
|
58
|
+
VERY_HIGH = 0
|
59
|
+
HIGH = 1
|
60
|
+
NORMAL = 2
|
61
|
+
LOW = 3
|
62
|
+
VERY_LOW = 4
|
63
|
+
VALUE_MAP = {0 => "VERY_HIGH", 1 => "HIGH", 2 => "NORMAL", 3 => "LOW", 4 => "VERY_LOW"}
|
64
|
+
VALID_VALUES = Set.new([VERY_HIGH, HIGH, NORMAL, LOW, VERY_LOW]).freeze
|
65
|
+
end
|
66
|
+
|
67
|
+
module JobTrackerState
|
68
|
+
INITIALIZING = 0
|
69
|
+
RUNNING = 1
|
70
|
+
VALUE_MAP = {0 => "INITIALIZING", 1 => "RUNNING"}
|
71
|
+
VALID_VALUES = Set.new([INITIALIZING, RUNNING]).freeze
|
72
|
+
end
|
73
|
+
|
74
|
+
module ThriftJobState
|
75
|
+
RUNNING = 1
|
76
|
+
SUCCEEDED = 2
|
77
|
+
FAILED = 3
|
78
|
+
PREP = 4
|
79
|
+
KILLED = 5
|
80
|
+
VALUE_MAP = {1 => "RUNNING", 2 => "SUCCEEDED", 3 => "FAILED", 4 => "PREP", 5 => "KILLED"}
|
81
|
+
VALID_VALUES = Set.new([RUNNING, SUCCEEDED, FAILED, PREP, KILLED]).freeze
|
82
|
+
end
|
83
|
+
|
84
|
+
# Unique identifier for each job
|
85
|
+
class ThriftJobID
|
86
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
87
|
+
JOBTRACKERID = 1
|
88
|
+
JOBID = 2
|
89
|
+
ASSTRING = 3
|
90
|
+
|
91
|
+
FIELDS = {
|
92
|
+
# Unique id of jobtracker
|
93
|
+
JOBTRACKERID => {:type => ::Thrift::Types::STRING, :name => 'jobTrackerID'},
|
94
|
+
# Unique (to JT) job id
|
95
|
+
JOBID => {:type => ::Thrift::Types::I32, :name => 'jobID'},
|
96
|
+
# Flattened as a string
|
97
|
+
ASSTRING => {:type => ::Thrift::Types::STRING, :name => 'asString'}
|
98
|
+
}
|
99
|
+
|
100
|
+
def struct_fields; FIELDS; end
|
101
|
+
|
102
|
+
def validate
|
103
|
+
end
|
104
|
+
|
105
|
+
::Thrift::Struct.generate_accessors self
|
106
|
+
end
|
107
|
+
|
108
|
+
# Description of a job queue
|
109
|
+
class ThriftJobQueueInfo
|
110
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
111
|
+
QUEUENAME = 1
|
112
|
+
SCHEDULINGINFO = 2
|
113
|
+
|
114
|
+
FIELDS = {
|
115
|
+
QUEUENAME => {:type => ::Thrift::Types::STRING, :name => 'queueName'},
|
116
|
+
SCHEDULINGINFO => {:type => ::Thrift::Types::STRING, :name => 'schedulingInfo'}
|
117
|
+
}
|
118
|
+
|
119
|
+
def struct_fields; FIELDS; end
|
120
|
+
|
121
|
+
def validate
|
122
|
+
end
|
123
|
+
|
124
|
+
::Thrift::Struct.generate_accessors self
|
125
|
+
end
|
126
|
+
|
127
|
+
class ThriftJobQueueList
|
128
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
129
|
+
QUEUES = 1
|
130
|
+
|
131
|
+
FIELDS = {
|
132
|
+
QUEUES => {:type => ::Thrift::Types::LIST, :name => 'queues', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftJobQueueInfo}}
|
133
|
+
}
|
134
|
+
|
135
|
+
def struct_fields; FIELDS; end
|
136
|
+
|
137
|
+
def validate
|
138
|
+
end
|
139
|
+
|
140
|
+
::Thrift::Struct.generate_accessors self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Counter which represents some custom job metric
|
144
|
+
class ThriftCounter
|
145
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
146
|
+
NAME = 1
|
147
|
+
DISPLAYNAME = 2
|
148
|
+
VALUE = 3
|
149
|
+
|
150
|
+
FIELDS = {
|
151
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
|
152
|
+
DISPLAYNAME => {:type => ::Thrift::Types::STRING, :name => 'displayName'},
|
153
|
+
VALUE => {:type => ::Thrift::Types::I64, :name => 'value'}
|
154
|
+
}
|
155
|
+
|
156
|
+
def struct_fields; FIELDS; end
|
157
|
+
|
158
|
+
def validate
|
159
|
+
end
|
160
|
+
|
161
|
+
::Thrift::Struct.generate_accessors self
|
162
|
+
end
|
163
|
+
|
164
|
+
# Counters are organized by group
|
165
|
+
class ThriftCounterGroup
|
166
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
167
|
+
NAME = 1
|
168
|
+
DISPLAYNAME = 2
|
169
|
+
COUNTERS = 3
|
170
|
+
|
171
|
+
FIELDS = {
|
172
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
|
173
|
+
DISPLAYNAME => {:type => ::Thrift::Types::STRING, :name => 'displayName'},
|
174
|
+
COUNTERS => {:type => ::Thrift::Types::MAP, :name => 'counters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftCounter}}
|
175
|
+
}
|
176
|
+
|
177
|
+
def struct_fields; FIELDS; end
|
178
|
+
|
179
|
+
def validate
|
180
|
+
end
|
181
|
+
|
182
|
+
::Thrift::Struct.generate_accessors self
|
183
|
+
end
|
184
|
+
|
185
|
+
# Container structure for counter groups
|
186
|
+
class ThriftGroupList
|
187
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
188
|
+
GROUPS = 1
|
189
|
+
|
190
|
+
FIELDS = {
|
191
|
+
GROUPS => {:type => ::Thrift::Types::LIST, :name => 'groups', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftCounterGroup}}
|
192
|
+
}
|
193
|
+
|
194
|
+
def struct_fields; FIELDS; end
|
195
|
+
|
196
|
+
def validate
|
197
|
+
end
|
198
|
+
|
199
|
+
::Thrift::Struct.generate_accessors self
|
200
|
+
end
|
201
|
+
|
202
|
+
# Counters for map tasks only, reduce tasks only, and job-scoped counters
|
203
|
+
class ThriftJobCounterRollups
|
204
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
205
|
+
MAPCOUNTERS = 1
|
206
|
+
REDUCECOUNTERS = 2
|
207
|
+
JOBCOUNTERS = 3
|
208
|
+
|
209
|
+
FIELDS = {
|
210
|
+
MAPCOUNTERS => {:type => ::Thrift::Types::STRUCT, :name => 'mapCounters', :class => Hadoop::API::Jobtracker::ThriftGroupList},
|
211
|
+
REDUCECOUNTERS => {:type => ::Thrift::Types::STRUCT, :name => 'reduceCounters', :class => Hadoop::API::Jobtracker::ThriftGroupList},
|
212
|
+
JOBCOUNTERS => {:type => ::Thrift::Types::STRUCT, :name => 'jobCounters', :class => Hadoop::API::Jobtracker::ThriftGroupList}
|
213
|
+
}
|
214
|
+
|
215
|
+
def struct_fields; FIELDS; end
|
216
|
+
|
217
|
+
def validate
|
218
|
+
end
|
219
|
+
|
220
|
+
::Thrift::Struct.generate_accessors self
|
221
|
+
end
|
222
|
+
|
223
|
+
# Unique task id
|
224
|
+
class ThriftTaskID
|
225
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
226
|
+
JOBID = 1
|
227
|
+
TASKTYPE = 2
|
228
|
+
TASKID = 3
|
229
|
+
ASSTRING = 4
|
230
|
+
|
231
|
+
FIELDS = {
|
232
|
+
# ID of the job to which the task belongs
|
233
|
+
JOBID => {:type => ::Thrift::Types::STRUCT, :name => 'jobID', :class => Hadoop::API::Jobtracker::ThriftJobID},
|
234
|
+
# What kind of task is this?
|
235
|
+
TASKTYPE => {:type => ::Thrift::Types::I32, :name => 'taskType', :enum_class => Hadoop::API::Jobtracker::ThriftTaskType},
|
236
|
+
# Unique (to job) task id
|
237
|
+
TASKID => {:type => ::Thrift::Types::I32, :name => 'taskID'},
|
238
|
+
# Flattened to a unique string
|
239
|
+
ASSTRING => {:type => ::Thrift::Types::STRING, :name => 'asString'}
|
240
|
+
}
|
241
|
+
|
242
|
+
def struct_fields; FIELDS; end
|
243
|
+
|
244
|
+
def validate
|
245
|
+
unless @taskType.nil? || Hadoop::API::Jobtracker::ThriftTaskType::VALID_VALUES.include?(@taskType)
|
246
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field taskType!')
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
::Thrift::Struct.generate_accessors self
|
251
|
+
end
|
252
|
+
|
253
|
+
# Unique task attempt id
|
254
|
+
class ThriftTaskAttemptID
|
255
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
256
|
+
TASKID = 1
|
257
|
+
ATTEMPTID = 2
|
258
|
+
ASSTRING = 3
|
259
|
+
|
260
|
+
FIELDS = {
|
261
|
+
TASKID => {:type => ::Thrift::Types::STRUCT, :name => 'taskID', :class => Hadoop::API::Jobtracker::ThriftTaskID},
|
262
|
+
ATTEMPTID => {:type => ::Thrift::Types::I32, :name => 'attemptID'},
|
263
|
+
ASSTRING => {:type => ::Thrift::Types::STRING, :name => 'asString'}
|
264
|
+
}
|
265
|
+
|
266
|
+
def struct_fields; FIELDS; end
|
267
|
+
|
268
|
+
def validate
|
269
|
+
end
|
270
|
+
|
271
|
+
::Thrift::Struct.generate_accessors self
|
272
|
+
end
|
273
|
+
|
274
|
+
# Describes the current state of a single attempt
|
275
|
+
class ThriftTaskStatus
|
276
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
277
|
+
TASKID = 1
|
278
|
+
PROGRESS = 2
|
279
|
+
STATE = 3
|
280
|
+
DIAGNOSTICINFO = 4
|
281
|
+
STATESTRING = 5
|
282
|
+
TASKTRACKER = 6
|
283
|
+
STARTTIME = 7
|
284
|
+
FINISHTIME = 8
|
285
|
+
OUTPUTSIZE = 9
|
286
|
+
PHASE = 10
|
287
|
+
COUNTERS = 11
|
288
|
+
SHUFFLEFINISHTIME = 12
|
289
|
+
SORTFINISHTIME = 13
|
290
|
+
MAPFINISHTIME = 14
|
291
|
+
|
292
|
+
FIELDS = {
|
293
|
+
TASKID => {:type => ::Thrift::Types::STRUCT, :name => 'taskID', :class => Hadoop::API::Jobtracker::ThriftTaskAttemptID},
|
294
|
+
PROGRESS => {:type => ::Thrift::Types::DOUBLE, :name => 'progress'},
|
295
|
+
STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => Hadoop::API::Jobtracker::ThriftTaskState},
|
296
|
+
DIAGNOSTICINFO => {:type => ::Thrift::Types::STRING, :name => 'diagnosticInfo'},
|
297
|
+
STATESTRING => {:type => ::Thrift::Types::STRING, :name => 'stateString'},
|
298
|
+
TASKTRACKER => {:type => ::Thrift::Types::STRING, :name => 'taskTracker'},
|
299
|
+
STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'},
|
300
|
+
FINISHTIME => {:type => ::Thrift::Types::I64, :name => 'finishTime'},
|
301
|
+
OUTPUTSIZE => {:type => ::Thrift::Types::I64, :name => 'outputSize'},
|
302
|
+
PHASE => {:type => ::Thrift::Types::I32, :name => 'phase', :enum_class => Hadoop::API::Jobtracker::ThriftTaskPhase},
|
303
|
+
COUNTERS => {:type => ::Thrift::Types::STRUCT, :name => 'counters', :class => Hadoop::API::Jobtracker::ThriftGroupList},
|
304
|
+
SHUFFLEFINISHTIME => {:type => ::Thrift::Types::I64, :name => 'shuffleFinishTime'},
|
305
|
+
SORTFINISHTIME => {:type => ::Thrift::Types::I64, :name => 'sortFinishTime'},
|
306
|
+
MAPFINISHTIME => {:type => ::Thrift::Types::I64, :name => 'mapFinishTime'}
|
307
|
+
}
|
308
|
+
|
309
|
+
def struct_fields; FIELDS; end
|
310
|
+
|
311
|
+
def validate
|
312
|
+
unless @state.nil? || Hadoop::API::Jobtracker::ThriftTaskState::VALID_VALUES.include?(@state)
|
313
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!')
|
314
|
+
end
|
315
|
+
unless @phase.nil? || Hadoop::API::Jobtracker::ThriftTaskPhase::VALID_VALUES.include?(@phase)
|
316
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field phase!')
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
::Thrift::Struct.generate_accessors self
|
321
|
+
end
|
322
|
+
|
323
|
+
# A ThriftTaskInProgress contains a list of
|
324
|
+
# task attempts (speculatively executed instances of the same task).
|
325
|
+
# These are indexed by TaskAttemptID.
|
326
|
+
# For simplicity, we convert maps keyed on TaskAttemptIDs to maps keyed
|
327
|
+
# on their string representation.
|
328
|
+
#
|
329
|
+
# Assumption: there won't be so many task attempts that retrieving a single task
|
330
|
+
# will be too expensive.
|
331
|
+
class ThriftTaskInProgress
|
332
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
333
|
+
EXECSTARTTIME = 2
|
334
|
+
EXECFINISHTIME = 3
|
335
|
+
PROGRESS = 4
|
336
|
+
STARTTIME = 5
|
337
|
+
FAILED = 6
|
338
|
+
COMPLETE = 7
|
339
|
+
TASKID = 8
|
340
|
+
TASKS = 9
|
341
|
+
TASKSTATUSES = 10
|
342
|
+
TASKDIAGNOSTICDATA = 11
|
343
|
+
COUNTERS = 12
|
344
|
+
MOSTRECENTSTATE = 13
|
345
|
+
RUNNINGATTEMPTS = 14
|
346
|
+
SUCCESSFULATTEMPT = 15
|
347
|
+
|
348
|
+
FIELDS = {
|
349
|
+
EXECSTARTTIME => {:type => ::Thrift::Types::I64, :name => 'execStartTime'},
|
350
|
+
EXECFINISHTIME => {:type => ::Thrift::Types::I64, :name => 'execFinishTime'},
|
351
|
+
PROGRESS => {:type => ::Thrift::Types::DOUBLE, :name => 'progress'},
|
352
|
+
STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'},
|
353
|
+
FAILED => {:type => ::Thrift::Types::BOOL, :name => 'failed'},
|
354
|
+
COMPLETE => {:type => ::Thrift::Types::BOOL, :name => 'complete'},
|
355
|
+
TASKID => {:type => ::Thrift::Types::STRUCT, :name => 'taskID', :class => Hadoop::API::Jobtracker::ThriftTaskID},
|
356
|
+
TASKS => {:type => ::Thrift::Types::LIST, :name => 'tasks', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftTaskAttemptID}},
|
357
|
+
# TaskAttemptID (string) to ThriftTaskStatus map
|
358
|
+
TASKSTATUSES => {:type => ::Thrift::Types::MAP, :name => 'taskStatuses', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftTaskStatus}},
|
359
|
+
TASKDIAGNOSTICDATA => {:type => ::Thrift::Types::MAP, :name => 'taskDiagnosticData', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}},
|
360
|
+
COUNTERS => {:type => ::Thrift::Types::STRUCT, :name => 'counters', :class => Hadoop::API::Jobtracker::ThriftGroupList},
|
361
|
+
MOSTRECENTSTATE => {:type => ::Thrift::Types::STRING, :name => 'mostRecentState'},
|
362
|
+
RUNNINGATTEMPTS => {:type => ::Thrift::Types::LIST, :name => 'runningAttempts', :element => {:type => ::Thrift::Types::STRING}},
|
363
|
+
SUCCESSFULATTEMPT => {:type => ::Thrift::Types::STRING, :name => 'successfulAttempt'}
|
364
|
+
}
|
365
|
+
|
366
|
+
def struct_fields; FIELDS; end
|
367
|
+
|
368
|
+
def validate
|
369
|
+
end
|
370
|
+
|
371
|
+
::Thrift::Struct.generate_accessors self
|
372
|
+
end
|
373
|
+
|
374
|
+
# TaskTracker status; contains details of individual tasks
|
375
|
+
class ThriftTaskTrackerStatus
|
376
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
377
|
+
TRACKERNAME = 1
|
378
|
+
HOST = 2
|
379
|
+
HTTPPORT = 3
|
380
|
+
FAILURECOUNT = 4
|
381
|
+
TASKREPORTS = 5
|
382
|
+
LASTSEEN = 6
|
383
|
+
MAXMAPTASKS = 7
|
384
|
+
MAXREDUCETASKS = 8
|
385
|
+
TOTALVIRTUALMEMORY = 9
|
386
|
+
TOTALPHYSICALMEMORY = 11
|
387
|
+
AVAILABLESPACE = 13
|
388
|
+
MAPCOUNT = 14
|
389
|
+
REDUCECOUNT = 15
|
390
|
+
|
391
|
+
FIELDS = {
|
392
|
+
TRACKERNAME => {:type => ::Thrift::Types::STRING, :name => 'trackerName'},
|
393
|
+
HOST => {:type => ::Thrift::Types::STRING, :name => 'host'},
|
394
|
+
HTTPPORT => {:type => ::Thrift::Types::I32, :name => 'httpPort'},
|
395
|
+
FAILURECOUNT => {:type => ::Thrift::Types::I32, :name => 'failureCount'},
|
396
|
+
# List of the state of all tasks on this tracker
|
397
|
+
TASKREPORTS => {:type => ::Thrift::Types::LIST, :name => 'taskReports', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftTaskStatus}},
|
398
|
+
# When did the JobTracker last hear from this TaskTracker?
|
399
|
+
LASTSEEN => {:type => ::Thrift::Types::I64, :name => 'lastSeen'},
|
400
|
+
# Maximum possible number of both task types
|
401
|
+
MAXMAPTASKS => {:type => ::Thrift::Types::I32, :name => 'maxMapTasks'},
|
402
|
+
MAXREDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'maxReduceTasks'},
|
403
|
+
# Main memory metrics, all in bytes
|
404
|
+
TOTALVIRTUALMEMORY => {:type => ::Thrift::Types::I64, :name => 'totalVirtualMemory'},
|
405
|
+
TOTALPHYSICALMEMORY => {:type => ::Thrift::Types::I64, :name => 'totalPhysicalMemory'},
|
406
|
+
AVAILABLESPACE => {:type => ::Thrift::Types::I64, :name => 'availableSpace'},
|
407
|
+
# Currently running and unassigned map and reduce tasks
|
408
|
+
MAPCOUNT => {:type => ::Thrift::Types::I32, :name => 'mapCount'},
|
409
|
+
REDUCECOUNT => {:type => ::Thrift::Types::I32, :name => 'reduceCount'}
|
410
|
+
}
|
411
|
+
|
412
|
+
def struct_fields; FIELDS; end
|
413
|
+
|
414
|
+
def validate
|
415
|
+
end
|
416
|
+
|
417
|
+
::Thrift::Struct.generate_accessors self
|
418
|
+
end
|
419
|
+
|
420
|
+
# Container structure for TaskTrackerStatus objects
|
421
|
+
class ThriftTaskTrackerStatusList
|
422
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
423
|
+
TRACKERS = 1
|
424
|
+
|
425
|
+
FIELDS = {
|
426
|
+
TRACKERS => {:type => ::Thrift::Types::LIST, :name => 'trackers', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftTaskTrackerStatus}}
|
427
|
+
}
|
428
|
+
|
429
|
+
def struct_fields; FIELDS; end
|
430
|
+
|
431
|
+
def validate
|
432
|
+
end
|
433
|
+
|
434
|
+
::Thrift::Struct.generate_accessors self
|
435
|
+
end
|
436
|
+
|
437
|
+
# Status of a job
|
438
|
+
class ThriftJobStatus
|
439
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
440
|
+
JOBID = 1
|
441
|
+
MAPPROGRESS = 2
|
442
|
+
REDUCEPROGRESS = 3
|
443
|
+
CLEANUPPROGRESS = 4
|
444
|
+
SETUPPROGRESS = 5
|
445
|
+
RUNSTATE = 6
|
446
|
+
STARTTIME = 7
|
447
|
+
USER = 8
|
448
|
+
PRIORITY = 9
|
449
|
+
SCHEDULINGINFO = 10
|
450
|
+
|
451
|
+
FIELDS = {
|
452
|
+
JOBID => {:type => ::Thrift::Types::STRUCT, :name => 'jobID', :class => Hadoop::API::Jobtracker::ThriftJobID},
|
453
|
+
MAPPROGRESS => {:type => ::Thrift::Types::DOUBLE, :name => 'mapProgress'},
|
454
|
+
REDUCEPROGRESS => {:type => ::Thrift::Types::DOUBLE, :name => 'reduceProgress'},
|
455
|
+
CLEANUPPROGRESS => {:type => ::Thrift::Types::DOUBLE, :name => 'cleanupProgress'},
|
456
|
+
SETUPPROGRESS => {:type => ::Thrift::Types::DOUBLE, :name => 'setupProgress'},
|
457
|
+
RUNSTATE => {:type => ::Thrift::Types::I32, :name => 'runState', :enum_class => Hadoop::API::Jobtracker::ThriftJobState},
|
458
|
+
STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'},
|
459
|
+
USER => {:type => ::Thrift::Types::STRING, :name => 'user'},
|
460
|
+
PRIORITY => {:type => ::Thrift::Types::I32, :name => 'priority', :enum_class => Hadoop::API::Jobtracker::ThriftJobPriority},
|
461
|
+
SCHEDULINGINFO => {:type => ::Thrift::Types::STRING, :name => 'schedulingInfo'}
|
462
|
+
}
|
463
|
+
|
464
|
+
def struct_fields; FIELDS; end
|
465
|
+
|
466
|
+
def validate
|
467
|
+
unless @runState.nil? || Hadoop::API::Jobtracker::ThriftJobState::VALID_VALUES.include?(@runState)
|
468
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field runState!')
|
469
|
+
end
|
470
|
+
unless @priority.nil? || Hadoop::API::Jobtracker::ThriftJobPriority::VALID_VALUES.include?(@priority)
|
471
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field priority!')
|
472
|
+
end
|
473
|
+
end
|
474
|
+
|
475
|
+
::Thrift::Struct.generate_accessors self
|
476
|
+
end
|
477
|
+
|
478
|
+
# Job metadata
|
479
|
+
class ThriftJobProfile
|
480
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
481
|
+
USER = 1
|
482
|
+
JOBID = 2
|
483
|
+
JOBFILE = 3
|
484
|
+
NAME = 4
|
485
|
+
QUEUENAME = 5
|
486
|
+
|
487
|
+
FIELDS = {
|
488
|
+
USER => {:type => ::Thrift::Types::STRING, :name => 'user'},
|
489
|
+
JOBID => {:type => ::Thrift::Types::STRUCT, :name => 'jobID', :class => Hadoop::API::Jobtracker::ThriftJobID},
|
490
|
+
JOBFILE => {:type => ::Thrift::Types::STRING, :name => 'jobFile'},
|
491
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
|
492
|
+
QUEUENAME => {:type => ::Thrift::Types::STRING, :name => 'queueName'}
|
493
|
+
}
|
494
|
+
|
495
|
+
def struct_fields; FIELDS; end
|
496
|
+
|
497
|
+
def validate
|
498
|
+
end
|
499
|
+
|
500
|
+
::Thrift::Struct.generate_accessors self
|
501
|
+
end
|
502
|
+
|
503
|
+
# Container structure of a list of tasks. This list may have been put together
|
504
|
+
# according to some selection criteria. That is, it may not correspond to the
|
505
|
+
# mapTasks, or reduceTasks, etc. It may even contain tasks of different types.
|
506
|
+
class ThriftTaskInProgressList
|
507
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
508
|
+
TASKS = 1
|
509
|
+
NUMTOTALTASKS = 2
|
510
|
+
|
511
|
+
FIELDS = {
|
512
|
+
# A (possibly incomplete) list of tasks
|
513
|
+
TASKS => {:type => ::Thrift::Types::LIST, :name => 'tasks', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftTaskInProgress}},
|
514
|
+
# The total number of tasks in this full list.
|
515
|
+
NUMTOTALTASKS => {:type => ::Thrift::Types::I32, :name => 'numTotalTasks'}
|
516
|
+
}
|
517
|
+
|
518
|
+
def struct_fields; FIELDS; end
|
519
|
+
|
520
|
+
def validate
|
521
|
+
end
|
522
|
+
|
523
|
+
::Thrift::Struct.generate_accessors self
|
524
|
+
end
|
525
|
+
|
526
|
+
# Status of *all* jobs, not just currently running ones
|
527
|
+
class ThriftJobInProgress
|
528
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
529
|
+
PROFILE = 1
|
530
|
+
STATUS = 2
|
531
|
+
JOBID = 3
|
532
|
+
DESIREDMAPS = 4
|
533
|
+
DESIREDREDUCES = 5
|
534
|
+
FINISHEDMAPS = 6
|
535
|
+
FINISHEDREDUCES = 7
|
536
|
+
PRIORITY = 8
|
537
|
+
STARTTIME = 11
|
538
|
+
FINISHTIME = 12
|
539
|
+
LAUNCHTIME = 13
|
540
|
+
TASKS = 23
|
541
|
+
|
542
|
+
FIELDS = {
|
543
|
+
PROFILE => {:type => ::Thrift::Types::STRUCT, :name => 'profile', :class => Hadoop::API::Jobtracker::ThriftJobProfile},
|
544
|
+
STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => Hadoop::API::Jobtracker::ThriftJobStatus},
|
545
|
+
JOBID => {:type => ::Thrift::Types::STRUCT, :name => 'jobID', :class => Hadoop::API::Jobtracker::ThriftJobID},
|
546
|
+
DESIREDMAPS => {:type => ::Thrift::Types::I32, :name => 'desiredMaps'},
|
547
|
+
DESIREDREDUCES => {:type => ::Thrift::Types::I32, :name => 'desiredReduces'},
|
548
|
+
FINISHEDMAPS => {:type => ::Thrift::Types::I32, :name => 'finishedMaps'},
|
549
|
+
FINISHEDREDUCES => {:type => ::Thrift::Types::I32, :name => 'finishedReduces'},
|
550
|
+
PRIORITY => {:type => ::Thrift::Types::I32, :name => 'priority', :enum_class => Hadoop::API::Jobtracker::ThriftJobPriority},
|
551
|
+
STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'},
|
552
|
+
FINISHTIME => {:type => ::Thrift::Types::I64, :name => 'finishTime'},
|
553
|
+
LAUNCHTIME => {:type => ::Thrift::Types::I64, :name => 'launchTime'},
|
554
|
+
TASKS => {:type => ::Thrift::Types::STRUCT, :name => 'tasks', :class => Hadoop::API::Jobtracker::ThriftTaskInProgressList}
|
555
|
+
}
|
556
|
+
|
557
|
+
def struct_fields; FIELDS; end
|
558
|
+
|
559
|
+
def validate
|
560
|
+
unless @priority.nil? || Hadoop::API::Jobtracker::ThriftJobPriority::VALID_VALUES.include?(@priority)
|
561
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field priority!')
|
562
|
+
end
|
563
|
+
end
|
564
|
+
|
565
|
+
::Thrift::Struct.generate_accessors self
|
566
|
+
end
|
567
|
+
|
568
|
+
# Container structure of a list of jobs, in case we ever want to add metadata
|
569
|
+
class ThriftJobList
|
570
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
571
|
+
JOBS = 1
|
572
|
+
|
573
|
+
FIELDS = {
|
574
|
+
JOBS => {:type => ::Thrift::Types::LIST, :name => 'jobs', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::Jobtracker::ThriftJobInProgress}}
|
575
|
+
}
|
576
|
+
|
577
|
+
def struct_fields; FIELDS; end
|
578
|
+
|
579
|
+
def validate
|
580
|
+
end
|
581
|
+
|
582
|
+
::Thrift::Struct.generate_accessors self
|
583
|
+
end
|
584
|
+
|
585
|
+
# Container structure for job counts for a given user
|
586
|
+
class ThriftUserJobCounts
|
587
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
588
|
+
NPREP = 1
|
589
|
+
NRUNNING = 2
|
590
|
+
NSUCCEEDED = 3
|
591
|
+
NFAILED = 4
|
592
|
+
NKILLED = 5
|
593
|
+
|
594
|
+
FIELDS = {
|
595
|
+
NPREP => {:type => ::Thrift::Types::I32, :name => 'nPrep'},
|
596
|
+
NRUNNING => {:type => ::Thrift::Types::I32, :name => 'nRunning'},
|
597
|
+
NSUCCEEDED => {:type => ::Thrift::Types::I32, :name => 'nSucceeded'},
|
598
|
+
NFAILED => {:type => ::Thrift::Types::I32, :name => 'nFailed'},
|
599
|
+
NKILLED => {:type => ::Thrift::Types::I32, :name => 'nKilled'}
|
600
|
+
}
|
601
|
+
|
602
|
+
def struct_fields; FIELDS; end
|
603
|
+
|
604
|
+
def validate
|
605
|
+
end
|
606
|
+
|
607
|
+
::Thrift::Struct.generate_accessors self
|
608
|
+
end
|
609
|
+
|
610
|
+
# Status of the cluster as viewed by the jobtracker
|
611
|
+
class ThriftClusterStatus
|
612
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
613
|
+
NUMACTIVETRACKERS = 1
|
614
|
+
ACTIVETRACKERNAMES = 2
|
615
|
+
BLACKLISTEDTRACKERNAMES = 3
|
616
|
+
NUMBLACKLISTEDTRACKERS = 4
|
617
|
+
NUMEXCLUDEDNODES = 5
|
618
|
+
TASKTRACKEREXPIRYINTERVAL = 6
|
619
|
+
MAPTASKS = 7
|
620
|
+
REDUCETASKS = 8
|
621
|
+
MAXMAPTASKS = 9
|
622
|
+
MAXREDUCETASKS = 10
|
623
|
+
STATE = 11
|
624
|
+
USEDMEMORY = 12
|
625
|
+
MAXMEMORY = 13
|
626
|
+
TOTALSUBMISSIONS = 14
|
627
|
+
HASRESTARTED = 15
|
628
|
+
HASRECOVERED = 16
|
629
|
+
STARTTIME = 17
|
630
|
+
HOSTNAME = 18
|
631
|
+
IDENTIFIER = 19
|
632
|
+
HTTPPORT = 20
|
633
|
+
|
634
|
+
FIELDS = {
|
635
|
+
NUMACTIVETRACKERS => {:type => ::Thrift::Types::I32, :name => 'numActiveTrackers'},
|
636
|
+
ACTIVETRACKERNAMES => {:type => ::Thrift::Types::LIST, :name => 'activeTrackerNames', :element => {:type => ::Thrift::Types::STRING}},
|
637
|
+
BLACKLISTEDTRACKERNAMES => {:type => ::Thrift::Types::LIST, :name => 'blacklistedTrackerNames', :element => {:type => ::Thrift::Types::STRING}},
|
638
|
+
NUMBLACKLISTEDTRACKERS => {:type => ::Thrift::Types::I32, :name => 'numBlacklistedTrackers'},
|
639
|
+
NUMEXCLUDEDNODES => {:type => ::Thrift::Types::I32, :name => 'numExcludedNodes'},
|
640
|
+
TASKTRACKEREXPIRYINTERVAL => {:type => ::Thrift::Types::I64, :name => 'taskTrackerExpiryInterval'},
|
641
|
+
MAPTASKS => {:type => ::Thrift::Types::I32, :name => 'mapTasks'},
|
642
|
+
REDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'reduceTasks'},
|
643
|
+
MAXMAPTASKS => {:type => ::Thrift::Types::I32, :name => 'maxMapTasks'},
|
644
|
+
MAXREDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'maxReduceTasks'},
|
645
|
+
STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => Hadoop::API::Jobtracker::JobTrackerState},
|
646
|
+
# Used and max memory for the cluster, in bytes
|
647
|
+
USEDMEMORY => {:type => ::Thrift::Types::I64, :name => 'usedMemory'},
|
648
|
+
MAXMEMORY => {:type => ::Thrift::Types::I64, :name => 'maxMemory'},
|
649
|
+
TOTALSUBMISSIONS => {:type => ::Thrift::Types::I32, :name => 'totalSubmissions'},
|
650
|
+
HASRESTARTED => {:type => ::Thrift::Types::BOOL, :name => 'hasRestarted'},
|
651
|
+
HASRECOVERED => {:type => ::Thrift::Types::BOOL, :name => 'hasRecovered'},
|
652
|
+
STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'},
|
653
|
+
HOSTNAME => {:type => ::Thrift::Types::STRING, :name => 'hostname'},
|
654
|
+
IDENTIFIER => {:type => ::Thrift::Types::STRING, :name => 'identifier'},
|
655
|
+
HTTPPORT => {:type => ::Thrift::Types::I32, :name => 'httpPort'}
|
656
|
+
}
|
657
|
+
|
658
|
+
def struct_fields; FIELDS; end
|
659
|
+
|
660
|
+
def validate
|
661
|
+
unless @state.nil? || Hadoop::API::Jobtracker::JobTrackerState::VALID_VALUES.include?(@state)
|
662
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!')
|
663
|
+
end
|
664
|
+
end
|
665
|
+
|
666
|
+
::Thrift::Struct.generate_accessors self
|
667
|
+
end
|
668
|
+
|
669
|
+
# Merely an indicator that job wasn't found.
|
670
|
+
class JobNotFoundException < ::Thrift::Exception
|
671
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
672
|
+
|
673
|
+
FIELDS = {
|
674
|
+
|
675
|
+
}
|
676
|
+
|
677
|
+
def struct_fields; FIELDS; end
|
678
|
+
|
679
|
+
def validate
|
680
|
+
end
|
681
|
+
|
682
|
+
::Thrift::Struct.generate_accessors self
|
683
|
+
end
|
684
|
+
|
685
|
+
# Merely an indicator that task wasn't found.
|
686
|
+
class TaskNotFoundException < ::Thrift::Exception
|
687
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
688
|
+
|
689
|
+
FIELDS = {
|
690
|
+
|
691
|
+
}
|
692
|
+
|
693
|
+
def struct_fields; FIELDS; end
|
694
|
+
|
695
|
+
def validate
|
696
|
+
end
|
697
|
+
|
698
|
+
::Thrift::Struct.generate_accessors self
|
699
|
+
end
|
700
|
+
|
701
|
+
# Indicates that a task attempt wasn't found
|
702
|
+
class TaskAttemptNotFoundException < ::Thrift::Exception
|
703
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
704
|
+
|
705
|
+
FIELDS = {
|
706
|
+
|
707
|
+
}
|
708
|
+
|
709
|
+
def struct_fields; FIELDS; end
|
710
|
+
|
711
|
+
def validate
|
712
|
+
end
|
713
|
+
|
714
|
+
::Thrift::Struct.generate_accessors self
|
715
|
+
end
|
716
|
+
|
717
|
+
# Indicates that a tasktracker wasn't found
|
718
|
+
class TaskTrackerNotFoundException < ::Thrift::Exception
|
719
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
720
|
+
|
721
|
+
FIELDS = {
|
722
|
+
|
723
|
+
}
|
724
|
+
|
725
|
+
def struct_fields; FIELDS; end
|
726
|
+
|
727
|
+
def validate
|
728
|
+
end
|
729
|
+
|
730
|
+
::Thrift::Struct.generate_accessors self
|
731
|
+
end
|
732
|
+
|
733
|
+
end
|
734
|
+
end
|
735
|
+
end
|