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.
@@ -0,0 +1,12 @@
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
+ module Hadoop
10
+ module API
11
+ end
12
+ end
@@ -0,0 +1,209 @@
1
+ #
2
+ # Autogenerated by Thrift
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+
8
+ module Hadoop
9
+ module API
10
+ # Generic I/O error
11
+ class IOException < ::Thrift::Exception
12
+ include ::Thrift::Struct, ::Thrift::Struct_Union
13
+ MSG = 1
14
+ STACK = 2
15
+ CLAZZ = 3
16
+
17
+ FIELDS = {
18
+ # Error message.
19
+ MSG => {:type => ::Thrift::Types::STRING, :name => 'msg'},
20
+ # Textual representation of the call stack.
21
+ STACK => {:type => ::Thrift::Types::STRING, :name => 'stack'},
22
+ # The Java class of the Exception (may be a subclass)
23
+ CLAZZ => {:type => ::Thrift::Types::STRING, :name => 'clazz'}
24
+ }
25
+
26
+ def struct_fields; FIELDS; end
27
+
28
+ def validate
29
+ end
30
+
31
+ ::Thrift::Struct.generate_accessors self
32
+ end
33
+
34
+ # Information about the compilation version of this server
35
+ class VersionInfo
36
+ include ::Thrift::Struct, ::Thrift::Struct_Union
37
+ VERSION = 1
38
+ REVISION = 2
39
+ COMPILEDATE = 4
40
+ COMPILINGUSER = 5
41
+ URL = 6
42
+ BUILDVERSION = 7
43
+
44
+ FIELDS = {
45
+ VERSION => {:type => ::Thrift::Types::STRING, :name => 'version'},
46
+ REVISION => {:type => ::Thrift::Types::STRING, :name => 'revision'},
47
+ COMPILEDATE => {:type => ::Thrift::Types::STRING, :name => 'compileDate'},
48
+ COMPILINGUSER => {:type => ::Thrift::Types::STRING, :name => 'compilingUser'},
49
+ URL => {:type => ::Thrift::Types::STRING, :name => 'url'},
50
+ BUILDVERSION => {:type => ::Thrift::Types::STRING, :name => 'buildVersion'}
51
+ }
52
+
53
+ def struct_fields; FIELDS; end
54
+
55
+ def validate
56
+ end
57
+
58
+ ::Thrift::Struct.generate_accessors self
59
+ end
60
+
61
+ # A single stack frame in a stack dump
62
+ class StackTraceElement
63
+ include ::Thrift::Struct, ::Thrift::Struct_Union
64
+ CLASSNAME = 1
65
+ FILENAME = 2
66
+ LINENUMBER = 3
67
+ METHODNAME = 4
68
+ ISNATIVEMETHOD = 5
69
+ STRINGREPRESENTATION = 6
70
+
71
+ FIELDS = {
72
+ CLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'className'},
73
+ FILENAME => {:type => ::Thrift::Types::STRING, :name => 'fileName'},
74
+ LINENUMBER => {:type => ::Thrift::Types::I32, :name => 'lineNumber'},
75
+ METHODNAME => {:type => ::Thrift::Types::STRING, :name => 'methodName'},
76
+ ISNATIVEMETHOD => {:type => ::Thrift::Types::BOOL, :name => 'isNativeMethod'},
77
+ STRINGREPRESENTATION => {:type => ::Thrift::Types::STRING, :name => 'stringRepresentation'}
78
+ }
79
+
80
+ def struct_fields; FIELDS; end
81
+
82
+ def validate
83
+ end
84
+
85
+ ::Thrift::Struct.generate_accessors self
86
+ end
87
+
88
+ # Info about a thread with its corresponding stack trace
89
+ class ThreadStackTrace
90
+ include ::Thrift::Struct, ::Thrift::Struct_Union
91
+ THREADNAME = 1
92
+ THREADSTRINGREPRESENTATION = 2
93
+ ISDAEMON = 3
94
+ STACKTRACE = 4
95
+
96
+ FIELDS = {
97
+ THREADNAME => {:type => ::Thrift::Types::STRING, :name => 'threadName'},
98
+ THREADSTRINGREPRESENTATION => {:type => ::Thrift::Types::STRING, :name => 'threadStringRepresentation'},
99
+ ISDAEMON => {:type => ::Thrift::Types::BOOL, :name => 'isDaemon'},
100
+ STACKTRACE => {:type => ::Thrift::Types::LIST, :name => 'stackTrace', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::StackTraceElement}}
101
+ }
102
+
103
+ def struct_fields; FIELDS; end
104
+
105
+ def validate
106
+ end
107
+
108
+ ::Thrift::Struct.generate_accessors self
109
+ end
110
+
111
+ # Memory available via java.lang.Runtime
112
+ class RuntimeInfo
113
+ include ::Thrift::Struct, ::Thrift::Struct_Union
114
+ TOTALMEMORY = 1
115
+ FREEMEMORY = 2
116
+ MAXMEMORY = 3
117
+
118
+ FIELDS = {
119
+ TOTALMEMORY => {:type => ::Thrift::Types::I64, :name => 'totalMemory'},
120
+ FREEMEMORY => {:type => ::Thrift::Types::I64, :name => 'freeMemory'},
121
+ MAXMEMORY => {:type => ::Thrift::Types::I64, :name => 'maxMemory'}
122
+ }
123
+
124
+ def struct_fields; FIELDS; end
125
+
126
+ def validate
127
+ end
128
+
129
+ ::Thrift::Struct.generate_accessors self
130
+ end
131
+
132
+ # Context options for every request.
133
+ class RequestContext
134
+ include ::Thrift::Struct, ::Thrift::Struct_Union
135
+ CONFOPTIONS = 1
136
+
137
+ FIELDS = {
138
+ # This map turns into a Configuration object in the server and
139
+ # is currently used to construct a UserGroupInformation to
140
+ # authenticate this request.
141
+ CONFOPTIONS => {:type => ::Thrift::Types::MAP, :name => 'confOptions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
142
+ }
143
+
144
+ def struct_fields; FIELDS; end
145
+
146
+ def validate
147
+ end
148
+
149
+ ::Thrift::Struct.generate_accessors self
150
+ end
151
+
152
+ class MetricsRecord
153
+ include ::Thrift::Struct, ::Thrift::Struct_Union
154
+ TAGS = 2
155
+ METRICS = 3
156
+
157
+ FIELDS = {
158
+ TAGS => {:type => ::Thrift::Types::MAP, :name => 'tags', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
159
+ METRICS => {:type => ::Thrift::Types::MAP, :name => 'metrics', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I64}}
160
+ }
161
+
162
+ def struct_fields; FIELDS; end
163
+
164
+ def validate
165
+ end
166
+
167
+ ::Thrift::Struct.generate_accessors self
168
+ end
169
+
170
+ class MetricsContext
171
+ include ::Thrift::Struct, ::Thrift::Struct_Union
172
+ NAME = 1
173
+ ISMONITORING = 2
174
+ PERIOD = 3
175
+ RECORDS = 4
176
+
177
+ FIELDS = {
178
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
179
+ ISMONITORING => {:type => ::Thrift::Types::BOOL, :name => 'isMonitoring'},
180
+ PERIOD => {:type => ::Thrift::Types::I32, :name => 'period'},
181
+ RECORDS => {:type => ::Thrift::Types::MAP, :name => 'records', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::MetricsRecord}}}
182
+ }
183
+
184
+ def struct_fields; FIELDS; end
185
+
186
+ def validate
187
+ end
188
+
189
+ ::Thrift::Struct.generate_accessors self
190
+ end
191
+
192
+ class ThriftDelegationToken
193
+ include ::Thrift::Struct, ::Thrift::Struct_Union
194
+ DELEGATIONTOKENBYTES = 1
195
+
196
+ FIELDS = {
197
+ DELEGATIONTOKENBYTES => {:type => ::Thrift::Types::STRING, :name => 'delegationTokenBytes', :binary => true}
198
+ }
199
+
200
+ def struct_fields; FIELDS; end
201
+
202
+ def validate
203
+ end
204
+
205
+ ::Thrift::Struct.generate_accessors self
206
+ end
207
+
208
+ end
209
+ end
@@ -0,0 +1,314 @@
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 'thrift'
8
+ require 'common_types'
9
+
10
+ module Hadoop
11
+ module API
12
+ module HadoopServiceBase
13
+ class Client
14
+ include ::Thrift::Client
15
+
16
+ def getVersionInfo(ctx)
17
+ send_getVersionInfo(ctx)
18
+ return recv_getVersionInfo()
19
+ end
20
+
21
+ def send_getVersionInfo(ctx)
22
+ send_message('getVersionInfo', GetVersionInfo_args, :ctx => ctx)
23
+ end
24
+
25
+ def recv_getVersionInfo()
26
+ result = receive_message(GetVersionInfo_result)
27
+ return result.success unless result.success.nil?
28
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getVersionInfo failed: unknown result')
29
+ end
30
+
31
+ def getRuntimeInfo(ctx)
32
+ send_getRuntimeInfo(ctx)
33
+ return recv_getRuntimeInfo()
34
+ end
35
+
36
+ def send_getRuntimeInfo(ctx)
37
+ send_message('getRuntimeInfo', GetRuntimeInfo_args, :ctx => ctx)
38
+ end
39
+
40
+ def recv_getRuntimeInfo()
41
+ result = receive_message(GetRuntimeInfo_result)
42
+ return result.success unless result.success.nil?
43
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getRuntimeInfo failed: unknown result')
44
+ end
45
+
46
+ def getThreadDump(ctx)
47
+ send_getThreadDump(ctx)
48
+ return recv_getThreadDump()
49
+ end
50
+
51
+ def send_getThreadDump(ctx)
52
+ send_message('getThreadDump', GetThreadDump_args, :ctx => ctx)
53
+ end
54
+
55
+ def recv_getThreadDump()
56
+ result = receive_message(GetThreadDump_result)
57
+ return result.success unless result.success.nil?
58
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getThreadDump failed: unknown result')
59
+ end
60
+
61
+ def getAllMetrics(ctx)
62
+ send_getAllMetrics(ctx)
63
+ return recv_getAllMetrics()
64
+ end
65
+
66
+ def send_getAllMetrics(ctx)
67
+ send_message('getAllMetrics', GetAllMetrics_args, :ctx => ctx)
68
+ end
69
+
70
+ def recv_getAllMetrics()
71
+ result = receive_message(GetAllMetrics_result)
72
+ return result.success unless result.success.nil?
73
+ raise result.err unless result.err.nil?
74
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getAllMetrics failed: unknown result')
75
+ end
76
+
77
+ def getMetricsContext(ctx, contextName)
78
+ send_getMetricsContext(ctx, contextName)
79
+ return recv_getMetricsContext()
80
+ end
81
+
82
+ def send_getMetricsContext(ctx, contextName)
83
+ send_message('getMetricsContext', GetMetricsContext_args, :ctx => ctx, :contextName => contextName)
84
+ end
85
+
86
+ def recv_getMetricsContext()
87
+ result = receive_message(GetMetricsContext_result)
88
+ return result.success unless result.success.nil?
89
+ raise result.err unless result.err.nil?
90
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getMetricsContext failed: unknown result')
91
+ end
92
+
93
+ end
94
+
95
+ class Processor
96
+ include ::Thrift::Processor
97
+
98
+ def process_getVersionInfo(seqid, iprot, oprot)
99
+ args = read_args(iprot, GetVersionInfo_args)
100
+ result = GetVersionInfo_result.new()
101
+ result.success = @handler.getVersionInfo(args.ctx)
102
+ write_result(result, oprot, 'getVersionInfo', seqid)
103
+ end
104
+
105
+ def process_getRuntimeInfo(seqid, iprot, oprot)
106
+ args = read_args(iprot, GetRuntimeInfo_args)
107
+ result = GetRuntimeInfo_result.new()
108
+ result.success = @handler.getRuntimeInfo(args.ctx)
109
+ write_result(result, oprot, 'getRuntimeInfo', seqid)
110
+ end
111
+
112
+ def process_getThreadDump(seqid, iprot, oprot)
113
+ args = read_args(iprot, GetThreadDump_args)
114
+ result = GetThreadDump_result.new()
115
+ result.success = @handler.getThreadDump(args.ctx)
116
+ write_result(result, oprot, 'getThreadDump', seqid)
117
+ end
118
+
119
+ def process_getAllMetrics(seqid, iprot, oprot)
120
+ args = read_args(iprot, GetAllMetrics_args)
121
+ result = GetAllMetrics_result.new()
122
+ begin
123
+ result.success = @handler.getAllMetrics(args.ctx)
124
+ rescue Hadoop::API::IOException => err
125
+ result.err = err
126
+ end
127
+ write_result(result, oprot, 'getAllMetrics', seqid)
128
+ end
129
+
130
+ def process_getMetricsContext(seqid, iprot, oprot)
131
+ args = read_args(iprot, GetMetricsContext_args)
132
+ result = GetMetricsContext_result.new()
133
+ begin
134
+ result.success = @handler.getMetricsContext(args.ctx, args.contextName)
135
+ rescue Hadoop::API::IOException => err
136
+ result.err = err
137
+ end
138
+ write_result(result, oprot, 'getMetricsContext', seqid)
139
+ end
140
+
141
+ end
142
+
143
+ # HELPER FUNCTIONS AND STRUCTURES
144
+
145
+ class GetVersionInfo_args
146
+ include ::Thrift::Struct, ::Thrift::Struct_Union
147
+ CTX = 10
148
+
149
+ FIELDS = {
150
+ CTX => {:type => ::Thrift::Types::STRUCT, :name => 'ctx', :class => Hadoop::API::RequestContext}
151
+ }
152
+
153
+ def struct_fields; FIELDS; end
154
+
155
+ def validate
156
+ end
157
+
158
+ ::Thrift::Struct.generate_accessors self
159
+ end
160
+
161
+ class GetVersionInfo_result
162
+ include ::Thrift::Struct, ::Thrift::Struct_Union
163
+ SUCCESS = 0
164
+
165
+ FIELDS = {
166
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Hadoop::API::VersionInfo}
167
+ }
168
+
169
+ def struct_fields; FIELDS; end
170
+
171
+ def validate
172
+ end
173
+
174
+ ::Thrift::Struct.generate_accessors self
175
+ end
176
+
177
+ class GetRuntimeInfo_args
178
+ include ::Thrift::Struct, ::Thrift::Struct_Union
179
+ CTX = 10
180
+
181
+ FIELDS = {
182
+ CTX => {:type => ::Thrift::Types::STRUCT, :name => 'ctx', :class => Hadoop::API::RequestContext}
183
+ }
184
+
185
+ def struct_fields; FIELDS; end
186
+
187
+ def validate
188
+ end
189
+
190
+ ::Thrift::Struct.generate_accessors self
191
+ end
192
+
193
+ class GetRuntimeInfo_result
194
+ include ::Thrift::Struct, ::Thrift::Struct_Union
195
+ SUCCESS = 0
196
+
197
+ FIELDS = {
198
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Hadoop::API::RuntimeInfo}
199
+ }
200
+
201
+ def struct_fields; FIELDS; end
202
+
203
+ def validate
204
+ end
205
+
206
+ ::Thrift::Struct.generate_accessors self
207
+ end
208
+
209
+ class GetThreadDump_args
210
+ include ::Thrift::Struct, ::Thrift::Struct_Union
211
+ CTX = 10
212
+
213
+ FIELDS = {
214
+ CTX => {:type => ::Thrift::Types::STRUCT, :name => 'ctx', :class => Hadoop::API::RequestContext}
215
+ }
216
+
217
+ def struct_fields; FIELDS; end
218
+
219
+ def validate
220
+ end
221
+
222
+ ::Thrift::Struct.generate_accessors self
223
+ end
224
+
225
+ class GetThreadDump_result
226
+ include ::Thrift::Struct, ::Thrift::Struct_Union
227
+ SUCCESS = 0
228
+
229
+ FIELDS = {
230
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::ThreadStackTrace}}
231
+ }
232
+
233
+ def struct_fields; FIELDS; end
234
+
235
+ def validate
236
+ end
237
+
238
+ ::Thrift::Struct.generate_accessors self
239
+ end
240
+
241
+ class GetAllMetrics_args
242
+ include ::Thrift::Struct, ::Thrift::Struct_Union
243
+ CTX = 10
244
+
245
+ FIELDS = {
246
+ CTX => {:type => ::Thrift::Types::STRUCT, :name => 'ctx', :class => Hadoop::API::RequestContext}
247
+ }
248
+
249
+ def struct_fields; FIELDS; end
250
+
251
+ def validate
252
+ end
253
+
254
+ ::Thrift::Struct.generate_accessors self
255
+ end
256
+
257
+ class GetAllMetrics_result
258
+ include ::Thrift::Struct, ::Thrift::Struct_Union
259
+ SUCCESS = 0
260
+ ERR = 1
261
+
262
+ FIELDS = {
263
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => Hadoop::API::MetricsContext}},
264
+ ERR => {:type => ::Thrift::Types::STRUCT, :name => 'err', :class => Hadoop::API::IOException}
265
+ }
266
+
267
+ def struct_fields; FIELDS; end
268
+
269
+ def validate
270
+ end
271
+
272
+ ::Thrift::Struct.generate_accessors self
273
+ end
274
+
275
+ class GetMetricsContext_args
276
+ include ::Thrift::Struct, ::Thrift::Struct_Union
277
+ CTX = 10
278
+ CONTEXTNAME = 1
279
+
280
+ FIELDS = {
281
+ CTX => {:type => ::Thrift::Types::STRUCT, :name => 'ctx', :class => Hadoop::API::RequestContext},
282
+ CONTEXTNAME => {:type => ::Thrift::Types::STRING, :name => 'contextName'}
283
+ }
284
+
285
+ def struct_fields; FIELDS; end
286
+
287
+ def validate
288
+ end
289
+
290
+ ::Thrift::Struct.generate_accessors self
291
+ end
292
+
293
+ class GetMetricsContext_result
294
+ include ::Thrift::Struct, ::Thrift::Struct_Union
295
+ SUCCESS = 0
296
+ ERR = 1
297
+
298
+ FIELDS = {
299
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Hadoop::API::MetricsContext},
300
+ ERR => {:type => ::Thrift::Types::STRUCT, :name => 'err', :class => Hadoop::API::IOException}
301
+ }
302
+
303
+ def struct_fields; FIELDS; end
304
+
305
+ def validate
306
+ end
307
+
308
+ ::Thrift::Struct.generate_accessors self
309
+ end
310
+
311
+ end
312
+
313
+ end
314
+ end