tempest_db 0.12.1

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,37 @@
1
+ require 'thrift'
2
+
3
+ module Teapot
4
+ class BaseThriftClient
5
+
6
+ @server = nil
7
+ @port = nil
8
+ @executor = nil
9
+ @transport = nil
10
+
11
+ def initialize(server, port)
12
+ @server = server
13
+ @port = port
14
+ @executor = init_executor(init_protocol())
15
+ end
16
+
17
+ def init_protocol
18
+ @transport = Thrift::BufferedTransport.new(Thrift::Socket.new(@server, @port))
19
+ @transport.open
20
+ Thrift::BinaryProtocol.new(@transport)
21
+ end
22
+
23
+ def init_executor(protocol)
24
+ raise NotImplementedError, 'Undefined method in BaseThriftClient. init_executor() method should be implemented by the subclass.'
25
+ end
26
+
27
+ def close
28
+ @transport.close
29
+ end
30
+
31
+ def get_executor
32
+ @executor
33
+ end
34
+
35
+ end
36
+ end
37
+
@@ -0,0 +1,9 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'tempest_types'
9
+
@@ -0,0 +1,481 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'tempest_graph_service'
9
+ require 'tempest_db_types'
10
+
11
+ module Teapot
12
+ module TempestDB
13
+ module TempestDBService
14
+ class Client < ::TempestGraphService::Client
15
+ include ::Thrift::Client
16
+
17
+ def getMultiNodeAttributeAsJSON(nodeType, nodeIds, attributeName)
18
+ send_getMultiNodeAttributeAsJSON(nodeType, nodeIds, attributeName)
19
+ return recv_getMultiNodeAttributeAsJSON()
20
+ end
21
+
22
+ def send_getMultiNodeAttributeAsJSON(nodeType, nodeIds, attributeName)
23
+ send_message('getMultiNodeAttributeAsJSON', GetMultiNodeAttributeAsJSON_args, :nodeType => nodeType, :nodeIds => nodeIds, :attributeName => attributeName)
24
+ end
25
+
26
+ def recv_getMultiNodeAttributeAsJSON()
27
+ result = receive_message(GetMultiNodeAttributeAsJSON_result)
28
+ return result.success unless result.success.nil?
29
+ raise result.error1 unless result.error1.nil?
30
+ raise result.error2 unless result.error2.nil?
31
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getMultiNodeAttributeAsJSON failed: unknown result')
32
+ end
33
+
34
+ def nodes(nodeType, sqlClause)
35
+ send_nodes(nodeType, sqlClause)
36
+ return recv_nodes()
37
+ end
38
+
39
+ def send_nodes(nodeType, sqlClause)
40
+ send_message('nodes', Nodes_args, :nodeType => nodeType, :sqlClause => sqlClause)
41
+ end
42
+
43
+ def recv_nodes()
44
+ result = receive_message(Nodes_result)
45
+ return result.success unless result.success.nil?
46
+ raise result.error1 unless result.error1.nil?
47
+ raise result.error2 unless result.error2.nil?
48
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'nodes failed: unknown result')
49
+ end
50
+
51
+ def kStepOutNeighborsFiltered(edgeType, sourceId, k, sqlClause, filter, alternating)
52
+ send_kStepOutNeighborsFiltered(edgeType, sourceId, k, sqlClause, filter, alternating)
53
+ return recv_kStepOutNeighborsFiltered()
54
+ end
55
+
56
+ def send_kStepOutNeighborsFiltered(edgeType, sourceId, k, sqlClause, filter, alternating)
57
+ send_message('kStepOutNeighborsFiltered', KStepOutNeighborsFiltered_args, :edgeType => edgeType, :sourceId => sourceId, :k => k, :sqlClause => sqlClause, :filter => filter, :alternating => alternating)
58
+ end
59
+
60
+ def recv_kStepOutNeighborsFiltered()
61
+ result = receive_message(KStepOutNeighborsFiltered_result)
62
+ return result.success unless result.success.nil?
63
+ raise result.error1 unless result.error1.nil?
64
+ raise result.error2 unless result.error2.nil?
65
+ raise result.error3 unless result.error3.nil?
66
+ raise result.error4 unless result.error4.nil?
67
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'kStepOutNeighborsFiltered failed: unknown result')
68
+ end
69
+
70
+ def kStepInNeighborsFiltered(edgeType, sourceId, k, sqlClause, filter, alternating)
71
+ send_kStepInNeighborsFiltered(edgeType, sourceId, k, sqlClause, filter, alternating)
72
+ return recv_kStepInNeighborsFiltered()
73
+ end
74
+
75
+ def send_kStepInNeighborsFiltered(edgeType, sourceId, k, sqlClause, filter, alternating)
76
+ send_message('kStepInNeighborsFiltered', KStepInNeighborsFiltered_args, :edgeType => edgeType, :sourceId => sourceId, :k => k, :sqlClause => sqlClause, :filter => filter, :alternating => alternating)
77
+ end
78
+
79
+ def recv_kStepInNeighborsFiltered()
80
+ result = receive_message(KStepInNeighborsFiltered_result)
81
+ return result.success unless result.success.nil?
82
+ raise result.error1 unless result.error1.nil?
83
+ raise result.error2 unless result.error2.nil?
84
+ raise result.error3 unless result.error3.nil?
85
+ raise result.error4 unless result.error4.nil?
86
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'kStepInNeighborsFiltered failed: unknown result')
87
+ end
88
+
89
+ def ppr(edgeType, seeds, pageRankParams)
90
+ send_ppr(edgeType, seeds, pageRankParams)
91
+ return recv_ppr()
92
+ end
93
+
94
+ def send_ppr(edgeType, seeds, pageRankParams)
95
+ send_message('ppr', Ppr_args, :edgeType => edgeType, :seeds => seeds, :pageRankParams => pageRankParams)
96
+ end
97
+
98
+ def recv_ppr()
99
+ result = receive_message(Ppr_result)
100
+ return result.success unless result.success.nil?
101
+ raise result.error1 unless result.error1.nil?
102
+ raise result.error2 unless result.error2.nil?
103
+ raise result.error3 unless result.error3.nil?
104
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'ppr failed: unknown result')
105
+ end
106
+
107
+ def addEdges(edgeType, ids1, ids2)
108
+ send_addEdges(edgeType, ids1, ids2)
109
+ recv_addEdges()
110
+ end
111
+
112
+ def send_addEdges(edgeType, ids1, ids2)
113
+ send_message('addEdges', AddEdges_args, :edgeType => edgeType, :ids1 => ids1, :ids2 => ids2)
114
+ end
115
+
116
+ def recv_addEdges()
117
+ result = receive_message(AddEdges_result)
118
+ raise result.error1 unless result.error1.nil?
119
+ raise result.error2 unless result.error2.nil?
120
+ return
121
+ end
122
+
123
+ end
124
+
125
+ class Processor < ::TempestGraphService::Processor
126
+ include ::Thrift::Processor
127
+
128
+ def process_getMultiNodeAttributeAsJSON(seqid, iprot, oprot)
129
+ args = read_args(iprot, GetMultiNodeAttributeAsJSON_args)
130
+ result = GetMultiNodeAttributeAsJSON_result.new()
131
+ begin
132
+ result.success = @handler.getMultiNodeAttributeAsJSON(args.nodeType, args.nodeIds, args.attributeName)
133
+ rescue ::Teapot::TempestDB::UndefinedGraphException => error1
134
+ result.error1 = error1
135
+ rescue ::Teapot::TempestDB::UndefinedAttributeException => error2
136
+ result.error2 = error2
137
+ end
138
+ write_result(result, oprot, 'getMultiNodeAttributeAsJSON', seqid)
139
+ end
140
+
141
+ def process_nodes(seqid, iprot, oprot)
142
+ args = read_args(iprot, Nodes_args)
143
+ result = Nodes_result.new()
144
+ begin
145
+ result.success = @handler.nodes(args.nodeType, args.sqlClause)
146
+ rescue ::Teapot::TempestDB::UndefinedGraphException => error1
147
+ result.error1 = error1
148
+ rescue ::Teapot::TempestDB::SQLException => error2
149
+ result.error2 = error2
150
+ end
151
+ write_result(result, oprot, 'nodes', seqid)
152
+ end
153
+
154
+ def process_kStepOutNeighborsFiltered(seqid, iprot, oprot)
155
+ args = read_args(iprot, KStepOutNeighborsFiltered_args)
156
+ result = KStepOutNeighborsFiltered_result.new()
157
+ begin
158
+ result.success = @handler.kStepOutNeighborsFiltered(args.edgeType, args.sourceId, args.k, args.sqlClause, args.filter, args.alternating)
159
+ rescue ::Teapot::TempestDB::UndefinedGraphException => error1
160
+ result.error1 = error1
161
+ rescue ::InvalidArgumentException => error2
162
+ result.error2 = error2
163
+ rescue ::Teapot::TempestDB::SQLException => error3
164
+ result.error3 = error3
165
+ rescue ::InvalidNodeIdException => error4
166
+ result.error4 = error4
167
+ end
168
+ write_result(result, oprot, 'kStepOutNeighborsFiltered', seqid)
169
+ end
170
+
171
+ def process_kStepInNeighborsFiltered(seqid, iprot, oprot)
172
+ args = read_args(iprot, KStepInNeighborsFiltered_args)
173
+ result = KStepInNeighborsFiltered_result.new()
174
+ begin
175
+ result.success = @handler.kStepInNeighborsFiltered(args.edgeType, args.sourceId, args.k, args.sqlClause, args.filter, args.alternating)
176
+ rescue ::Teapot::TempestDB::UndefinedGraphException => error1
177
+ result.error1 = error1
178
+ rescue ::InvalidArgumentException => error2
179
+ result.error2 = error2
180
+ rescue ::Teapot::TempestDB::SQLException => error3
181
+ result.error3 = error3
182
+ rescue ::InvalidNodeIdException => error4
183
+ result.error4 = error4
184
+ end
185
+ write_result(result, oprot, 'kStepInNeighborsFiltered', seqid)
186
+ end
187
+
188
+ def process_ppr(seqid, iprot, oprot)
189
+ args = read_args(iprot, Ppr_args)
190
+ result = Ppr_result.new()
191
+ begin
192
+ result.success = @handler.ppr(args.edgeType, args.seeds, args.pageRankParams)
193
+ rescue ::Teapot::TempestDB::UndefinedGraphException => error1
194
+ result.error1 = error1
195
+ rescue ::InvalidNodeIdException => error2
196
+ result.error2 = error2
197
+ rescue ::InvalidArgumentException => error3
198
+ result.error3 = error3
199
+ end
200
+ write_result(result, oprot, 'ppr', seqid)
201
+ end
202
+
203
+ def process_addEdges(seqid, iprot, oprot)
204
+ args = read_args(iprot, AddEdges_args)
205
+ result = AddEdges_result.new()
206
+ begin
207
+ @handler.addEdges(args.edgeType, args.ids1, args.ids2)
208
+ rescue ::Teapot::TempestDB::UndefinedGraphException => error1
209
+ result.error1 = error1
210
+ rescue ::Teapot::TempestDB::UnequalListSizeException => error2
211
+ result.error2 = error2
212
+ end
213
+ write_result(result, oprot, 'addEdges', seqid)
214
+ end
215
+
216
+ end
217
+
218
+ # HELPER FUNCTIONS AND STRUCTURES
219
+
220
+ class GetMultiNodeAttributeAsJSON_args
221
+ include ::Thrift::Struct, ::Thrift::Struct_Union
222
+ NODETYPE = 1
223
+ NODEIDS = 2
224
+ ATTRIBUTENAME = 3
225
+
226
+ FIELDS = {
227
+ NODETYPE => {:type => ::Thrift::Types::STRING, :name => 'nodeType'},
228
+ NODEIDS => {:type => ::Thrift::Types::LIST, :name => 'nodeIds', :element => {:type => ::Thrift::Types::I64}},
229
+ ATTRIBUTENAME => {:type => ::Thrift::Types::STRING, :name => 'attributeName'}
230
+ }
231
+
232
+ def struct_fields; FIELDS; end
233
+
234
+ def validate
235
+ end
236
+
237
+ ::Thrift::Struct.generate_accessors self
238
+ end
239
+
240
+ class GetMultiNodeAttributeAsJSON_result
241
+ include ::Thrift::Struct, ::Thrift::Struct_Union
242
+ SUCCESS = 0
243
+ ERROR1 = 1
244
+ ERROR2 = 2
245
+
246
+ FIELDS = {
247
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::I64}, :value => {:type => ::Thrift::Types::STRING}},
248
+ ERROR1 => {:type => ::Thrift::Types::STRUCT, :name => 'error1', :class => ::Teapot::TempestDB::UndefinedGraphException},
249
+ ERROR2 => {:type => ::Thrift::Types::STRUCT, :name => 'error2', :class => ::Teapot::TempestDB::UndefinedAttributeException}
250
+ }
251
+
252
+ def struct_fields; FIELDS; end
253
+
254
+ def validate
255
+ end
256
+
257
+ ::Thrift::Struct.generate_accessors self
258
+ end
259
+
260
+ class Nodes_args
261
+ include ::Thrift::Struct, ::Thrift::Struct_Union
262
+ NODETYPE = 1
263
+ SQLCLAUSE = 2
264
+
265
+ FIELDS = {
266
+ NODETYPE => {:type => ::Thrift::Types::STRING, :name => 'nodeType'},
267
+ SQLCLAUSE => {:type => ::Thrift::Types::STRING, :name => 'sqlClause'}
268
+ }
269
+
270
+ def struct_fields; FIELDS; end
271
+
272
+ def validate
273
+ end
274
+
275
+ ::Thrift::Struct.generate_accessors self
276
+ end
277
+
278
+ class Nodes_result
279
+ include ::Thrift::Struct, ::Thrift::Struct_Union
280
+ SUCCESS = 0
281
+ ERROR1 = 1
282
+ ERROR2 = 2
283
+
284
+ FIELDS = {
285
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::I64}},
286
+ ERROR1 => {:type => ::Thrift::Types::STRUCT, :name => 'error1', :class => ::Teapot::TempestDB::UndefinedGraphException},
287
+ ERROR2 => {:type => ::Thrift::Types::STRUCT, :name => 'error2', :class => ::Teapot::TempestDB::SQLException}
288
+ }
289
+
290
+ def struct_fields; FIELDS; end
291
+
292
+ def validate
293
+ end
294
+
295
+ ::Thrift::Struct.generate_accessors self
296
+ end
297
+
298
+ class KStepOutNeighborsFiltered_args
299
+ include ::Thrift::Struct, ::Thrift::Struct_Union
300
+ EDGETYPE = 1
301
+ SOURCEID = 2
302
+ K = 3
303
+ SQLCLAUSE = 4
304
+ FILTER = 5
305
+ ALTERNATING = 6
306
+
307
+ FIELDS = {
308
+ EDGETYPE => {:type => ::Thrift::Types::STRING, :name => 'edgeType'},
309
+ SOURCEID => {:type => ::Thrift::Types::I64, :name => 'sourceId'},
310
+ K => {:type => ::Thrift::Types::I32, :name => 'k'},
311
+ SQLCLAUSE => {:type => ::Thrift::Types::STRING, :name => 'sqlClause'},
312
+ FILTER => {:type => ::Thrift::Types::MAP, :name => 'filter', :key => {:type => ::Thrift::Types::I32, :enum_class => ::Teapot::TempestDB::DegreeFilterTypes}, :value => {:type => ::Thrift::Types::I32}},
313
+ ALTERNATING => {:type => ::Thrift::Types::BOOL, :name => 'alternating'}
314
+ }
315
+
316
+ def struct_fields; FIELDS; end
317
+
318
+ def validate
319
+ end
320
+
321
+ ::Thrift::Struct.generate_accessors self
322
+ end
323
+
324
+ class KStepOutNeighborsFiltered_result
325
+ include ::Thrift::Struct, ::Thrift::Struct_Union
326
+ SUCCESS = 0
327
+ ERROR1 = 1
328
+ ERROR2 = 2
329
+ ERROR3 = 3
330
+ ERROR4 = 4
331
+
332
+ FIELDS = {
333
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::I64}},
334
+ ERROR1 => {:type => ::Thrift::Types::STRUCT, :name => 'error1', :class => ::Teapot::TempestDB::UndefinedGraphException},
335
+ ERROR2 => {:type => ::Thrift::Types::STRUCT, :name => 'error2', :class => ::InvalidArgumentException},
336
+ ERROR3 => {:type => ::Thrift::Types::STRUCT, :name => 'error3', :class => ::Teapot::TempestDB::SQLException},
337
+ ERROR4 => {:type => ::Thrift::Types::STRUCT, :name => 'error4', :class => ::InvalidNodeIdException}
338
+ }
339
+
340
+ def struct_fields; FIELDS; end
341
+
342
+ def validate
343
+ end
344
+
345
+ ::Thrift::Struct.generate_accessors self
346
+ end
347
+
348
+ class KStepInNeighborsFiltered_args
349
+ include ::Thrift::Struct, ::Thrift::Struct_Union
350
+ EDGETYPE = 1
351
+ SOURCEID = 2
352
+ K = 3
353
+ SQLCLAUSE = 4
354
+ FILTER = 5
355
+ ALTERNATING = 6
356
+
357
+ FIELDS = {
358
+ EDGETYPE => {:type => ::Thrift::Types::STRING, :name => 'edgeType'},
359
+ SOURCEID => {:type => ::Thrift::Types::I64, :name => 'sourceId'},
360
+ K => {:type => ::Thrift::Types::I32, :name => 'k'},
361
+ SQLCLAUSE => {:type => ::Thrift::Types::STRING, :name => 'sqlClause'},
362
+ FILTER => {:type => ::Thrift::Types::MAP, :name => 'filter', :key => {:type => ::Thrift::Types::I32, :enum_class => ::Teapot::TempestDB::DegreeFilterTypes}, :value => {:type => ::Thrift::Types::I32}},
363
+ ALTERNATING => {:type => ::Thrift::Types::BOOL, :name => 'alternating'}
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
+ class KStepInNeighborsFiltered_result
375
+ include ::Thrift::Struct, ::Thrift::Struct_Union
376
+ SUCCESS = 0
377
+ ERROR1 = 1
378
+ ERROR2 = 2
379
+ ERROR3 = 3
380
+ ERROR4 = 4
381
+
382
+ FIELDS = {
383
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::I64}},
384
+ ERROR1 => {:type => ::Thrift::Types::STRUCT, :name => 'error1', :class => ::Teapot::TempestDB::UndefinedGraphException},
385
+ ERROR2 => {:type => ::Thrift::Types::STRUCT, :name => 'error2', :class => ::InvalidArgumentException},
386
+ ERROR3 => {:type => ::Thrift::Types::STRUCT, :name => 'error3', :class => ::Teapot::TempestDB::SQLException},
387
+ ERROR4 => {:type => ::Thrift::Types::STRUCT, :name => 'error4', :class => ::InvalidNodeIdException}
388
+ }
389
+
390
+ def struct_fields; FIELDS; end
391
+
392
+ def validate
393
+ end
394
+
395
+ ::Thrift::Struct.generate_accessors self
396
+ end
397
+
398
+ class Ppr_args
399
+ include ::Thrift::Struct, ::Thrift::Struct_Union
400
+ EDGETYPE = 1
401
+ SEEDS = 2
402
+ PAGERANKPARAMS = 3
403
+
404
+ FIELDS = {
405
+ EDGETYPE => {:type => ::Thrift::Types::STRING, :name => 'edgeType'},
406
+ SEEDS => {:type => ::Thrift::Types::LIST, :name => 'seeds', :element => {:type => ::Thrift::Types::I64}},
407
+ PAGERANKPARAMS => {:type => ::Thrift::Types::STRUCT, :name => 'pageRankParams', :class => ::Teapot::TempestDB::MonteCarloPageRankParams}
408
+ }
409
+
410
+ def struct_fields; FIELDS; end
411
+
412
+ def validate
413
+ end
414
+
415
+ ::Thrift::Struct.generate_accessors self
416
+ end
417
+
418
+ class Ppr_result
419
+ include ::Thrift::Struct, ::Thrift::Struct_Union
420
+ SUCCESS = 0
421
+ ERROR1 = 1
422
+ ERROR2 = 2
423
+ ERROR3 = 3
424
+
425
+ FIELDS = {
426
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::I64}, :value => {:type => ::Thrift::Types::DOUBLE}},
427
+ ERROR1 => {:type => ::Thrift::Types::STRUCT, :name => 'error1', :class => ::Teapot::TempestDB::UndefinedGraphException},
428
+ ERROR2 => {:type => ::Thrift::Types::STRUCT, :name => 'error2', :class => ::InvalidNodeIdException},
429
+ ERROR3 => {:type => ::Thrift::Types::STRUCT, :name => 'error3', :class => ::InvalidArgumentException}
430
+ }
431
+
432
+ def struct_fields; FIELDS; end
433
+
434
+ def validate
435
+ end
436
+
437
+ ::Thrift::Struct.generate_accessors self
438
+ end
439
+
440
+ class AddEdges_args
441
+ include ::Thrift::Struct, ::Thrift::Struct_Union
442
+ EDGETYPE = 1
443
+ IDS1 = 2
444
+ IDS2 = 3
445
+
446
+ FIELDS = {
447
+ EDGETYPE => {:type => ::Thrift::Types::STRING, :name => 'edgeType'},
448
+ IDS1 => {:type => ::Thrift::Types::LIST, :name => 'ids1', :element => {:type => ::Thrift::Types::I64}},
449
+ IDS2 => {:type => ::Thrift::Types::LIST, :name => 'ids2', :element => {:type => ::Thrift::Types::I64}}
450
+ }
451
+
452
+ def struct_fields; FIELDS; end
453
+
454
+ def validate
455
+ end
456
+
457
+ ::Thrift::Struct.generate_accessors self
458
+ end
459
+
460
+ class AddEdges_result
461
+ include ::Thrift::Struct, ::Thrift::Struct_Union
462
+ ERROR1 = 1
463
+ ERROR2 = 2
464
+
465
+ FIELDS = {
466
+ ERROR1 => {:type => ::Thrift::Types::STRUCT, :name => 'error1', :class => ::Teapot::TempestDB::UndefinedGraphException},
467
+ ERROR2 => {:type => ::Thrift::Types::STRUCT, :name => 'error2', :class => ::Teapot::TempestDB::UnequalListSizeException}
468
+ }
469
+
470
+ def struct_fields; FIELDS; end
471
+
472
+ def validate
473
+ end
474
+
475
+ ::Thrift::Struct.generate_accessors self
476
+ end
477
+
478
+ end
479
+
480
+ end
481
+ end
@@ -0,0 +1,13 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'tempest_db_types'
9
+
10
+ module Teapot
11
+ module TempestDB
12
+ end
13
+ end
@@ -0,0 +1,129 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'tempest_types'
9
+
10
+
11
+ module Teapot
12
+ module TempestDB
13
+ module DegreeFilterTypes
14
+ INDEGREE_MIN = 0
15
+ INDEGREE_MAX = 1
16
+ OUTDEGREE_MIN = 2
17
+ OUTDEGREE_MAX = 3
18
+ VALUE_MAP = {0 => "INDEGREE_MIN", 1 => "INDEGREE_MAX", 2 => "OUTDEGREE_MIN", 3 => "OUTDEGREE_MAX"}
19
+ VALID_VALUES = Set.new([INDEGREE_MIN, INDEGREE_MAX, OUTDEGREE_MIN, OUTDEGREE_MAX]).freeze
20
+ end
21
+
22
+ class UndefinedAttributeException < ::Thrift::Exception
23
+ include ::Thrift::Struct, ::Thrift::Struct_Union
24
+ def initialize(message=nil)
25
+ super()
26
+ self.message = message
27
+ end
28
+
29
+ MESSAGE = 1
30
+
31
+ FIELDS = {
32
+ MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
33
+ }
34
+
35
+ def struct_fields; FIELDS; end
36
+
37
+ def validate
38
+ end
39
+
40
+ ::Thrift::Struct.generate_accessors self
41
+ end
42
+
43
+ class UndefinedGraphException < ::Thrift::Exception
44
+ include ::Thrift::Struct, ::Thrift::Struct_Union
45
+ def initialize(message=nil)
46
+ super()
47
+ self.message = message
48
+ end
49
+
50
+ MESSAGE = 1
51
+
52
+ FIELDS = {
53
+ MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
54
+ }
55
+
56
+ def struct_fields; FIELDS; end
57
+
58
+ def validate
59
+ end
60
+
61
+ ::Thrift::Struct.generate_accessors self
62
+ end
63
+
64
+ class SQLException < ::Thrift::Exception
65
+ include ::Thrift::Struct, ::Thrift::Struct_Union
66
+ def initialize(message=nil)
67
+ super()
68
+ self.message = message
69
+ end
70
+
71
+ MESSAGE = 1
72
+
73
+ FIELDS = {
74
+ MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
75
+ }
76
+
77
+ def struct_fields; FIELDS; end
78
+
79
+ def validate
80
+ end
81
+
82
+ ::Thrift::Struct.generate_accessors self
83
+ end
84
+
85
+ class UnequalListSizeException < ::Thrift::Exception
86
+ include ::Thrift::Struct, ::Thrift::Struct_Union
87
+
88
+ FIELDS = {
89
+
90
+ }
91
+
92
+ def struct_fields; FIELDS; end
93
+
94
+ def validate
95
+ end
96
+
97
+ ::Thrift::Struct.generate_accessors self
98
+ end
99
+
100
+ class MonteCarloPageRankParams
101
+ include ::Thrift::Struct, ::Thrift::Struct_Union
102
+ NUMSTEPS = 1
103
+ RESETPROBABILITY = 2
104
+ MAXINTERMEDIATENODEDEGREE = 3
105
+ MINREPORTEDVISITS = 4
106
+ MAXRESULTCOUNT = 5
107
+ UNDIRECTGRAPH = 6
108
+
109
+ FIELDS = {
110
+ NUMSTEPS => {:type => ::Thrift::Types::I32, :name => 'numSteps'},
111
+ RESETPROBABILITY => {:type => ::Thrift::Types::DOUBLE, :name => 'resetProbability'},
112
+ MAXINTERMEDIATENODEDEGREE => {:type => ::Thrift::Types::I32, :name => 'maxIntermediateNodeDegree', :default => 1000, :optional => true},
113
+ MINREPORTEDVISITS => {:type => ::Thrift::Types::I32, :name => 'minReportedVisits', :optional => true},
114
+ MAXRESULTCOUNT => {:type => ::Thrift::Types::I32, :name => 'maxResultCount', :optional => true},
115
+ UNDIRECTGRAPH => {:type => ::Thrift::Types::BOOL, :name => 'undirectGraph', :default => false, :optional => true}
116
+ }
117
+
118
+ def struct_fields; FIELDS; end
119
+
120
+ def validate
121
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numSteps is unset!') unless @numSteps
122
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field resetProbability is unset!') unless @resetProbability
123
+ end
124
+
125
+ ::Thrift::Struct.generate_accessors self
126
+ end
127
+
128
+ end
129
+ end