bud 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -207,8 +207,8 @@ class LibRebl
207
207
  attr_accessor :rules, :state
208
208
  attr_reader :ip, :port, :rebl_class_inst
209
209
  @@builtin_tables = [:stdio, :periodics_tbl, :halt, :localtick,
210
- :t_depends, :t_cycle, :t_provides, :t_rules,
211
- :t_stratum, :t_underspecified,
210
+ :t_depends, :t_cycle, :t_provides, :t_rule_stratum,
211
+ :t_rules, :t_stratum, :t_underspecified,
212
212
  :t_table_info, :t_table_schema, :rebl_breakpoint]
213
213
  @@classid = 0
214
214
 
@@ -1,21 +1,21 @@
1
1
  require 'rubygems'
2
2
 
3
3
  class RuleRewriter < Ruby2Ruby # :nodoc: all
4
- attr_accessor :rule_indx, :rules, :depends
4
+ attr_accessor :rule_idx, :rules, :depends
5
5
 
6
6
  OP_LIST = [:<<, :<, :<=].to_set
7
7
  TEMP_OP_LIST = [:-@, :~, :+@].to_set
8
- MONOTONE_WHITELIST = [:==, :+, :<=, :-, :<, :>, :*, :~,
8
+ MONOTONE_WHITELIST = [:==, :+, :<=, :-, :<, :>, :*, :~, :+@,
9
9
  :pairs, :matches, :combos, :flatten, :new,
10
10
  :lefts, :rights, :map, :flat_map, :pro, :merge,
11
11
  :schema, :cols, :key_cols, :val_cols, :payloads, :lambda,
12
12
  :tabname, :current_value].to_set
13
13
 
14
- def initialize(seed, bud_instance)
14
+ def initialize(bud_instance, rule_idx)
15
15
  @bud_instance = bud_instance
16
16
  @tables = {}
17
17
  @nm = false
18
- @rule_indx = seed
18
+ @rule_idx = rule_idx
19
19
  @collect = false
20
20
  @rules = []
21
21
  @depends = []
@@ -60,7 +60,7 @@ class RuleRewriter < Ruby2Ruby # :nodoc: all
60
60
  # s(:call, s(:call, nil, :a), :b),
61
61
  # :bar))
62
62
  # to the string "a.b.bar"
63
- raise Bud::CompileError, "malformed exp: #{exp}" unless exp.sexp_type == :call
63
+ raise Bud::CompileError, "malformed expression: #{exp}" unless exp.sexp_type == :call
64
64
  _, recv, op = exp
65
65
  return recv.nil? ? op.to_s : call_to_id(recv) + "." + op.to_s
66
66
  end
@@ -75,6 +75,8 @@ class RuleRewriter < Ruby2Ruby # :nodoc: all
75
75
  # converting ASTs to strings with doing analysis on ASTs. Those should be
76
76
  # split into two separate passes.
77
77
  def process_iter(exp)
78
+ # first field of exp is tag; shift it
79
+ exp.shift
78
80
  iter = process exp.shift
79
81
  args = exp.shift
80
82
 
@@ -129,7 +131,7 @@ class RuleRewriter < Ruby2Ruby # :nodoc: all
129
131
  end
130
132
 
131
133
  def process_call(exp)
132
- recv, op, *args = exp
134
+ tag, recv, op, *args = exp
133
135
  if OP_LIST.include?(op) and @context[1] == :defn and @context.length == 2
134
136
  # NB: context.length is 2 when see a method call at the top-level of a
135
137
  # :defn block -- this is where we expect Bloom statements to appear
@@ -138,8 +140,11 @@ class RuleRewriter < Ruby2Ruby # :nodoc: all
138
140
  # Special case. In the rule "z <= x.notin(y)", z depends positively on x,
139
141
  # but negatively on y. See further explanation in the "else" section for
140
142
  # why this is a special case.
143
+ if args.first.sexp_type != :call
144
+ raise Bud::CompileError, "illegal argument to notin: #{args.first}"
145
+ end
141
146
  notintab = call_to_id(args[0]) # args expected to be of the form (:call nil :y ...)
142
- @tables[notintab.to_s] = true # "true" denotes non-monotonic dependency
147
+ @tables[notintab] = true # "true" denotes non-monotonic dependency
143
148
  super
144
149
  else
145
150
  # Parse a call of the form a.b.c.foo
@@ -242,19 +247,19 @@ class RuleRewriter < Ruby2Ruby # :nodoc: all
242
247
  op = op.to_s
243
248
  end
244
249
 
245
- @rules << [@bud_instance, @rule_indx, lhs, op, rule_txt,
250
+ @rules << [@bud_instance, @rule_idx, lhs, op, rule_txt,
246
251
  rule_txt_orig, unsafe_funcs_called]
247
252
  @tables.each_pair do |t, nm|
248
253
  in_rule_body = @refs_in_body.include? t
249
- @depends << [@bud_instance, @rule_indx, lhs, op, t, nm, in_rule_body]
254
+ @depends << [@bud_instance, @rule_idx, lhs, op, t, nm, in_rule_body]
250
255
  end
251
256
 
252
257
  reset_instance_vars
253
- @rule_indx += 1
258
+ @rule_idx += 1
254
259
  end
255
260
 
256
261
  def do_rule(exp)
257
- lhs, op, rhs_ast = exp
262
+ tag, lhs, op, rhs_ast = exp
258
263
  lhs = process(lhs)
259
264
 
260
265
  rhs_ast = MapRewriter.new.process(rhs_ast)
@@ -376,6 +381,9 @@ class UnsafeFuncRewriter < SexpProcessor
376
381
 
377
382
  def process_iter(exp)
378
383
  tag, recv, iter_args, body = exp
384
+ if (iter_args == 0)
385
+ iter_args = s(:args)
386
+ end
379
387
  new_body = push_and_process(body)
380
388
  return s(tag, process(recv), process(iter_args), new_body)
381
389
  end
@@ -415,6 +423,9 @@ class LatticeRefRewriter < SexpProcessor
415
423
  def process_iter(exp)
416
424
  tag, recv, iter_args, body = exp
417
425
  new_body = push_and_process(body)
426
+ if (iter_args == 0)
427
+ iter_args = s(:args)
428
+ end
418
429
  return s(tag, process(recv), process(iter_args), new_body)
419
430
  end
420
431
 
@@ -128,9 +128,9 @@ module Bud
128
128
  end
129
129
 
130
130
  # declare a collection to be read from +filename+. rhs of statements only
131
- def file_reader(name, filename, delimiter='\n')
131
+ def file_reader(name, filename)
132
132
  define_collection(name)
133
- @tables[name] = Bud::BudFileReader.new(name, filename, delimiter, self)
133
+ @tables[name] = Bud::BudFileReader.new(name, filename, self)
134
134
  end
135
135
 
136
136
  # declare a collection to be auto-populated every +period+ seconds. schema <tt>[:key] => [:val]</tt>.
@@ -26,6 +26,13 @@ module Bud
26
26
  @child_watch_id = nil
27
27
  end
28
28
 
29
+ def invalidate_at_tick
30
+ true
31
+ end
32
+
33
+ def invalidate_cache
34
+ end
35
+
29
36
  # Since the watcher callbacks might invoke EventMachine, we wait until after
30
37
  # EM startup to start watching for Zk events.
31
38
  def start_watchers
@@ -0,0 +1,3 @@
1
+ module Bud
2
+ VERSION = "0.9.8"
3
+ end
@@ -3,7 +3,7 @@ require 'bud/state'
3
3
  class VizOnline #:nodoc: all
4
4
  attr_reader :logtab
5
5
 
6
- META_TABLES = %w[t_cycle t_depends t_provides t_rules t_stratum
6
+ META_TABLES = %w[t_cycle t_depends t_provides t_rule_stratum t_rules t_stratum
7
7
  t_table_info t_table_schema t_underspecified].to_set
8
8
 
9
9
  def initialize(bud_instance)
@@ -56,8 +56,8 @@ class VizOnline #:nodoc: all
56
56
  row = row[0]
57
57
  end
58
58
 
59
- # bud.t_depends and t_rules have bud object in field[0]. Replace them with
60
- # a string, since bud instances cannot/must not be serialized.
59
+ # t_depends, t_rule_stratum, and t_rules have Bud object as their first
60
+ # field. Replace with a string, since Bud instances cannot be serialized.
61
61
  if row[0].class <= Bud
62
62
  row = row.to_a
63
63
  row = [row[0].class.to_s] + row[1..-1]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Alvaro
@@ -12,176 +12,176 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-04-23 00:00:00.000000000 Z
15
+ date: 2017-09-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: backports
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - '>='
21
+ - - '='
22
22
  - !ruby/object:Gem::Version
23
- version: '0'
23
+ version: 3.8.0
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - '>='
28
+ - - '='
29
29
  - !ruby/object:Gem::Version
30
- version: '0'
30
+ version: 3.8.0
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: eventmachine
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - '>='
35
+ - - '='
36
36
  - !ruby/object:Gem::Version
37
- version: '0'
37
+ version: 1.2.5
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - '>='
42
+ - - '='
43
43
  - !ruby/object:Gem::Version
44
- version: '0'
44
+ version: 1.2.5
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: fastercsv
47
47
  requirement: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - '>='
49
+ - - '='
50
50
  - !ruby/object:Gem::Version
51
- version: '0'
51
+ version: 1.5.5
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - '>='
56
+ - - '='
57
57
  - !ruby/object:Gem::Version
58
- version: '0'
58
+ version: 1.5.5
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: getopt
61
61
  requirement: !ruby/object:Gem::Requirement
62
62
  requirements:
63
- - - '>='
63
+ - - '='
64
64
  - !ruby/object:Gem::Version
65
- version: '0'
65
+ version: 1.4.3
66
66
  type: :runtime
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
69
69
  requirements:
70
- - - '>='
70
+ - - '='
71
71
  - !ruby/object:Gem::Version
72
- version: '0'
72
+ version: 1.4.3
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: msgpack
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - '>='
77
+ - - '='
78
78
  - !ruby/object:Gem::Version
79
- version: '0'
79
+ version: 1.1.0
80
80
  type: :runtime
81
81
  prerelease: false
82
82
  version_requirements: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - '>='
84
+ - - '='
85
85
  - !ruby/object:Gem::Version
86
- version: '0'
86
+ version: 1.1.0
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: ruby-graphviz
89
89
  requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - '>='
91
+ - - '='
92
92
  - !ruby/object:Gem::Version
93
- version: '0'
93
+ version: 1.2.3
94
94
  type: :runtime
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - '>='
98
+ - - '='
99
99
  - !ruby/object:Gem::Version
100
- version: '0'
100
+ version: 1.2.3
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: ruby2ruby
103
103
  requirement: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - '>='
105
+ - - '='
106
106
  - !ruby/object:Gem::Version
107
- version: 2.0.1
107
+ version: 2.4.0
108
108
  type: :runtime
109
109
  prerelease: false
110
110
  version_requirements: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - '>='
112
+ - - '='
113
113
  - !ruby/object:Gem::Version
114
- version: 2.0.1
114
+ version: 2.4.0
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: ruby_parser
117
117
  requirement: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - '>='
119
+ - - '='
120
120
  - !ruby/object:Gem::Version
121
- version: 3.1.0
121
+ version: 3.10.1
122
122
  type: :runtime
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
- - - '>='
126
+ - - '='
127
127
  - !ruby/object:Gem::Version
128
- version: 3.1.0
128
+ version: 3.10.1
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: superators19
131
131
  requirement: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - '>='
133
+ - - '='
134
134
  - !ruby/object:Gem::Version
135
- version: '0'
135
+ version: 0.9.3
136
136
  type: :runtime
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - '>='
140
+ - - '='
141
141
  - !ruby/object:Gem::Version
142
- version: '0'
142
+ version: 0.9.3
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: syntax
145
145
  requirement: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - '>='
147
+ - - '='
148
148
  - !ruby/object:Gem::Version
149
- version: '0'
149
+ version: 1.2.2
150
150
  type: :runtime
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  requirements:
154
- - - '>='
154
+ - - '='
155
155
  - !ruby/object:Gem::Version
156
- version: '0'
156
+ version: 1.2.2
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: uuid
159
159
  requirement: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - '>='
161
+ - - '='
162
162
  - !ruby/object:Gem::Version
163
- version: '0'
163
+ version: 2.3.8
164
164
  type: :runtime
165
165
  prerelease: false
166
166
  version_requirements: !ruby/object:Gem::Requirement
167
167
  requirements:
168
- - - '>='
168
+ - - '='
169
169
  - !ruby/object:Gem::Version
170
- version: '0'
170
+ version: 2.3.8
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: minitest
173
173
  requirement: !ruby/object:Gem::Requirement
174
174
  requirements:
175
- - - '>='
175
+ - - '='
176
176
  - !ruby/object:Gem::Version
177
- version: '0'
177
+ version: 2.5.1
178
178
  type: :development
179
179
  prerelease: false
180
180
  version_requirements: !ruby/object:Gem::Requirement
181
181
  requirements:
182
- - - '>='
182
+ - - '='
183
183
  - !ruby/object:Gem::Version
184
- version: '0'
184
+ version: 2.5.1
185
185
  description: A prototype of the Bloom distributed programming language as a Ruby DSL.
186
186
  email:
187
187
  - bloomdevs@gmail.com
@@ -194,15 +194,44 @@ executables:
194
194
  extensions: []
195
195
  extra_rdoc_files: []
196
196
  files:
197
+ - History.txt
198
+ - LICENSE
199
+ - README.md
200
+ - Rakefile
201
+ - bin/budlabel
202
+ - bin/budplot
203
+ - bin/budtimelines
204
+ - bin/budvis
205
+ - bin/rebl
206
+ - docs/README.md
207
+ - docs/bfs.md
208
+ - docs/bfs_arch.png
209
+ - docs/bloom-loop.png
210
+ - docs/cheat.md
211
+ - docs/getstarted.md
212
+ - docs/intro.md
213
+ - docs/modules.md
214
+ - docs/operational.md
215
+ - docs/rebl.md
216
+ - docs/ruby_hooks.md
217
+ - docs/visualizations.md
218
+ - examples/README.md
219
+ - examples/basics/hello.rb
220
+ - examples/basics/paths.rb
221
+ - examples/chat/README.md
222
+ - examples/chat/chat.rb
223
+ - examples/chat/chat_protocol.rb
224
+ - examples/chat/chat_server.rb
225
+ - lib/bud.rb
197
226
  - lib/bud/aggs.rb
198
227
  - lib/bud/bud_meta.rb
199
228
  - lib/bud/collections.rb
200
229
  - lib/bud/depanalysis.rb
201
230
  - lib/bud/errors.rb
231
+ - lib/bud/executor/README.rescan
202
232
  - lib/bud/executor/elements.rb
203
233
  - lib/bud/executor/group.rb
204
234
  - lib/bud/executor/join.rb
205
- - lib/bud/executor/README.rescan
206
235
  - lib/bud/graphs.rb
207
236
  - lib/bud/labeling/bloomgraph.rb
208
237
  - lib/bud/labeling/budplot_style.rb
@@ -220,36 +249,9 @@ files:
220
249
  - lib/bud/state.rb
221
250
  - lib/bud/storage/dbm.rb
222
251
  - lib/bud/storage/zookeeper.rb
252
+ - lib/bud/version.rb
223
253
  - lib/bud/viz.rb
224
254
  - lib/bud/viz_util.rb
225
- - lib/bud.rb
226
- - bin/budlabel
227
- - bin/budplot
228
- - bin/budtimelines
229
- - bin/budvis
230
- - bin/rebl
231
- - docs/bfs.md
232
- - docs/bfs_arch.png
233
- - docs/bloom-loop.png
234
- - docs/cheat.md
235
- - docs/getstarted.md
236
- - docs/intro.md
237
- - docs/modules.md
238
- - docs/operational.md
239
- - docs/README.md
240
- - docs/rebl.md
241
- - docs/ruby_hooks.md
242
- - docs/visualizations.md
243
- - examples/basics/hello.rb
244
- - examples/basics/paths.rb
245
- - examples/chat/chat.rb
246
- - examples/chat/chat_protocol.rb
247
- - examples/chat/chat_server.rb
248
- - examples/chat/README.md
249
- - examples/README.md
250
- - README.md
251
- - LICENSE
252
- - History.txt
253
255
  homepage: http://www.bloom-lang.org
254
256
  licenses:
255
257
  - BSD
@@ -260,17 +262,17 @@ require_paths:
260
262
  - lib
261
263
  required_ruby_version: !ruby/object:Gem::Requirement
262
264
  requirements:
263
- - - '>='
265
+ - - ! '>='
264
266
  - !ruby/object:Gem::Version
265
267
  version: 1.8.7
266
268
  required_rubygems_version: !ruby/object:Gem::Requirement
267
269
  requirements:
268
- - - '>='
270
+ - - ! '>='
269
271
  - !ruby/object:Gem::Version
270
272
  version: '0'
271
273
  requirements: []
272
274
  rubyforge_project: bloom-lang
273
- rubygems_version: 2.0.0.rc.2
275
+ rubygems_version: 2.4.8
274
276
  signing_key:
275
277
  specification_version: 4
276
278
  summary: A prototype Bloom DSL for distributed programming.