concord-ruby 0.0.4

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,325 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.2)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'mutable_ephemeral_state_service'
9
+ require 'bolt_types'
10
+
11
+ module Concord
12
+ module Thrift
13
+ module BoltProxyService
14
+ class Client < ::Concord::Thrift::MutableEphemeralStateService::Client
15
+ include ::Thrift::Client
16
+
17
+ def registerRichStream(r)
18
+ send_registerRichStream(r)
19
+ return recv_registerRichStream()
20
+ end
21
+
22
+ def send_registerRichStream(r)
23
+ send_message('registerRichStream', RegisterRichStream_args, :r => r)
24
+ end
25
+
26
+ def recv_registerRichStream()
27
+ result = receive_message(RegisterRichStream_result)
28
+ return result.success unless result.success.nil?
29
+ raise result.e unless result.e.nil?
30
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'registerRichStream failed: unknown result')
31
+ end
32
+
33
+ def deregisterRichStream(r)
34
+ send_deregisterRichStream(r)
35
+ return recv_deregisterRichStream()
36
+ end
37
+
38
+ def send_deregisterRichStream(r)
39
+ send_message('deregisterRichStream', DeregisterRichStream_args, :r => r)
40
+ end
41
+
42
+ def recv_deregisterRichStream()
43
+ result = receive_message(DeregisterRichStream_result)
44
+ return result.success unless result.success.nil?
45
+ raise result.e unless result.e.nil?
46
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'deregisterRichStream failed: unknown result')
47
+ end
48
+
49
+ def dispatchRecords(records)
50
+ send_dispatchRecords(records)
51
+ recv_dispatchRecords()
52
+ end
53
+
54
+ def send_dispatchRecords(records)
55
+ send_message('dispatchRecords', DispatchRecords_args, :records => records)
56
+ end
57
+
58
+ def recv_dispatchRecords()
59
+ result = receive_message(DispatchRecords_result)
60
+ raise result.e unless result.e.nil?
61
+ return
62
+ end
63
+
64
+ def registerWithScheduler(meta)
65
+ send_registerWithScheduler(meta)
66
+ recv_registerWithScheduler()
67
+ end
68
+
69
+ def send_registerWithScheduler(meta)
70
+ send_message('registerWithScheduler', RegisterWithScheduler_args, :meta => meta)
71
+ end
72
+
73
+ def recv_registerWithScheduler()
74
+ result = receive_message(RegisterWithScheduler_result)
75
+ raise result.e unless result.e.nil?
76
+ return
77
+ end
78
+
79
+ def updateSchedulerAddress(e)
80
+ send_updateSchedulerAddress(e)
81
+ recv_updateSchedulerAddress()
82
+ end
83
+
84
+ def send_updateSchedulerAddress(e)
85
+ send_message('updateSchedulerAddress', UpdateSchedulerAddress_args, :e => e)
86
+ end
87
+
88
+ def recv_updateSchedulerAddress()
89
+ result = receive_message(UpdateSchedulerAddress_result)
90
+ raise result.e unless result.e.nil?
91
+ return
92
+ end
93
+
94
+ end
95
+
96
+ class Processor < ::Concord::Thrift::MutableEphemeralStateService::Processor
97
+ include ::Thrift::Processor
98
+
99
+ def process_registerRichStream(seqid, iprot, oprot)
100
+ args = read_args(iprot, RegisterRichStream_args)
101
+ result = RegisterRichStream_result.new()
102
+ begin
103
+ result.success = @handler.registerRichStream(args.r)
104
+ rescue ::Concord::Thrift::BoltError => e
105
+ result.e = e
106
+ end
107
+ write_result(result, oprot, 'registerRichStream', seqid)
108
+ end
109
+
110
+ def process_deregisterRichStream(seqid, iprot, oprot)
111
+ args = read_args(iprot, DeregisterRichStream_args)
112
+ result = DeregisterRichStream_result.new()
113
+ begin
114
+ result.success = @handler.deregisterRichStream(args.r)
115
+ rescue ::Concord::Thrift::BoltError => e
116
+ result.e = e
117
+ end
118
+ write_result(result, oprot, 'deregisterRichStream', seqid)
119
+ end
120
+
121
+ def process_dispatchRecords(seqid, iprot, oprot)
122
+ args = read_args(iprot, DispatchRecords_args)
123
+ result = DispatchRecords_result.new()
124
+ begin
125
+ @handler.dispatchRecords(args.records)
126
+ rescue ::Concord::Thrift::BoltError => e
127
+ result.e = e
128
+ end
129
+ write_result(result, oprot, 'dispatchRecords', seqid)
130
+ end
131
+
132
+ def process_registerWithScheduler(seqid, iprot, oprot)
133
+ args = read_args(iprot, RegisterWithScheduler_args)
134
+ result = RegisterWithScheduler_result.new()
135
+ begin
136
+ @handler.registerWithScheduler(args.meta)
137
+ rescue ::Concord::Thrift::BoltError => e
138
+ result.e = e
139
+ end
140
+ write_result(result, oprot, 'registerWithScheduler', seqid)
141
+ end
142
+
143
+ def process_updateSchedulerAddress(seqid, iprot, oprot)
144
+ args = read_args(iprot, UpdateSchedulerAddress_args)
145
+ result = UpdateSchedulerAddress_result.new()
146
+ begin
147
+ @handler.updateSchedulerAddress(args.e)
148
+ rescue ::Concord::Thrift::BoltError => e
149
+ result.e = e
150
+ end
151
+ write_result(result, oprot, 'updateSchedulerAddress', seqid)
152
+ end
153
+
154
+ end
155
+
156
+ # HELPER FUNCTIONS AND STRUCTURES
157
+
158
+ class RegisterRichStream_args
159
+ include ::Thrift::Struct, ::Thrift::Struct_Union
160
+ R = 1
161
+
162
+ FIELDS = {
163
+ R => {:type => ::Thrift::Types::STRUCT, :name => 'r', :class => ::Concord::Thrift::RichStream}
164
+ }
165
+
166
+ def struct_fields; FIELDS; end
167
+
168
+ def validate
169
+ end
170
+
171
+ ::Thrift::Struct.generate_accessors self
172
+ end
173
+
174
+ class RegisterRichStream_result
175
+ include ::Thrift::Struct, ::Thrift::Struct_Union
176
+ SUCCESS = 0
177
+ E = 1
178
+
179
+ FIELDS = {
180
+ SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'},
181
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
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 DeregisterRichStream_args
193
+ include ::Thrift::Struct, ::Thrift::Struct_Union
194
+ R = 1
195
+
196
+ FIELDS = {
197
+ R => {:type => ::Thrift::Types::STRUCT, :name => 'r', :class => ::Concord::Thrift::RichStream}
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
+ class DeregisterRichStream_result
209
+ include ::Thrift::Struct, ::Thrift::Struct_Union
210
+ SUCCESS = 0
211
+ E = 1
212
+
213
+ FIELDS = {
214
+ SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'},
215
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
216
+ }
217
+
218
+ def struct_fields; FIELDS; end
219
+
220
+ def validate
221
+ end
222
+
223
+ ::Thrift::Struct.generate_accessors self
224
+ end
225
+
226
+ class DispatchRecords_args
227
+ include ::Thrift::Struct, ::Thrift::Struct_Union
228
+ RECORDS = 1
229
+
230
+ FIELDS = {
231
+ RECORDS => {:type => ::Thrift::Types::LIST, :name => 'records', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Concord::Thrift::Record}}
232
+ }
233
+
234
+ def struct_fields; FIELDS; end
235
+
236
+ def validate
237
+ end
238
+
239
+ ::Thrift::Struct.generate_accessors self
240
+ end
241
+
242
+ class DispatchRecords_result
243
+ include ::Thrift::Struct, ::Thrift::Struct_Union
244
+ E = 1
245
+
246
+ FIELDS = {
247
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
248
+ }
249
+
250
+ def struct_fields; FIELDS; end
251
+
252
+ def validate
253
+ end
254
+
255
+ ::Thrift::Struct.generate_accessors self
256
+ end
257
+
258
+ class RegisterWithScheduler_args
259
+ include ::Thrift::Struct, ::Thrift::Struct_Union
260
+ META = 1
261
+
262
+ FIELDS = {
263
+ META => {:type => ::Thrift::Types::STRUCT, :name => 'meta', :class => ::Concord::Thrift::ComputationMetadata}
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
+ class RegisterWithScheduler_result
275
+ include ::Thrift::Struct, ::Thrift::Struct_Union
276
+ E = 1
277
+
278
+ FIELDS = {
279
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
280
+ }
281
+
282
+ def struct_fields; FIELDS; end
283
+
284
+ def validate
285
+ end
286
+
287
+ ::Thrift::Struct.generate_accessors self
288
+ end
289
+
290
+ class UpdateSchedulerAddress_args
291
+ include ::Thrift::Struct, ::Thrift::Struct_Union
292
+ E = 1
293
+
294
+ FIELDS = {
295
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::Endpoint}
296
+ }
297
+
298
+ def struct_fields; FIELDS; end
299
+
300
+ def validate
301
+ end
302
+
303
+ ::Thrift::Struct.generate_accessors self
304
+ end
305
+
306
+ class UpdateSchedulerAddress_result
307
+ include ::Thrift::Struct, ::Thrift::Struct_Union
308
+ E = 1
309
+
310
+ FIELDS = {
311
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
312
+ }
313
+
314
+ def struct_fields; FIELDS; end
315
+
316
+ def validate
317
+ end
318
+
319
+ ::Thrift::Struct.generate_accessors self
320
+ end
321
+
322
+ end
323
+
324
+ end
325
+ end
@@ -0,0 +1,323 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.2)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'bolt_types'
9
+
10
+ module Concord
11
+ module Thrift
12
+ module BoltSchedulerService
13
+ class Client
14
+ include ::Thrift::Client
15
+
16
+ def deployComputation(request)
17
+ send_deployComputation(request)
18
+ recv_deployComputation()
19
+ end
20
+
21
+ def send_deployComputation(request)
22
+ send_message('deployComputation', DeployComputation_args, :request => request)
23
+ end
24
+
25
+ def recv_deployComputation()
26
+ result = receive_message(DeployComputation_result)
27
+ raise result.e unless result.e.nil?
28
+ return
29
+ end
30
+
31
+ def getComputationSlug(computationName)
32
+ send_getComputationSlug(computationName)
33
+ return recv_getComputationSlug()
34
+ end
35
+
36
+ def send_getComputationSlug(computationName)
37
+ send_message('getComputationSlug', GetComputationSlug_args, :computationName => computationName)
38
+ end
39
+
40
+ def recv_getComputationSlug()
41
+ result = receive_message(GetComputationSlug_result)
42
+ return result.success unless result.success.nil?
43
+ raise result.e unless result.e.nil?
44
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getComputationSlug failed: unknown result')
45
+ end
46
+
47
+ def registerComputation(computation)
48
+ send_registerComputation(computation)
49
+ recv_registerComputation()
50
+ end
51
+
52
+ def send_registerComputation(computation)
53
+ send_message('registerComputation', RegisterComputation_args, :computation => computation)
54
+ end
55
+
56
+ def recv_registerComputation()
57
+ result = receive_message(RegisterComputation_result)
58
+ raise result.e unless result.e.nil?
59
+ return
60
+ end
61
+
62
+ def scaleComputation(computationName, instances)
63
+ send_scaleComputation(computationName, instances)
64
+ recv_scaleComputation()
65
+ end
66
+
67
+ def send_scaleComputation(computationName, instances)
68
+ send_message('scaleComputation', ScaleComputation_args, :computationName => computationName, :instances => instances)
69
+ end
70
+
71
+ def recv_scaleComputation()
72
+ result = receive_message(ScaleComputation_result)
73
+ raise result.e unless result.e.nil?
74
+ return
75
+ end
76
+
77
+ def killTask(taskId)
78
+ send_killTask(taskId)
79
+ recv_killTask()
80
+ end
81
+
82
+ def send_killTask(taskId)
83
+ send_message('killTask', KillTask_args, :taskId => taskId)
84
+ end
85
+
86
+ def recv_killTask()
87
+ result = receive_message(KillTask_result)
88
+ raise result.e unless result.e.nil?
89
+ return
90
+ end
91
+
92
+ end
93
+
94
+ class Processor
95
+ include ::Thrift::Processor
96
+
97
+ def process_deployComputation(seqid, iprot, oprot)
98
+ args = read_args(iprot, DeployComputation_args)
99
+ result = DeployComputation_result.new()
100
+ begin
101
+ @handler.deployComputation(args.request)
102
+ rescue ::Concord::Thrift::BoltError => e
103
+ result.e = e
104
+ end
105
+ write_result(result, oprot, 'deployComputation', seqid)
106
+ end
107
+
108
+ def process_getComputationSlug(seqid, iprot, oprot)
109
+ args = read_args(iprot, GetComputationSlug_args)
110
+ result = GetComputationSlug_result.new()
111
+ begin
112
+ result.success = @handler.getComputationSlug(args.computationName)
113
+ rescue ::Concord::Thrift::BoltError => e
114
+ result.e = e
115
+ end
116
+ write_result(result, oprot, 'getComputationSlug', seqid)
117
+ end
118
+
119
+ def process_registerComputation(seqid, iprot, oprot)
120
+ args = read_args(iprot, RegisterComputation_args)
121
+ result = RegisterComputation_result.new()
122
+ begin
123
+ @handler.registerComputation(args.computation)
124
+ rescue ::Concord::Thrift::BoltError => e
125
+ result.e = e
126
+ end
127
+ write_result(result, oprot, 'registerComputation', seqid)
128
+ end
129
+
130
+ def process_scaleComputation(seqid, iprot, oprot)
131
+ args = read_args(iprot, ScaleComputation_args)
132
+ result = ScaleComputation_result.new()
133
+ begin
134
+ @handler.scaleComputation(args.computationName, args.instances)
135
+ rescue ::Concord::Thrift::BoltError => e
136
+ result.e = e
137
+ end
138
+ write_result(result, oprot, 'scaleComputation', seqid)
139
+ end
140
+
141
+ def process_killTask(seqid, iprot, oprot)
142
+ args = read_args(iprot, KillTask_args)
143
+ result = KillTask_result.new()
144
+ begin
145
+ @handler.killTask(args.taskId)
146
+ rescue ::Concord::Thrift::BoltError => e
147
+ result.e = e
148
+ end
149
+ write_result(result, oprot, 'killTask', seqid)
150
+ end
151
+
152
+ end
153
+
154
+ # HELPER FUNCTIONS AND STRUCTURES
155
+
156
+ class DeployComputation_args
157
+ include ::Thrift::Struct, ::Thrift::Struct_Union
158
+ REQUEST = 1
159
+
160
+ FIELDS = {
161
+ REQUEST => {:type => ::Thrift::Types::STRUCT, :name => 'request', :class => ::Concord::Thrift::BoltComputationRequest}
162
+ }
163
+
164
+ def struct_fields; FIELDS; end
165
+
166
+ def validate
167
+ end
168
+
169
+ ::Thrift::Struct.generate_accessors self
170
+ end
171
+
172
+ class DeployComputation_result
173
+ include ::Thrift::Struct, ::Thrift::Struct_Union
174
+ E = 1
175
+
176
+ FIELDS = {
177
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
178
+ }
179
+
180
+ def struct_fields; FIELDS; end
181
+
182
+ def validate
183
+ end
184
+
185
+ ::Thrift::Struct.generate_accessors self
186
+ end
187
+
188
+ class GetComputationSlug_args
189
+ include ::Thrift::Struct, ::Thrift::Struct_Union
190
+ COMPUTATIONNAME = 1
191
+
192
+ FIELDS = {
193
+ COMPUTATIONNAME => {:type => ::Thrift::Types::STRING, :name => 'computationName'}
194
+ }
195
+
196
+ def struct_fields; FIELDS; end
197
+
198
+ def validate
199
+ end
200
+
201
+ ::Thrift::Struct.generate_accessors self
202
+ end
203
+
204
+ class GetComputationSlug_result
205
+ include ::Thrift::Struct, ::Thrift::Struct_Union
206
+ SUCCESS = 0
207
+ E = 1
208
+
209
+ FIELDS = {
210
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success', :binary => true},
211
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
212
+ }
213
+
214
+ def struct_fields; FIELDS; end
215
+
216
+ def validate
217
+ end
218
+
219
+ ::Thrift::Struct.generate_accessors self
220
+ end
221
+
222
+ class RegisterComputation_args
223
+ include ::Thrift::Struct, ::Thrift::Struct_Union
224
+ COMPUTATION = 1
225
+
226
+ FIELDS = {
227
+ COMPUTATION => {:type => ::Thrift::Types::STRUCT, :name => 'computation', :class => ::Concord::Thrift::ComputationMetadata}
228
+ }
229
+
230
+ def struct_fields; FIELDS; end
231
+
232
+ def validate
233
+ end
234
+
235
+ ::Thrift::Struct.generate_accessors self
236
+ end
237
+
238
+ class RegisterComputation_result
239
+ include ::Thrift::Struct, ::Thrift::Struct_Union
240
+ E = 1
241
+
242
+ FIELDS = {
243
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
244
+ }
245
+
246
+ def struct_fields; FIELDS; end
247
+
248
+ def validate
249
+ end
250
+
251
+ ::Thrift::Struct.generate_accessors self
252
+ end
253
+
254
+ class ScaleComputation_args
255
+ include ::Thrift::Struct, ::Thrift::Struct_Union
256
+ COMPUTATIONNAME = 1
257
+ INSTANCES = 2
258
+
259
+ FIELDS = {
260
+ COMPUTATIONNAME => {:type => ::Thrift::Types::STRING, :name => 'computationName'},
261
+ INSTANCES => {:type => ::Thrift::Types::I64, :name => 'instances'}
262
+ }
263
+
264
+ def struct_fields; FIELDS; end
265
+
266
+ def validate
267
+ end
268
+
269
+ ::Thrift::Struct.generate_accessors self
270
+ end
271
+
272
+ class ScaleComputation_result
273
+ include ::Thrift::Struct, ::Thrift::Struct_Union
274
+ E = 1
275
+
276
+ FIELDS = {
277
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
278
+ }
279
+
280
+ def struct_fields; FIELDS; end
281
+
282
+ def validate
283
+ end
284
+
285
+ ::Thrift::Struct.generate_accessors self
286
+ end
287
+
288
+ class KillTask_args
289
+ include ::Thrift::Struct, ::Thrift::Struct_Union
290
+ TASKID = 1
291
+
292
+ FIELDS = {
293
+ TASKID => {:type => ::Thrift::Types::STRING, :name => 'taskId'}
294
+ }
295
+
296
+ def struct_fields; FIELDS; end
297
+
298
+ def validate
299
+ end
300
+
301
+ ::Thrift::Struct.generate_accessors self
302
+ end
303
+
304
+ class KillTask_result
305
+ include ::Thrift::Struct, ::Thrift::Struct_Union
306
+ E = 1
307
+
308
+ FIELDS = {
309
+ E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
310
+ }
311
+
312
+ def struct_fields; FIELDS; end
313
+
314
+ def validate
315
+ end
316
+
317
+ ::Thrift::Struct.generate_accessors self
318
+ end
319
+
320
+ end
321
+
322
+ end
323
+ end