flockdb 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,116 @@
1
+ module Flock
2
+ class Operation
3
+ include Enumerable
4
+
5
+ def initialize(count = 20, cursor = Flock::CursorStart, &block)
6
+ @count, @next_cursor = count, cursor
7
+ @get_results = block
8
+ raise if @get_results.nil?
9
+ end
10
+
11
+ def paginate(count = 20, cursor = Flock::CursorStart)
12
+ cursor ||= Flock::CursorStart
13
+ Flock::Operation.new(count, cursor, &@get_results)
14
+ end
15
+
16
+ def current_page
17
+ @current_page ||= begin
18
+ current_page, @next_cursor, @prev_cursor = (memo[@next_cursor] ||= begin
19
+ page = Flock::Page.new
20
+ page.cursor = @next_cursor
21
+ page.count = @count
22
+ get_results(page)
23
+ end)
24
+ current_page.dup
25
+ end
26
+ end
27
+
28
+ def memo
29
+ @memo ||= {}
30
+ end
31
+
32
+ def set_current_page(cursor, results)
33
+ current_page, @next_cursor, @prev_cursor = results
34
+ @current_page = current_page.dup
35
+ memo[cursor] = results
36
+ end
37
+
38
+ def take(count)
39
+ result = []
40
+ each_with_index do |item, i|
41
+ break if i == count
42
+ result << item
43
+ end
44
+ result
45
+ end
46
+
47
+ def get_results(page)
48
+ @get_results.call(page)
49
+ end
50
+
51
+ def unapply
52
+ [current_page, @next_cursor, @prev_cursor]
53
+ end
54
+
55
+ alias_method :to_ary, :to_a
56
+
57
+ def first
58
+ current_page.first
59
+ end
60
+
61
+ def each
62
+ while next?
63
+ yield(self.next)
64
+ end
65
+ self
66
+ ensure
67
+ reset
68
+ end
69
+
70
+ def reset
71
+ @current_page = nil
72
+ @prev_cursor = Flock::CursorEnd
73
+ @next_cursor = Flock::CursorStart
74
+ end
75
+
76
+ def next?
77
+ current_page.any? || next_page?
78
+ end
79
+
80
+ def prev?
81
+ refuse.any? || prev_page?
82
+ end
83
+
84
+ def next
85
+ raise unless next?
86
+ item = current_page.shift
87
+ item || next_page && self.next
88
+ end
89
+
90
+ def next_page
91
+ raise unless next_page?
92
+
93
+ @cursor = @next_cursor
94
+ @current_page = nil
95
+ current_page
96
+ end
97
+
98
+ def prev_page
99
+ raise unless prev_page?
100
+
101
+ @cursor = @prev_cursor
102
+ @current_page = nil
103
+ current_page
104
+ end
105
+ alias_method :previous_page, :prev_page
106
+
107
+ def prev_page?
108
+ @prev_cursor != Flock::CursorEnd
109
+ end
110
+ alias_method :previous_page?, :prev_page?
111
+
112
+ def next_page?
113
+ @next_cursor != Flock::CursorEnd
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,15 @@
1
+ module Flock
2
+ class ComplexOperation < SelectOperation
3
+ def initialize(client, operation_type, operand1, operand2)
4
+ super(client)
5
+ @operation_type, @operand1, @operand2 = operation_type, operand1, operand2
6
+ end
7
+
8
+ def to_thrift
9
+ operation = Edges::SelectOperation.new
10
+ operation.operation_type = @operation_type
11
+ operation.term = nil
12
+ @operand1.to_thrift + @operand2.to_thrift + Array(operation)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ module Flock
2
+ class ExecuteOperation
3
+ def initialize(operation_type, query)
4
+ @operation_type, @query = operation_type, query
5
+ end
6
+
7
+ def to_thrift
8
+ op = Edges::ExecuteOperation.new
9
+ op.operation_type = @operation_type
10
+ op.term = QueryTerm.new(@query).to_thrift
11
+ op
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,35 @@
1
+ module Flock
2
+ class ExecuteOperations
3
+ def initialize(service, priority)
4
+ @service, @operations, @priority = service, [], priority
5
+ end
6
+
7
+ def add(source_id, graph_id, destination_id)
8
+ @operations << ExecuteOperation.new(Edges::ExecuteOperationType::Add, [source_id, graph_id, destination_id])
9
+ self
10
+ end
11
+
12
+ def remove(source_id, graph_id, destination_id)
13
+ @operations << ExecuteOperation.new(Edges::ExecuteOperationType::Remove, [source_id, graph_id, destination_id])
14
+ self
15
+ end
16
+
17
+ def archive(source_id, graph_id, destination_id)
18
+ @operations << ExecuteOperation.new(Edges::ExecuteOperationType::Archive, [source_id, graph_id, destination_id])
19
+ self
20
+ end
21
+
22
+ def apply
23
+ @service.execute(to_thrift)
24
+ end
25
+
26
+ def to_thrift
27
+ operations = Edges::ExecuteOperations.new
28
+ operations.operations = @operations.map(&:to_thrift)
29
+ operations.priority = @priority
30
+ operations
31
+ end
32
+
33
+ alias_method :unarchive, :add
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ module Flock
2
+ class QueryTerm
3
+ def initialize(query)
4
+ @query = query
5
+ end
6
+
7
+ def to_thrift
8
+ raise ArgumentError unless @query.size == 3
9
+
10
+ term = Edges::QueryTerm.new
11
+ case @query.first
12
+ when Numeric
13
+ term.source_id = @query.first
14
+ term.destination_ids = Array(@query.last).pack("Q*") if @query.last
15
+ term.is_forward = true
16
+ else
17
+ term.source_id = @query.last
18
+ term.destination_ids = Array(@query.first).pack("Q*") if @query.first
19
+ term.is_forward = false
20
+ end
21
+ term.graph_id = @query[1]
22
+ term
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,51 @@
1
+ module Flock
2
+ class SelectOperation
3
+ [:each, :paginate, :to_ary, :size, :first].each do |method|
4
+ class_eval("def #{method}(*args, &block); operation.#{method}(*args, &block) end", __FILE__, __LINE__)
5
+ end
6
+
7
+ include Enumerable
8
+ include Mixins::Sizeable
9
+
10
+ def initialize(client)
11
+ @client = client
12
+ @service = client.service
13
+ end
14
+
15
+ def intersect(*args)
16
+ other = _operation_from_args(args)
17
+ ComplexOperation.new(@client, Edges::SelectOperationType::Intersection, self, other)
18
+ end
19
+
20
+ def union(*args)
21
+ other = _operation_from_args(args)
22
+ ComplexOperation.new(@client, Edges::SelectOperationType::Union, self, other)
23
+ end
24
+
25
+ def difference(*args)
26
+ other = _operation_from_args(args)
27
+ ComplexOperation.new(@client, Edges::SelectOperationType::Difference, self, other)
28
+ end
29
+
30
+ def get_results(page)
31
+ @service.select(to_thrift, page)
32
+ end
33
+
34
+ def size
35
+ @service.count(to_thrift)
36
+ end
37
+
38
+ def operation
39
+ Flock::Operation.new do |page|
40
+ results = get_results(page)
41
+ [results.ids.unpack("Q*"), results.next_cursor, results.prev_cursor]
42
+ end
43
+ end
44
+
45
+ private
46
+
47
+ def _operation_from_args(args)
48
+ args.first.is_a?(SelectOperation) ? args.first : @client.select(*args)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,16 @@
1
+ module Flock
2
+ class SimpleOperation < SelectOperation
3
+ def initialize(client, query)
4
+ super(client)
5
+ @query = query
6
+ end
7
+
8
+ def to_thrift
9
+ operation = Edges::SelectOperation.new
10
+ operation.operation_type = Edges::SelectOperationType::SimpleQuery
11
+ operation.term = QueryTerm.new(@query).to_thrift
12
+
13
+ Array(operation)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Flock
2
+ class Service < ThriftClient
3
+ DEFAULTS = { :transport_wrapper => Thrift::BufferedTransport }
4
+
5
+ def initialize(servers = nil, options = {})
6
+ if servers.nil? or servers.empty?
7
+ STDERR.puts "No servers specified, using 127.0.0.1:7915"
8
+ servers = ['127.0.0.1:7915']
9
+ else
10
+ servers = Array(servers)
11
+ end
12
+
13
+ super(Edges::Client, servers, DEFAULTS.merge(options))
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,1445 @@
1
+ #
2
+ # Autogenerated by Thrift
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ module Flock
8
+ module Edges
9
+ class Client < Flock::Shards::Client
10
+ include ::Thrift::Client
11
+
12
+ def counts_of_destinations_for(source_ids, graph_id)
13
+ send_counts_of_destinations_for(source_ids, graph_id)
14
+ return recv_counts_of_destinations_for()
15
+ end
16
+
17
+ def send_counts_of_destinations_for(source_ids, graph_id)
18
+ send_message('counts_of_destinations_for', Counts_of_destinations_for_args, :source_ids => source_ids, :graph_id => graph_id)
19
+ end
20
+
21
+ def recv_counts_of_destinations_for()
22
+ result = receive_message(Counts_of_destinations_for_result)
23
+ return result.success unless result.success.nil?
24
+ raise result.ex unless result.ex.nil?
25
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'counts_of_destinations_for failed: unknown result')
26
+ end
27
+
28
+ def counts_of_sources_for(destination_ids, graph_id)
29
+ send_counts_of_sources_for(destination_ids, graph_id)
30
+ return recv_counts_of_sources_for()
31
+ end
32
+
33
+ def send_counts_of_sources_for(destination_ids, graph_id)
34
+ send_message('counts_of_sources_for', Counts_of_sources_for_args, :destination_ids => destination_ids, :graph_id => graph_id)
35
+ end
36
+
37
+ def recv_counts_of_sources_for()
38
+ result = receive_message(Counts_of_sources_for_result)
39
+ return result.success unless result.success.nil?
40
+ raise result.ex unless result.ex.nil?
41
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'counts_of_sources_for failed: unknown result')
42
+ end
43
+
44
+ def add(source_id, graph_id, destination_id)
45
+ send_add(source_id, graph_id, destination_id)
46
+ recv_add()
47
+ end
48
+
49
+ def send_add(source_id, graph_id, destination_id)
50
+ send_message('add', Add_args, :source_id => source_id, :graph_id => graph_id, :destination_id => destination_id)
51
+ end
52
+
53
+ def recv_add()
54
+ result = receive_message(Add_result)
55
+ raise result.ex unless result.ex.nil?
56
+ return
57
+ end
58
+
59
+ def remove(source_id, graph_id, destination_id)
60
+ send_remove(source_id, graph_id, destination_id)
61
+ recv_remove()
62
+ end
63
+
64
+ def send_remove(source_id, graph_id, destination_id)
65
+ send_message('remove', Remove_args, :source_id => source_id, :graph_id => graph_id, :destination_id => destination_id)
66
+ end
67
+
68
+ def recv_remove()
69
+ result = receive_message(Remove_result)
70
+ raise result.ex unless result.ex.nil?
71
+ return
72
+ end
73
+
74
+ def archive(source_id)
75
+ send_archive(source_id)
76
+ recv_archive()
77
+ end
78
+
79
+ def send_archive(source_id)
80
+ send_message('archive', Archive_args, :source_id => source_id)
81
+ end
82
+
83
+ def recv_archive()
84
+ result = receive_message(Archive_result)
85
+ raise result.ex unless result.ex.nil?
86
+ return
87
+ end
88
+
89
+ def unarchive(source_id)
90
+ send_unarchive(source_id)
91
+ recv_unarchive()
92
+ end
93
+
94
+ def send_unarchive(source_id)
95
+ send_message('unarchive', Unarchive_args, :source_id => source_id)
96
+ end
97
+
98
+ def recv_unarchive()
99
+ result = receive_message(Unarchive_result)
100
+ raise result.ex unless result.ex.nil?
101
+ return
102
+ end
103
+
104
+ def add_at(source_id, graph_id, destination_id, updated_at)
105
+ send_add_at(source_id, graph_id, destination_id, updated_at)
106
+ recv_add_at()
107
+ end
108
+
109
+ def send_add_at(source_id, graph_id, destination_id, updated_at)
110
+ send_message('add_at', Add_at_args, :source_id => source_id, :graph_id => graph_id, :destination_id => destination_id, :updated_at => updated_at)
111
+ end
112
+
113
+ def recv_add_at()
114
+ result = receive_message(Add_at_result)
115
+ raise result.ex unless result.ex.nil?
116
+ return
117
+ end
118
+
119
+ def remove_at(source_id, graph_id, destination_id, updated_at)
120
+ send_remove_at(source_id, graph_id, destination_id, updated_at)
121
+ recv_remove_at()
122
+ end
123
+
124
+ def send_remove_at(source_id, graph_id, destination_id, updated_at)
125
+ send_message('remove_at', Remove_at_args, :source_id => source_id, :graph_id => graph_id, :destination_id => destination_id, :updated_at => updated_at)
126
+ end
127
+
128
+ def recv_remove_at()
129
+ result = receive_message(Remove_at_result)
130
+ raise result.ex unless result.ex.nil?
131
+ return
132
+ end
133
+
134
+ def contains(source_id, graph_id, destination_id)
135
+ send_contains(source_id, graph_id, destination_id)
136
+ return recv_contains()
137
+ end
138
+
139
+ def send_contains(source_id, graph_id, destination_id)
140
+ send_message('contains', Contains_args, :source_id => source_id, :graph_id => graph_id, :destination_id => destination_id)
141
+ end
142
+
143
+ def recv_contains()
144
+ result = receive_message(Contains_result)
145
+ return result.success unless result.success.nil?
146
+ raise result.ex unless result.ex.nil?
147
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'contains failed: unknown result')
148
+ end
149
+
150
+ def get(source_id, graph_id, destination_id)
151
+ send_get(source_id, graph_id, destination_id)
152
+ return recv_get()
153
+ end
154
+
155
+ def send_get(source_id, graph_id, destination_id)
156
+ send_message('get', Get_args, :source_id => source_id, :graph_id => graph_id, :destination_id => destination_id)
157
+ end
158
+
159
+ def recv_get()
160
+ result = receive_message(Get_result)
161
+ return result.success unless result.success.nil?
162
+ raise result.ex unless result.ex.nil?
163
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get failed: unknown result')
164
+ end
165
+
166
+ def retry_errors()
167
+ send_retry_errors()
168
+ recv_retry_errors()
169
+ end
170
+
171
+ def send_retry_errors()
172
+ send_message('retry_errors', Retry_errors_args)
173
+ end
174
+
175
+ def recv_retry_errors()
176
+ result = receive_message(Retry_errors_result)
177
+ raise result.ex unless result.ex.nil?
178
+ return
179
+ end
180
+
181
+ def retry_migrate_errors()
182
+ send_retry_migrate_errors()
183
+ recv_retry_migrate_errors()
184
+ end
185
+
186
+ def send_retry_migrate_errors()
187
+ send_message('retry_migrate_errors', Retry_migrate_errors_args)
188
+ end
189
+
190
+ def recv_retry_migrate_errors()
191
+ result = receive_message(Retry_migrate_errors_result)
192
+ raise result.ex unless result.ex.nil?
193
+ return
194
+ end
195
+
196
+ def stop_writes()
197
+ send_stop_writes()
198
+ recv_stop_writes()
199
+ end
200
+
201
+ def send_stop_writes()
202
+ send_message('stop_writes', Stop_writes_args)
203
+ end
204
+
205
+ def recv_stop_writes()
206
+ result = receive_message(Stop_writes_result)
207
+ raise result.ex unless result.ex.nil?
208
+ return
209
+ end
210
+
211
+ def resume_writes()
212
+ send_resume_writes()
213
+ recv_resume_writes()
214
+ end
215
+
216
+ def send_resume_writes()
217
+ send_message('resume_writes', Resume_writes_args)
218
+ end
219
+
220
+ def recv_resume_writes()
221
+ result = receive_message(Resume_writes_result)
222
+ raise result.ex unless result.ex.nil?
223
+ return
224
+ end
225
+
226
+ def stop_writes_for(priority)
227
+ send_stop_writes_for(priority)
228
+ recv_stop_writes_for()
229
+ end
230
+
231
+ def send_stop_writes_for(priority)
232
+ send_message('stop_writes_for', Stop_writes_for_args, :priority => priority)
233
+ end
234
+
235
+ def recv_stop_writes_for()
236
+ result = receive_message(Stop_writes_for_result)
237
+ raise result.ex unless result.ex.nil?
238
+ return
239
+ end
240
+
241
+ def resume_writes_for(priority)
242
+ send_resume_writes_for(priority)
243
+ recv_resume_writes_for()
244
+ end
245
+
246
+ def send_resume_writes_for(priority)
247
+ send_message('resume_writes_for', Resume_writes_for_args, :priority => priority)
248
+ end
249
+
250
+ def recv_resume_writes_for()
251
+ result = receive_message(Resume_writes_for_result)
252
+ raise result.ex unless result.ex.nil?
253
+ return
254
+ end
255
+
256
+ def is_writing(priority)
257
+ send_is_writing(priority)
258
+ return recv_is_writing()
259
+ end
260
+
261
+ def send_is_writing(priority)
262
+ send_message('is_writing', Is_writing_args, :priority => priority)
263
+ end
264
+
265
+ def recv_is_writing()
266
+ result = receive_message(Is_writing_result)
267
+ return result.success unless result.success.nil?
268
+ raise result.ex unless result.ex.nil?
269
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'is_writing failed: unknown result')
270
+ end
271
+
272
+ def inject_job(priority, job)
273
+ send_inject_job(priority, job)
274
+ recv_inject_job()
275
+ end
276
+
277
+ def send_inject_job(priority, job)
278
+ send_message('inject_job', Inject_job_args, :priority => priority, :job => job)
279
+ end
280
+
281
+ def recv_inject_job()
282
+ result = receive_message(Inject_job_result)
283
+ raise result.ex unless result.ex.nil?
284
+ return
285
+ end
286
+
287
+ def select(operations, page)
288
+ send_select(operations, page)
289
+ return recv_select()
290
+ end
291
+
292
+ def send_select(operations, page)
293
+ send_message('select', Select_args, :operations => operations, :page => page)
294
+ end
295
+
296
+ def recv_select()
297
+ result = receive_message(Select_result)
298
+ return result.success unless result.success.nil?
299
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'select failed: unknown result')
300
+ end
301
+
302
+ def select2(queries)
303
+ send_select2(queries)
304
+ return recv_select2()
305
+ end
306
+
307
+ def send_select2(queries)
308
+ send_message('select2', Select2_args, :queries => queries)
309
+ end
310
+
311
+ def recv_select2()
312
+ result = receive_message(Select2_result)
313
+ return result.success unless result.success.nil?
314
+ raise result.ex unless result.ex.nil?
315
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'select2 failed: unknown result')
316
+ end
317
+
318
+ def select_edges(queries)
319
+ send_select_edges(queries)
320
+ return recv_select_edges()
321
+ end
322
+
323
+ def send_select_edges(queries)
324
+ send_message('select_edges', Select_edges_args, :queries => queries)
325
+ end
326
+
327
+ def recv_select_edges()
328
+ result = receive_message(Select_edges_result)
329
+ return result.success unless result.success.nil?
330
+ raise result.ex unless result.ex.nil?
331
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'select_edges failed: unknown result')
332
+ end
333
+
334
+ def execute(operations)
335
+ send_execute(operations)
336
+ recv_execute()
337
+ end
338
+
339
+ def send_execute(operations)
340
+ send_message('execute', Execute_args, :operations => operations)
341
+ end
342
+
343
+ def recv_execute()
344
+ result = receive_message(Execute_result)
345
+ return
346
+ end
347
+
348
+ def count(operations)
349
+ send_count(operations)
350
+ return recv_count()
351
+ end
352
+
353
+ def send_count(operations)
354
+ send_message('count', Count_args, :operations => operations)
355
+ end
356
+
357
+ def recv_count()
358
+ result = receive_message(Count_result)
359
+ return result.success unless result.success.nil?
360
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'count failed: unknown result')
361
+ end
362
+
363
+ def count2(queries)
364
+ send_count2(queries)
365
+ return recv_count2()
366
+ end
367
+
368
+ def send_count2(queries)
369
+ send_message('count2', Count2_args, :queries => queries)
370
+ end
371
+
372
+ def recv_count2()
373
+ result = receive_message(Count2_result)
374
+ return result.success unless result.success.nil?
375
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'count2 failed: unknown result')
376
+ end
377
+
378
+ end
379
+
380
+ class Processor < Flock::Shards::Processor
381
+ include ::Thrift::Processor
382
+
383
+ def process_counts_of_destinations_for(seqid, iprot, oprot)
384
+ args = read_args(iprot, Counts_of_destinations_for_args)
385
+ result = Counts_of_destinations_for_result.new()
386
+ begin
387
+ result.success = @handler.counts_of_destinations_for(args.source_ids, args.graph_id)
388
+ rescue Flock::FlockException => ex
389
+ result.ex = ex
390
+ end
391
+ write_result(result, oprot, 'counts_of_destinations_for', seqid)
392
+ end
393
+
394
+ def process_counts_of_sources_for(seqid, iprot, oprot)
395
+ args = read_args(iprot, Counts_of_sources_for_args)
396
+ result = Counts_of_sources_for_result.new()
397
+ begin
398
+ result.success = @handler.counts_of_sources_for(args.destination_ids, args.graph_id)
399
+ rescue Flock::FlockException => ex
400
+ result.ex = ex
401
+ end
402
+ write_result(result, oprot, 'counts_of_sources_for', seqid)
403
+ end
404
+
405
+ def process_add(seqid, iprot, oprot)
406
+ args = read_args(iprot, Add_args)
407
+ result = Add_result.new()
408
+ begin
409
+ @handler.add(args.source_id, args.graph_id, args.destination_id)
410
+ rescue Flock::FlockException => ex
411
+ result.ex = ex
412
+ end
413
+ write_result(result, oprot, 'add', seqid)
414
+ end
415
+
416
+ def process_remove(seqid, iprot, oprot)
417
+ args = read_args(iprot, Remove_args)
418
+ result = Remove_result.new()
419
+ begin
420
+ @handler.remove(args.source_id, args.graph_id, args.destination_id)
421
+ rescue Flock::FlockException => ex
422
+ result.ex = ex
423
+ end
424
+ write_result(result, oprot, 'remove', seqid)
425
+ end
426
+
427
+ def process_archive(seqid, iprot, oprot)
428
+ args = read_args(iprot, Archive_args)
429
+ result = Archive_result.new()
430
+ begin
431
+ @handler.archive(args.source_id)
432
+ rescue Flock::FlockException => ex
433
+ result.ex = ex
434
+ end
435
+ write_result(result, oprot, 'archive', seqid)
436
+ end
437
+
438
+ def process_unarchive(seqid, iprot, oprot)
439
+ args = read_args(iprot, Unarchive_args)
440
+ result = Unarchive_result.new()
441
+ begin
442
+ @handler.unarchive(args.source_id)
443
+ rescue Flock::FlockException => ex
444
+ result.ex = ex
445
+ end
446
+ write_result(result, oprot, 'unarchive', seqid)
447
+ end
448
+
449
+ def process_add_at(seqid, iprot, oprot)
450
+ args = read_args(iprot, Add_at_args)
451
+ result = Add_at_result.new()
452
+ begin
453
+ @handler.add_at(args.source_id, args.graph_id, args.destination_id, args.updated_at)
454
+ rescue Flock::FlockException => ex
455
+ result.ex = ex
456
+ end
457
+ write_result(result, oprot, 'add_at', seqid)
458
+ end
459
+
460
+ def process_remove_at(seqid, iprot, oprot)
461
+ args = read_args(iprot, Remove_at_args)
462
+ result = Remove_at_result.new()
463
+ begin
464
+ @handler.remove_at(args.source_id, args.graph_id, args.destination_id, args.updated_at)
465
+ rescue Flock::FlockException => ex
466
+ result.ex = ex
467
+ end
468
+ write_result(result, oprot, 'remove_at', seqid)
469
+ end
470
+
471
+ def process_contains(seqid, iprot, oprot)
472
+ args = read_args(iprot, Contains_args)
473
+ result = Contains_result.new()
474
+ begin
475
+ result.success = @handler.contains(args.source_id, args.graph_id, args.destination_id)
476
+ rescue Flock::FlockException => ex
477
+ result.ex = ex
478
+ end
479
+ write_result(result, oprot, 'contains', seqid)
480
+ end
481
+
482
+ def process_get(seqid, iprot, oprot)
483
+ args = read_args(iprot, Get_args)
484
+ result = Get_result.new()
485
+ begin
486
+ result.success = @handler.get(args.source_id, args.graph_id, args.destination_id)
487
+ rescue Flock::FlockException => ex
488
+ result.ex = ex
489
+ end
490
+ write_result(result, oprot, 'get', seqid)
491
+ end
492
+
493
+ def process_retry_errors(seqid, iprot, oprot)
494
+ args = read_args(iprot, Retry_errors_args)
495
+ result = Retry_errors_result.new()
496
+ begin
497
+ @handler.retry_errors()
498
+ rescue Flock::FlockException => ex
499
+ result.ex = ex
500
+ end
501
+ write_result(result, oprot, 'retry_errors', seqid)
502
+ end
503
+
504
+ def process_retry_migrate_errors(seqid, iprot, oprot)
505
+ args = read_args(iprot, Retry_migrate_errors_args)
506
+ result = Retry_migrate_errors_result.new()
507
+ begin
508
+ @handler.retry_migrate_errors()
509
+ rescue Flock::FlockException => ex
510
+ result.ex = ex
511
+ end
512
+ write_result(result, oprot, 'retry_migrate_errors', seqid)
513
+ end
514
+
515
+ def process_stop_writes(seqid, iprot, oprot)
516
+ args = read_args(iprot, Stop_writes_args)
517
+ result = Stop_writes_result.new()
518
+ begin
519
+ @handler.stop_writes()
520
+ rescue Flock::FlockException => ex
521
+ result.ex = ex
522
+ end
523
+ write_result(result, oprot, 'stop_writes', seqid)
524
+ end
525
+
526
+ def process_resume_writes(seqid, iprot, oprot)
527
+ args = read_args(iprot, Resume_writes_args)
528
+ result = Resume_writes_result.new()
529
+ begin
530
+ @handler.resume_writes()
531
+ rescue Flock::FlockException => ex
532
+ result.ex = ex
533
+ end
534
+ write_result(result, oprot, 'resume_writes', seqid)
535
+ end
536
+
537
+ def process_stop_writes_for(seqid, iprot, oprot)
538
+ args = read_args(iprot, Stop_writes_for_args)
539
+ result = Stop_writes_for_result.new()
540
+ begin
541
+ @handler.stop_writes_for(args.priority)
542
+ rescue Flock::FlockException => ex
543
+ result.ex = ex
544
+ end
545
+ write_result(result, oprot, 'stop_writes_for', seqid)
546
+ end
547
+
548
+ def process_resume_writes_for(seqid, iprot, oprot)
549
+ args = read_args(iprot, Resume_writes_for_args)
550
+ result = Resume_writes_for_result.new()
551
+ begin
552
+ @handler.resume_writes_for(args.priority)
553
+ rescue Flock::FlockException => ex
554
+ result.ex = ex
555
+ end
556
+ write_result(result, oprot, 'resume_writes_for', seqid)
557
+ end
558
+
559
+ def process_is_writing(seqid, iprot, oprot)
560
+ args = read_args(iprot, Is_writing_args)
561
+ result = Is_writing_result.new()
562
+ begin
563
+ result.success = @handler.is_writing(args.priority)
564
+ rescue Flock::FlockException => ex
565
+ result.ex = ex
566
+ end
567
+ write_result(result, oprot, 'is_writing', seqid)
568
+ end
569
+
570
+ def process_inject_job(seqid, iprot, oprot)
571
+ args = read_args(iprot, Inject_job_args)
572
+ result = Inject_job_result.new()
573
+ begin
574
+ @handler.inject_job(args.priority, args.job)
575
+ rescue Flock::FlockException => ex
576
+ result.ex = ex
577
+ end
578
+ write_result(result, oprot, 'inject_job', seqid)
579
+ end
580
+
581
+ def process_select(seqid, iprot, oprot)
582
+ args = read_args(iprot, Select_args)
583
+ result = Select_result.new()
584
+ result.success = @handler.select(args.operations, args.page)
585
+ write_result(result, oprot, 'select', seqid)
586
+ end
587
+
588
+ def process_select2(seqid, iprot, oprot)
589
+ args = read_args(iprot, Select2_args)
590
+ result = Select2_result.new()
591
+ begin
592
+ result.success = @handler.select2(args.queries)
593
+ rescue Flock::FlockException => ex
594
+ result.ex = ex
595
+ end
596
+ write_result(result, oprot, 'select2', seqid)
597
+ end
598
+
599
+ def process_select_edges(seqid, iprot, oprot)
600
+ args = read_args(iprot, Select_edges_args)
601
+ result = Select_edges_result.new()
602
+ begin
603
+ result.success = @handler.select_edges(args.queries)
604
+ rescue Flock::FlockException => ex
605
+ result.ex = ex
606
+ end
607
+ write_result(result, oprot, 'select_edges', seqid)
608
+ end
609
+
610
+ def process_execute(seqid, iprot, oprot)
611
+ args = read_args(iprot, Execute_args)
612
+ result = Execute_result.new()
613
+ @handler.execute(args.operations)
614
+ write_result(result, oprot, 'execute', seqid)
615
+ end
616
+
617
+ def process_count(seqid, iprot, oprot)
618
+ args = read_args(iprot, Count_args)
619
+ result = Count_result.new()
620
+ result.success = @handler.count(args.operations)
621
+ write_result(result, oprot, 'count', seqid)
622
+ end
623
+
624
+ def process_count2(seqid, iprot, oprot)
625
+ args = read_args(iprot, Count2_args)
626
+ result = Count2_result.new()
627
+ result.success = @handler.count2(args.queries)
628
+ write_result(result, oprot, 'count2', seqid)
629
+ end
630
+
631
+ end
632
+
633
+ # HELPER FUNCTIONS AND STRUCTURES
634
+
635
+ class Counts_of_destinations_for_args
636
+ include ::Thrift::Struct
637
+ SOURCE_IDS = 1
638
+ GRAPH_ID = 2
639
+
640
+ ::Thrift::Struct.field_accessor self, :source_ids, :graph_id
641
+ FIELDS = {
642
+ SOURCE_IDS => {:type => ::Thrift::Types::STRING, :name => 'source_ids'},
643
+ GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'}
644
+ }
645
+
646
+ def struct_fields; FIELDS; end
647
+
648
+ def validate
649
+ end
650
+
651
+ end
652
+
653
+ class Counts_of_destinations_for_result
654
+ include ::Thrift::Struct
655
+ SUCCESS = 0
656
+ EX = -1
657
+
658
+ ::Thrift::Struct.field_accessor self, :success, :ex
659
+ FIELDS = {
660
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'},
661
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
662
+ }
663
+
664
+ def struct_fields; FIELDS; end
665
+
666
+ def validate
667
+ end
668
+
669
+ end
670
+
671
+ class Counts_of_sources_for_args
672
+ include ::Thrift::Struct
673
+ DESTINATION_IDS = 1
674
+ GRAPH_ID = 2
675
+
676
+ ::Thrift::Struct.field_accessor self, :destination_ids, :graph_id
677
+ FIELDS = {
678
+ DESTINATION_IDS => {:type => ::Thrift::Types::STRING, :name => 'destination_ids'},
679
+ GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'}
680
+ }
681
+
682
+ def struct_fields; FIELDS; end
683
+
684
+ def validate
685
+ end
686
+
687
+ end
688
+
689
+ class Counts_of_sources_for_result
690
+ include ::Thrift::Struct
691
+ SUCCESS = 0
692
+ EX = -1
693
+
694
+ ::Thrift::Struct.field_accessor self, :success, :ex
695
+ FIELDS = {
696
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'},
697
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
698
+ }
699
+
700
+ def struct_fields; FIELDS; end
701
+
702
+ def validate
703
+ end
704
+
705
+ end
706
+
707
+ class Add_args
708
+ include ::Thrift::Struct
709
+ SOURCE_ID = 1
710
+ GRAPH_ID = 2
711
+ DESTINATION_ID = 3
712
+
713
+ ::Thrift::Struct.field_accessor self, :source_id, :graph_id, :destination_id
714
+ FIELDS = {
715
+ SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
716
+ GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'},
717
+ DESTINATION_ID => {:type => ::Thrift::Types::I64, :name => 'destination_id'}
718
+ }
719
+
720
+ def struct_fields; FIELDS; end
721
+
722
+ def validate
723
+ end
724
+
725
+ end
726
+
727
+ class Add_result
728
+ include ::Thrift::Struct
729
+ EX = -1
730
+
731
+ ::Thrift::Struct.field_accessor self, :ex
732
+ FIELDS = {
733
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
734
+ }
735
+
736
+ def struct_fields; FIELDS; end
737
+
738
+ def validate
739
+ end
740
+
741
+ end
742
+
743
+ class Remove_args
744
+ include ::Thrift::Struct
745
+ SOURCE_ID = 1
746
+ GRAPH_ID = 2
747
+ DESTINATION_ID = 3
748
+
749
+ ::Thrift::Struct.field_accessor self, :source_id, :graph_id, :destination_id
750
+ FIELDS = {
751
+ SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
752
+ GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'},
753
+ DESTINATION_ID => {:type => ::Thrift::Types::I64, :name => 'destination_id'}
754
+ }
755
+
756
+ def struct_fields; FIELDS; end
757
+
758
+ def validate
759
+ end
760
+
761
+ end
762
+
763
+ class Remove_result
764
+ include ::Thrift::Struct
765
+ EX = -1
766
+
767
+ ::Thrift::Struct.field_accessor self, :ex
768
+ FIELDS = {
769
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
770
+ }
771
+
772
+ def struct_fields; FIELDS; end
773
+
774
+ def validate
775
+ end
776
+
777
+ end
778
+
779
+ class Archive_args
780
+ include ::Thrift::Struct
781
+ SOURCE_ID = 1
782
+
783
+ ::Thrift::Struct.field_accessor self, :source_id
784
+ FIELDS = {
785
+ SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'}
786
+ }
787
+
788
+ def struct_fields; FIELDS; end
789
+
790
+ def validate
791
+ end
792
+
793
+ end
794
+
795
+ class Archive_result
796
+ include ::Thrift::Struct
797
+ EX = -1
798
+
799
+ ::Thrift::Struct.field_accessor self, :ex
800
+ FIELDS = {
801
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
802
+ }
803
+
804
+ def struct_fields; FIELDS; end
805
+
806
+ def validate
807
+ end
808
+
809
+ end
810
+
811
+ class Unarchive_args
812
+ include ::Thrift::Struct
813
+ SOURCE_ID = 1
814
+
815
+ ::Thrift::Struct.field_accessor self, :source_id
816
+ FIELDS = {
817
+ SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'}
818
+ }
819
+
820
+ def struct_fields; FIELDS; end
821
+
822
+ def validate
823
+ end
824
+
825
+ end
826
+
827
+ class Unarchive_result
828
+ include ::Thrift::Struct
829
+ EX = -1
830
+
831
+ ::Thrift::Struct.field_accessor self, :ex
832
+ FIELDS = {
833
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
834
+ }
835
+
836
+ def struct_fields; FIELDS; end
837
+
838
+ def validate
839
+ end
840
+
841
+ end
842
+
843
+ class Add_at_args
844
+ include ::Thrift::Struct
845
+ SOURCE_ID = 1
846
+ GRAPH_ID = 2
847
+ DESTINATION_ID = 3
848
+ UPDATED_AT = 4
849
+
850
+ ::Thrift::Struct.field_accessor self, :source_id, :graph_id, :destination_id, :updated_at
851
+ FIELDS = {
852
+ SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
853
+ GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'},
854
+ DESTINATION_ID => {:type => ::Thrift::Types::I64, :name => 'destination_id'},
855
+ UPDATED_AT => {:type => ::Thrift::Types::I64, :name => 'updated_at'}
856
+ }
857
+
858
+ def struct_fields; FIELDS; end
859
+
860
+ def validate
861
+ end
862
+
863
+ end
864
+
865
+ class Add_at_result
866
+ include ::Thrift::Struct
867
+ EX = -1
868
+
869
+ ::Thrift::Struct.field_accessor self, :ex
870
+ FIELDS = {
871
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
872
+ }
873
+
874
+ def struct_fields; FIELDS; end
875
+
876
+ def validate
877
+ end
878
+
879
+ end
880
+
881
+ class Remove_at_args
882
+ include ::Thrift::Struct
883
+ SOURCE_ID = 1
884
+ GRAPH_ID = 2
885
+ DESTINATION_ID = 3
886
+ UPDATED_AT = 4
887
+
888
+ ::Thrift::Struct.field_accessor self, :source_id, :graph_id, :destination_id, :updated_at
889
+ FIELDS = {
890
+ SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
891
+ GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'},
892
+ DESTINATION_ID => {:type => ::Thrift::Types::I64, :name => 'destination_id'},
893
+ UPDATED_AT => {:type => ::Thrift::Types::I64, :name => 'updated_at'}
894
+ }
895
+
896
+ def struct_fields; FIELDS; end
897
+
898
+ def validate
899
+ end
900
+
901
+ end
902
+
903
+ class Remove_at_result
904
+ include ::Thrift::Struct
905
+ EX = -1
906
+
907
+ ::Thrift::Struct.field_accessor self, :ex
908
+ FIELDS = {
909
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
910
+ }
911
+
912
+ def struct_fields; FIELDS; end
913
+
914
+ def validate
915
+ end
916
+
917
+ end
918
+
919
+ class Contains_args
920
+ include ::Thrift::Struct
921
+ SOURCE_ID = 1
922
+ GRAPH_ID = 2
923
+ DESTINATION_ID = 3
924
+
925
+ ::Thrift::Struct.field_accessor self, :source_id, :graph_id, :destination_id
926
+ FIELDS = {
927
+ SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
928
+ GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'},
929
+ DESTINATION_ID => {:type => ::Thrift::Types::I64, :name => 'destination_id'}
930
+ }
931
+
932
+ def struct_fields; FIELDS; end
933
+
934
+ def validate
935
+ end
936
+
937
+ end
938
+
939
+ class Contains_result
940
+ include ::Thrift::Struct
941
+ SUCCESS = 0
942
+ EX = -1
943
+
944
+ ::Thrift::Struct.field_accessor self, :success, :ex
945
+ FIELDS = {
946
+ SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'},
947
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
948
+ }
949
+
950
+ def struct_fields; FIELDS; end
951
+
952
+ def validate
953
+ end
954
+
955
+ end
956
+
957
+ class Get_args
958
+ include ::Thrift::Struct
959
+ SOURCE_ID = 1
960
+ GRAPH_ID = 2
961
+ DESTINATION_ID = 3
962
+
963
+ ::Thrift::Struct.field_accessor self, :source_id, :graph_id, :destination_id
964
+ FIELDS = {
965
+ SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
966
+ GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'},
967
+ DESTINATION_ID => {:type => ::Thrift::Types::I64, :name => 'destination_id'}
968
+ }
969
+
970
+ def struct_fields; FIELDS; end
971
+
972
+ def validate
973
+ end
974
+
975
+ end
976
+
977
+ class Get_result
978
+ include ::Thrift::Struct
979
+ SUCCESS = 0
980
+ EX = -1
981
+
982
+ ::Thrift::Struct.field_accessor self, :success, :ex
983
+ FIELDS = {
984
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Edges::Edge},
985
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
986
+ }
987
+
988
+ def struct_fields; FIELDS; end
989
+
990
+ def validate
991
+ end
992
+
993
+ end
994
+
995
+ class Retry_errors_args
996
+ include ::Thrift::Struct
997
+
998
+ FIELDS = {
999
+
1000
+ }
1001
+
1002
+ def struct_fields; FIELDS; end
1003
+
1004
+ def validate
1005
+ end
1006
+
1007
+ end
1008
+
1009
+ class Retry_errors_result
1010
+ include ::Thrift::Struct
1011
+ EX = -1
1012
+
1013
+ ::Thrift::Struct.field_accessor self, :ex
1014
+ FIELDS = {
1015
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1016
+ }
1017
+
1018
+ def struct_fields; FIELDS; end
1019
+
1020
+ def validate
1021
+ end
1022
+
1023
+ end
1024
+
1025
+ class Retry_migrate_errors_args
1026
+ include ::Thrift::Struct
1027
+
1028
+ FIELDS = {
1029
+
1030
+ }
1031
+
1032
+ def struct_fields; FIELDS; end
1033
+
1034
+ def validate
1035
+ end
1036
+
1037
+ end
1038
+
1039
+ class Retry_migrate_errors_result
1040
+ include ::Thrift::Struct
1041
+ EX = -1
1042
+
1043
+ ::Thrift::Struct.field_accessor self, :ex
1044
+ FIELDS = {
1045
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1046
+ }
1047
+
1048
+ def struct_fields; FIELDS; end
1049
+
1050
+ def validate
1051
+ end
1052
+
1053
+ end
1054
+
1055
+ class Stop_writes_args
1056
+ include ::Thrift::Struct
1057
+
1058
+ FIELDS = {
1059
+
1060
+ }
1061
+
1062
+ def struct_fields; FIELDS; end
1063
+
1064
+ def validate
1065
+ end
1066
+
1067
+ end
1068
+
1069
+ class Stop_writes_result
1070
+ include ::Thrift::Struct
1071
+ EX = -1
1072
+
1073
+ ::Thrift::Struct.field_accessor self, :ex
1074
+ FIELDS = {
1075
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1076
+ }
1077
+
1078
+ def struct_fields; FIELDS; end
1079
+
1080
+ def validate
1081
+ end
1082
+
1083
+ end
1084
+
1085
+ class Resume_writes_args
1086
+ include ::Thrift::Struct
1087
+
1088
+ FIELDS = {
1089
+
1090
+ }
1091
+
1092
+ def struct_fields; FIELDS; end
1093
+
1094
+ def validate
1095
+ end
1096
+
1097
+ end
1098
+
1099
+ class Resume_writes_result
1100
+ include ::Thrift::Struct
1101
+ EX = -1
1102
+
1103
+ ::Thrift::Struct.field_accessor self, :ex
1104
+ FIELDS = {
1105
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1106
+ }
1107
+
1108
+ def struct_fields; FIELDS; end
1109
+
1110
+ def validate
1111
+ end
1112
+
1113
+ end
1114
+
1115
+ class Stop_writes_for_args
1116
+ include ::Thrift::Struct
1117
+ PRIORITY = 1
1118
+
1119
+ ::Thrift::Struct.field_accessor self, :priority
1120
+ FIELDS = {
1121
+ PRIORITY => {:type => ::Thrift::Types::I32, :name => 'priority'}
1122
+ }
1123
+
1124
+ def struct_fields; FIELDS; end
1125
+
1126
+ def validate
1127
+ end
1128
+
1129
+ end
1130
+
1131
+ class Stop_writes_for_result
1132
+ include ::Thrift::Struct
1133
+ EX = -1
1134
+
1135
+ ::Thrift::Struct.field_accessor self, :ex
1136
+ FIELDS = {
1137
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1138
+ }
1139
+
1140
+ def struct_fields; FIELDS; end
1141
+
1142
+ def validate
1143
+ end
1144
+
1145
+ end
1146
+
1147
+ class Resume_writes_for_args
1148
+ include ::Thrift::Struct
1149
+ PRIORITY = 1
1150
+
1151
+ ::Thrift::Struct.field_accessor self, :priority
1152
+ FIELDS = {
1153
+ PRIORITY => {:type => ::Thrift::Types::I32, :name => 'priority'}
1154
+ }
1155
+
1156
+ def struct_fields; FIELDS; end
1157
+
1158
+ def validate
1159
+ end
1160
+
1161
+ end
1162
+
1163
+ class Resume_writes_for_result
1164
+ include ::Thrift::Struct
1165
+ EX = -1
1166
+
1167
+ ::Thrift::Struct.field_accessor self, :ex
1168
+ FIELDS = {
1169
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1170
+ }
1171
+
1172
+ def struct_fields; FIELDS; end
1173
+
1174
+ def validate
1175
+ end
1176
+
1177
+ end
1178
+
1179
+ class Is_writing_args
1180
+ include ::Thrift::Struct
1181
+ PRIORITY = 1
1182
+
1183
+ ::Thrift::Struct.field_accessor self, :priority
1184
+ FIELDS = {
1185
+ PRIORITY => {:type => ::Thrift::Types::I32, :name => 'priority'}
1186
+ }
1187
+
1188
+ def struct_fields; FIELDS; end
1189
+
1190
+ def validate
1191
+ end
1192
+
1193
+ end
1194
+
1195
+ class Is_writing_result
1196
+ include ::Thrift::Struct
1197
+ SUCCESS = 0
1198
+ EX = -1
1199
+
1200
+ ::Thrift::Struct.field_accessor self, :success, :ex
1201
+ FIELDS = {
1202
+ SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'},
1203
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1204
+ }
1205
+
1206
+ def struct_fields; FIELDS; end
1207
+
1208
+ def validate
1209
+ end
1210
+
1211
+ end
1212
+
1213
+ class Inject_job_args
1214
+ include ::Thrift::Struct
1215
+ PRIORITY = 1
1216
+ JOB = 2
1217
+
1218
+ ::Thrift::Struct.field_accessor self, :priority, :job
1219
+ FIELDS = {
1220
+ PRIORITY => {:type => ::Thrift::Types::I32, :name => 'priority'},
1221
+ JOB => {:type => ::Thrift::Types::STRING, :name => 'job'}
1222
+ }
1223
+
1224
+ def struct_fields; FIELDS; end
1225
+
1226
+ def validate
1227
+ end
1228
+
1229
+ end
1230
+
1231
+ class Inject_job_result
1232
+ include ::Thrift::Struct
1233
+ EX = -1
1234
+
1235
+ ::Thrift::Struct.field_accessor self, :ex
1236
+ FIELDS = {
1237
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1238
+ }
1239
+
1240
+ def struct_fields; FIELDS; end
1241
+
1242
+ def validate
1243
+ end
1244
+
1245
+ end
1246
+
1247
+ class Select_args
1248
+ include ::Thrift::Struct
1249
+ OPERATIONS = 1
1250
+ PAGE = 2
1251
+
1252
+ ::Thrift::Struct.field_accessor self, :operations, :page
1253
+ FIELDS = {
1254
+ OPERATIONS => {:type => ::Thrift::Types::LIST, :name => 'operations', :element => {:type => ::Thrift::Types::STRUCT, :class => Edges::SelectOperation}},
1255
+ PAGE => {:type => ::Thrift::Types::STRUCT, :name => 'page', :class => Flock::Page}
1256
+ }
1257
+
1258
+ def struct_fields; FIELDS; end
1259
+
1260
+ def validate
1261
+ end
1262
+
1263
+ end
1264
+
1265
+ class Select_result
1266
+ include ::Thrift::Struct
1267
+ SUCCESS = 0
1268
+
1269
+ ::Thrift::Struct.field_accessor self, :success
1270
+ FIELDS = {
1271
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Flock::Results}
1272
+ }
1273
+
1274
+ def struct_fields; FIELDS; end
1275
+
1276
+ def validate
1277
+ end
1278
+
1279
+ end
1280
+
1281
+ class Select2_args
1282
+ include ::Thrift::Struct
1283
+ QUERIES = 1
1284
+
1285
+ ::Thrift::Struct.field_accessor self, :queries
1286
+ FIELDS = {
1287
+ QUERIES => {:type => ::Thrift::Types::LIST, :name => 'queries', :element => {:type => ::Thrift::Types::STRUCT, :class => Edges::SelectQuery}}
1288
+ }
1289
+
1290
+ def struct_fields; FIELDS; end
1291
+
1292
+ def validate
1293
+ end
1294
+
1295
+ end
1296
+
1297
+ class Select2_result
1298
+ include ::Thrift::Struct
1299
+ SUCCESS = 0
1300
+ EX = -1
1301
+
1302
+ ::Thrift::Struct.field_accessor self, :success, :ex
1303
+ FIELDS = {
1304
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => Flock::Results}},
1305
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1306
+ }
1307
+
1308
+ def struct_fields; FIELDS; end
1309
+
1310
+ def validate
1311
+ end
1312
+
1313
+ end
1314
+
1315
+ class Select_edges_args
1316
+ include ::Thrift::Struct
1317
+ QUERIES = 1
1318
+
1319
+ ::Thrift::Struct.field_accessor self, :queries
1320
+ FIELDS = {
1321
+ QUERIES => {:type => ::Thrift::Types::LIST, :name => 'queries', :element => {:type => ::Thrift::Types::STRUCT, :class => Edges::EdgeQuery}}
1322
+ }
1323
+
1324
+ def struct_fields; FIELDS; end
1325
+
1326
+ def validate
1327
+ end
1328
+
1329
+ end
1330
+
1331
+ class Select_edges_result
1332
+ include ::Thrift::Struct
1333
+ SUCCESS = 0
1334
+ EX = -1
1335
+
1336
+ ::Thrift::Struct.field_accessor self, :success, :ex
1337
+ FIELDS = {
1338
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => Edges::EdgeResults}},
1339
+ EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => Flock::FlockException}
1340
+ }
1341
+
1342
+ def struct_fields; FIELDS; end
1343
+
1344
+ def validate
1345
+ end
1346
+
1347
+ end
1348
+
1349
+ class Execute_args
1350
+ include ::Thrift::Struct
1351
+ OPERATIONS = 1
1352
+
1353
+ ::Thrift::Struct.field_accessor self, :operations
1354
+ FIELDS = {
1355
+ OPERATIONS => {:type => ::Thrift::Types::STRUCT, :name => 'operations', :class => Edges::ExecuteOperations}
1356
+ }
1357
+
1358
+ def struct_fields; FIELDS; end
1359
+
1360
+ def validate
1361
+ end
1362
+
1363
+ end
1364
+
1365
+ class Execute_result
1366
+ include ::Thrift::Struct
1367
+
1368
+ FIELDS = {
1369
+
1370
+ }
1371
+
1372
+ def struct_fields; FIELDS; end
1373
+
1374
+ def validate
1375
+ end
1376
+
1377
+ end
1378
+
1379
+ class Count_args
1380
+ include ::Thrift::Struct
1381
+ OPERATIONS = 1
1382
+
1383
+ ::Thrift::Struct.field_accessor self, :operations
1384
+ FIELDS = {
1385
+ OPERATIONS => {:type => ::Thrift::Types::LIST, :name => 'operations', :element => {:type => ::Thrift::Types::STRUCT, :class => Edges::SelectOperation}}
1386
+ }
1387
+
1388
+ def struct_fields; FIELDS; end
1389
+
1390
+ def validate
1391
+ end
1392
+
1393
+ end
1394
+
1395
+ class Count_result
1396
+ include ::Thrift::Struct
1397
+ SUCCESS = 0
1398
+
1399
+ ::Thrift::Struct.field_accessor self, :success
1400
+ FIELDS = {
1401
+ SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}
1402
+ }
1403
+
1404
+ def struct_fields; FIELDS; end
1405
+
1406
+ def validate
1407
+ end
1408
+
1409
+ end
1410
+
1411
+ class Count2_args
1412
+ include ::Thrift::Struct
1413
+ QUERIES = 1
1414
+
1415
+ ::Thrift::Struct.field_accessor self, :queries
1416
+ FIELDS = {
1417
+ QUERIES => {:type => ::Thrift::Types::LIST, :name => 'queries', :element => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => Edges::SelectOperation}}}
1418
+ }
1419
+
1420
+ def struct_fields; FIELDS; end
1421
+
1422
+ def validate
1423
+ end
1424
+
1425
+ end
1426
+
1427
+ class Count2_result
1428
+ include ::Thrift::Struct
1429
+ SUCCESS = 0
1430
+
1431
+ ::Thrift::Struct.field_accessor self, :success
1432
+ FIELDS = {
1433
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
1434
+ }
1435
+
1436
+ def struct_fields; FIELDS; end
1437
+
1438
+ def validate
1439
+ end
1440
+
1441
+ end
1442
+
1443
+ end
1444
+
1445
+ end