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.
- checksums.yaml +7 -0
- data/lib/concord.rb +201 -0
- data/lib/concord/utils.rb +13 -0
- data/lib/gen-rb/bolt_constants.rb +47 -0
- data/lib/gen-rb/bolt_manager_service.rb +151 -0
- data/lib/gen-rb/bolt_metrics_service.rb +268 -0
- data/lib/gen-rb/bolt_proxy_service.rb +325 -0
- data/lib/gen-rb/bolt_scheduler_service.rb +323 -0
- data/lib/gen-rb/bolt_trace_aggregator_service.rb +268 -0
- data/lib/gen-rb/bolt_types.rb +456 -0
- data/lib/gen-rb/computation_service.rb +272 -0
- data/lib/gen-rb/mutable_ephemeral_state_service.rb +149 -0
- metadata +84 -0
@@ -0,0 +1,272 @@
|
|
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 ComputationService
|
13
|
+
class Client
|
14
|
+
include ::Thrift::Client
|
15
|
+
|
16
|
+
def init()
|
17
|
+
send_init()
|
18
|
+
return recv_init()
|
19
|
+
end
|
20
|
+
|
21
|
+
def send_init()
|
22
|
+
send_message('init', Init_args)
|
23
|
+
end
|
24
|
+
|
25
|
+
def recv_init()
|
26
|
+
result = receive_message(Init_result)
|
27
|
+
return result.success unless result.success.nil?
|
28
|
+
raise result.e unless result.e.nil?
|
29
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'init failed: unknown result')
|
30
|
+
end
|
31
|
+
|
32
|
+
def boltProcessRecord(record)
|
33
|
+
send_boltProcessRecord(record)
|
34
|
+
return recv_boltProcessRecord()
|
35
|
+
end
|
36
|
+
|
37
|
+
def send_boltProcessRecord(record)
|
38
|
+
send_message('boltProcessRecord', BoltProcessRecord_args, :record => record)
|
39
|
+
end
|
40
|
+
|
41
|
+
def recv_boltProcessRecord()
|
42
|
+
result = receive_message(BoltProcessRecord_result)
|
43
|
+
return result.success unless result.success.nil?
|
44
|
+
raise result.e unless result.e.nil?
|
45
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'boltProcessRecord failed: unknown result')
|
46
|
+
end
|
47
|
+
|
48
|
+
def boltProcessTimer(key, time)
|
49
|
+
send_boltProcessTimer(key, time)
|
50
|
+
return recv_boltProcessTimer()
|
51
|
+
end
|
52
|
+
|
53
|
+
def send_boltProcessTimer(key, time)
|
54
|
+
send_message('boltProcessTimer', BoltProcessTimer_args, :key => key, :time => time)
|
55
|
+
end
|
56
|
+
|
57
|
+
def recv_boltProcessTimer()
|
58
|
+
result = receive_message(BoltProcessTimer_result)
|
59
|
+
return result.success unless result.success.nil?
|
60
|
+
raise result.e unless result.e.nil?
|
61
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'boltProcessTimer failed: unknown result')
|
62
|
+
end
|
63
|
+
|
64
|
+
def boltMetadata()
|
65
|
+
send_boltMetadata()
|
66
|
+
return recv_boltMetadata()
|
67
|
+
end
|
68
|
+
|
69
|
+
def send_boltMetadata()
|
70
|
+
send_message('boltMetadata', BoltMetadata_args)
|
71
|
+
end
|
72
|
+
|
73
|
+
def recv_boltMetadata()
|
74
|
+
result = receive_message(BoltMetadata_result)
|
75
|
+
return result.success unless result.success.nil?
|
76
|
+
raise result.e unless result.e.nil?
|
77
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'boltMetadata failed: unknown result')
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
class Processor
|
83
|
+
include ::Thrift::Processor
|
84
|
+
|
85
|
+
def process_init(seqid, iprot, oprot)
|
86
|
+
args = read_args(iprot, Init_args)
|
87
|
+
result = Init_result.new()
|
88
|
+
begin
|
89
|
+
result.success = @handler.init()
|
90
|
+
rescue ::Concord::Thrift::BoltError => e
|
91
|
+
result.e = e
|
92
|
+
end
|
93
|
+
write_result(result, oprot, 'init', seqid)
|
94
|
+
end
|
95
|
+
|
96
|
+
def process_boltProcessRecord(seqid, iprot, oprot)
|
97
|
+
args = read_args(iprot, BoltProcessRecord_args)
|
98
|
+
result = BoltProcessRecord_result.new()
|
99
|
+
begin
|
100
|
+
result.success = @handler.boltProcessRecord(args.record)
|
101
|
+
rescue ::Concord::Thrift::BoltError => e
|
102
|
+
result.e = e
|
103
|
+
end
|
104
|
+
write_result(result, oprot, 'boltProcessRecord', seqid)
|
105
|
+
end
|
106
|
+
|
107
|
+
def process_boltProcessTimer(seqid, iprot, oprot)
|
108
|
+
args = read_args(iprot, BoltProcessTimer_args)
|
109
|
+
result = BoltProcessTimer_result.new()
|
110
|
+
begin
|
111
|
+
result.success = @handler.boltProcessTimer(args.key, args.time)
|
112
|
+
rescue ::Concord::Thrift::BoltError => e
|
113
|
+
result.e = e
|
114
|
+
end
|
115
|
+
write_result(result, oprot, 'boltProcessTimer', seqid)
|
116
|
+
end
|
117
|
+
|
118
|
+
def process_boltMetadata(seqid, iprot, oprot)
|
119
|
+
args = read_args(iprot, BoltMetadata_args)
|
120
|
+
result = BoltMetadata_result.new()
|
121
|
+
begin
|
122
|
+
result.success = @handler.boltMetadata()
|
123
|
+
rescue ::Concord::Thrift::BoltError => e
|
124
|
+
result.e = e
|
125
|
+
end
|
126
|
+
write_result(result, oprot, 'boltMetadata', seqid)
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
132
|
+
|
133
|
+
class Init_args
|
134
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
135
|
+
|
136
|
+
FIELDS = {
|
137
|
+
|
138
|
+
}
|
139
|
+
|
140
|
+
def struct_fields; FIELDS; end
|
141
|
+
|
142
|
+
def validate
|
143
|
+
end
|
144
|
+
|
145
|
+
::Thrift::Struct.generate_accessors self
|
146
|
+
end
|
147
|
+
|
148
|
+
class Init_result
|
149
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
150
|
+
SUCCESS = 0
|
151
|
+
E = 1
|
152
|
+
|
153
|
+
FIELDS = {
|
154
|
+
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Concord::Thrift::ComputationTx},
|
155
|
+
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
|
156
|
+
}
|
157
|
+
|
158
|
+
def struct_fields; FIELDS; end
|
159
|
+
|
160
|
+
def validate
|
161
|
+
end
|
162
|
+
|
163
|
+
::Thrift::Struct.generate_accessors self
|
164
|
+
end
|
165
|
+
|
166
|
+
class BoltProcessRecord_args
|
167
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
168
|
+
RECORD = 1
|
169
|
+
|
170
|
+
FIELDS = {
|
171
|
+
RECORD => {:type => ::Thrift::Types::STRUCT, :name => 'record', :class => ::Concord::Thrift::Record}
|
172
|
+
}
|
173
|
+
|
174
|
+
def struct_fields; FIELDS; end
|
175
|
+
|
176
|
+
def validate
|
177
|
+
end
|
178
|
+
|
179
|
+
::Thrift::Struct.generate_accessors self
|
180
|
+
end
|
181
|
+
|
182
|
+
class BoltProcessRecord_result
|
183
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
184
|
+
SUCCESS = 0
|
185
|
+
E = 1
|
186
|
+
|
187
|
+
FIELDS = {
|
188
|
+
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Concord::Thrift::ComputationTx},
|
189
|
+
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
|
190
|
+
}
|
191
|
+
|
192
|
+
def struct_fields; FIELDS; end
|
193
|
+
|
194
|
+
def validate
|
195
|
+
end
|
196
|
+
|
197
|
+
::Thrift::Struct.generate_accessors self
|
198
|
+
end
|
199
|
+
|
200
|
+
class BoltProcessTimer_args
|
201
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
202
|
+
KEY = 1
|
203
|
+
TIME = 2
|
204
|
+
|
205
|
+
FIELDS = {
|
206
|
+
KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
|
207
|
+
TIME => {:type => ::Thrift::Types::I64, :name => 'time'}
|
208
|
+
}
|
209
|
+
|
210
|
+
def struct_fields; FIELDS; end
|
211
|
+
|
212
|
+
def validate
|
213
|
+
end
|
214
|
+
|
215
|
+
::Thrift::Struct.generate_accessors self
|
216
|
+
end
|
217
|
+
|
218
|
+
class BoltProcessTimer_result
|
219
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
220
|
+
SUCCESS = 0
|
221
|
+
E = 1
|
222
|
+
|
223
|
+
FIELDS = {
|
224
|
+
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Concord::Thrift::ComputationTx},
|
225
|
+
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
|
226
|
+
}
|
227
|
+
|
228
|
+
def struct_fields; FIELDS; end
|
229
|
+
|
230
|
+
def validate
|
231
|
+
end
|
232
|
+
|
233
|
+
::Thrift::Struct.generate_accessors self
|
234
|
+
end
|
235
|
+
|
236
|
+
class BoltMetadata_args
|
237
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
238
|
+
|
239
|
+
FIELDS = {
|
240
|
+
|
241
|
+
}
|
242
|
+
|
243
|
+
def struct_fields; FIELDS; end
|
244
|
+
|
245
|
+
def validate
|
246
|
+
end
|
247
|
+
|
248
|
+
::Thrift::Struct.generate_accessors self
|
249
|
+
end
|
250
|
+
|
251
|
+
class BoltMetadata_result
|
252
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
253
|
+
SUCCESS = 0
|
254
|
+
E = 1
|
255
|
+
|
256
|
+
FIELDS = {
|
257
|
+
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Concord::Thrift::ComputationMetadata},
|
258
|
+
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
|
259
|
+
}
|
260
|
+
|
261
|
+
def struct_fields; FIELDS; end
|
262
|
+
|
263
|
+
def validate
|
264
|
+
end
|
265
|
+
|
266
|
+
::Thrift::Struct.generate_accessors self
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
272
|
+
end
|
@@ -0,0 +1,149 @@
|
|
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 MutableEphemeralStateService
|
13
|
+
class Client
|
14
|
+
include ::Thrift::Client
|
15
|
+
|
16
|
+
def setState(key, value)
|
17
|
+
send_setState(key, value)
|
18
|
+
recv_setState()
|
19
|
+
end
|
20
|
+
|
21
|
+
def send_setState(key, value)
|
22
|
+
send_message('setState', SetState_args, :key => key, :value => value)
|
23
|
+
end
|
24
|
+
|
25
|
+
def recv_setState()
|
26
|
+
result = receive_message(SetState_result)
|
27
|
+
raise result.e unless result.e.nil?
|
28
|
+
return
|
29
|
+
end
|
30
|
+
|
31
|
+
def getState(key)
|
32
|
+
send_getState(key)
|
33
|
+
return recv_getState()
|
34
|
+
end
|
35
|
+
|
36
|
+
def send_getState(key)
|
37
|
+
send_message('getState', GetState_args, :key => key)
|
38
|
+
end
|
39
|
+
|
40
|
+
def recv_getState()
|
41
|
+
result = receive_message(GetState_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, 'getState failed: unknown result')
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
class Processor
|
50
|
+
include ::Thrift::Processor
|
51
|
+
|
52
|
+
def process_setState(seqid, iprot, oprot)
|
53
|
+
args = read_args(iprot, SetState_args)
|
54
|
+
result = SetState_result.new()
|
55
|
+
begin
|
56
|
+
@handler.setState(args.key, args.value)
|
57
|
+
rescue ::Concord::Thrift::BoltError => e
|
58
|
+
result.e = e
|
59
|
+
end
|
60
|
+
write_result(result, oprot, 'setState', seqid)
|
61
|
+
end
|
62
|
+
|
63
|
+
def process_getState(seqid, iprot, oprot)
|
64
|
+
args = read_args(iprot, GetState_args)
|
65
|
+
result = GetState_result.new()
|
66
|
+
begin
|
67
|
+
result.success = @handler.getState(args.key)
|
68
|
+
rescue ::Concord::Thrift::BoltError => e
|
69
|
+
result.e = e
|
70
|
+
end
|
71
|
+
write_result(result, oprot, 'getState', seqid)
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
77
|
+
|
78
|
+
class SetState_args
|
79
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
80
|
+
KEY = 1
|
81
|
+
VALUE = 2
|
82
|
+
|
83
|
+
FIELDS = {
|
84
|
+
KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
|
85
|
+
VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true}
|
86
|
+
}
|
87
|
+
|
88
|
+
def struct_fields; FIELDS; end
|
89
|
+
|
90
|
+
def validate
|
91
|
+
end
|
92
|
+
|
93
|
+
::Thrift::Struct.generate_accessors self
|
94
|
+
end
|
95
|
+
|
96
|
+
class SetState_result
|
97
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
98
|
+
E = 1
|
99
|
+
|
100
|
+
FIELDS = {
|
101
|
+
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
|
102
|
+
}
|
103
|
+
|
104
|
+
def struct_fields; FIELDS; end
|
105
|
+
|
106
|
+
def validate
|
107
|
+
end
|
108
|
+
|
109
|
+
::Thrift::Struct.generate_accessors self
|
110
|
+
end
|
111
|
+
|
112
|
+
class GetState_args
|
113
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
114
|
+
KEY = 1
|
115
|
+
|
116
|
+
FIELDS = {
|
117
|
+
KEY => {:type => ::Thrift::Types::STRING, :name => 'key'}
|
118
|
+
}
|
119
|
+
|
120
|
+
def struct_fields; FIELDS; end
|
121
|
+
|
122
|
+
def validate
|
123
|
+
end
|
124
|
+
|
125
|
+
::Thrift::Struct.generate_accessors self
|
126
|
+
end
|
127
|
+
|
128
|
+
class GetState_result
|
129
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
130
|
+
SUCCESS = 0
|
131
|
+
E = 1
|
132
|
+
|
133
|
+
FIELDS = {
|
134
|
+
SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success', :binary => true},
|
135
|
+
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => ::Concord::Thrift::BoltError}
|
136
|
+
}
|
137
|
+
|
138
|
+
def struct_fields; FIELDS; end
|
139
|
+
|
140
|
+
def validate
|
141
|
+
end
|
142
|
+
|
143
|
+
::Thrift::Struct.generate_accessors self
|
144
|
+
end
|
145
|
+
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
149
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: concord-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Cole Brown
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thrift
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.9.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: yard
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: concord computation interface for ruby
|
42
|
+
email: hello@concord.io
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- lib/concord.rb
|
48
|
+
- lib/gen-rb/bolt_metrics_service.rb
|
49
|
+
- lib/gen-rb/bolt_scheduler_service.rb
|
50
|
+
- lib/gen-rb/bolt_constants.rb
|
51
|
+
- lib/gen-rb/mutable_ephemeral_state_service.rb
|
52
|
+
- lib/gen-rb/bolt_trace_aggregator_service.rb
|
53
|
+
- lib/gen-rb/bolt_manager_service.rb
|
54
|
+
- lib/gen-rb/computation_service.rb
|
55
|
+
- lib/gen-rb/bolt_proxy_service.rb
|
56
|
+
- lib/gen-rb/bolt_types.rb
|
57
|
+
- lib/concord/utils.rb
|
58
|
+
homepage: https://github.com/concord/concord-ruby
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- ./lib
|
66
|
+
- ./lib/gen-rb
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 2.0.14
|
80
|
+
signing_key:
|
81
|
+
specification_version: 4
|
82
|
+
summary: concord computation interface for ruby
|
83
|
+
test_files: []
|
84
|
+
has_rdoc: yard
|