bud 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bud
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Peter Alvaro
@@ -18,8 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-06-01 00:00:00 -07:00
22
- default_executable: rebl
21
+ date: 2011-06-01 00:00:00 Z
23
22
  dependencies:
24
23
  - !ruby/object:Gem::Dependency
25
24
  name: backports
@@ -50,7 +49,7 @@ dependencies:
50
49
  type: :runtime
51
50
  version_requirements: *id002
52
51
  - !ruby/object:Gem::Dependency
53
- name: gchart
52
+ name: fastercsv
54
53
  prerelease: false
55
54
  requirement: &id003 !ruby/object:Gem::Requirement
56
55
  none: false
@@ -64,7 +63,7 @@ dependencies:
64
63
  type: :runtime
65
64
  version_requirements: *id003
66
65
  - !ruby/object:Gem::Dependency
67
- name: getopt
66
+ name: gchart
68
67
  prerelease: false
69
68
  requirement: &id004 !ruby/object:Gem::Requirement
70
69
  none: false
@@ -78,7 +77,7 @@ dependencies:
78
77
  type: :runtime
79
78
  version_requirements: *id004
80
79
  - !ruby/object:Gem::Dependency
81
- name: i18n
80
+ name: getopt
82
81
  prerelease: false
83
82
  requirement: &id005 !ruby/object:Gem::Requirement
84
83
  none: false
@@ -92,7 +91,7 @@ dependencies:
92
91
  type: :runtime
93
92
  version_requirements: *id005
94
93
  - !ruby/object:Gem::Dependency
95
- name: json
94
+ name: i18n
96
95
  prerelease: false
97
96
  requirement: &id006 !ruby/object:Gem::Requirement
98
97
  none: false
@@ -106,7 +105,7 @@ dependencies:
106
105
  type: :runtime
107
106
  version_requirements: *id006
108
107
  - !ruby/object:Gem::Dependency
109
- name: msgpack
108
+ name: json
110
109
  prerelease: false
111
110
  requirement: &id007 !ruby/object:Gem::Requirement
112
111
  none: false
@@ -120,7 +119,7 @@ dependencies:
120
119
  type: :runtime
121
120
  version_requirements: *id007
122
121
  - !ruby/object:Gem::Dependency
123
- name: nestful
122
+ name: msgpack
124
123
  prerelease: false
125
124
  requirement: &id008 !ruby/object:Gem::Requirement
126
125
  none: false
@@ -134,7 +133,7 @@ dependencies:
134
133
  type: :runtime
135
134
  version_requirements: *id008
136
135
  - !ruby/object:Gem::Dependency
137
- name: ParseTree
136
+ name: nestful
138
137
  prerelease: false
139
138
  requirement: &id009 !ruby/object:Gem::Requirement
140
139
  none: false
@@ -148,7 +147,7 @@ dependencies:
148
147
  type: :runtime
149
148
  version_requirements: *id009
150
149
  - !ruby/object:Gem::Dependency
151
- name: ruby-graphviz
150
+ name: ParseTree
152
151
  prerelease: false
153
152
  requirement: &id010 !ruby/object:Gem::Requirement
154
153
  none: false
@@ -162,7 +161,7 @@ dependencies:
162
161
  type: :runtime
163
162
  version_requirements: *id010
164
163
  - !ruby/object:Gem::Dependency
165
- name: ruby2ruby
164
+ name: ruby-graphviz
166
165
  prerelease: false
167
166
  requirement: &id011 !ruby/object:Gem::Requirement
168
167
  none: false
@@ -176,7 +175,7 @@ dependencies:
176
175
  type: :runtime
177
176
  version_requirements: *id011
178
177
  - !ruby/object:Gem::Dependency
179
- name: sexp_path
178
+ name: ruby2ruby
180
179
  prerelease: false
181
180
  requirement: &id012 !ruby/object:Gem::Requirement
182
181
  none: false
@@ -190,7 +189,7 @@ dependencies:
190
189
  type: :runtime
191
190
  version_requirements: *id012
192
191
  - !ruby/object:Gem::Dependency
193
- name: superators
192
+ name: sexp_path
194
193
  prerelease: false
195
194
  requirement: &id013 !ruby/object:Gem::Requirement
196
195
  none: false
@@ -204,7 +203,7 @@ dependencies:
204
203
  type: :runtime
205
204
  version_requirements: *id013
206
205
  - !ruby/object:Gem::Dependency
207
- name: syntax
206
+ name: superators
208
207
  prerelease: false
209
208
  requirement: &id014 !ruby/object:Gem::Requirement
210
209
  none: false
@@ -218,7 +217,7 @@ dependencies:
218
217
  type: :runtime
219
218
  version_requirements: *id014
220
219
  - !ruby/object:Gem::Dependency
221
- name: uuid
220
+ name: syntax
222
221
  prerelease: false
223
222
  requirement: &id015 !ruby/object:Gem::Requirement
224
223
  none: false
@@ -231,6 +230,20 @@ dependencies:
231
230
  version: "0"
232
231
  type: :runtime
233
232
  version_requirements: *id015
233
+ - !ruby/object:Gem::Dependency
234
+ name: uuid
235
+ prerelease: false
236
+ requirement: &id016 !ruby/object:Gem::Requirement
237
+ none: false
238
+ requirements:
239
+ - - ">="
240
+ - !ruby/object:Gem::Version
241
+ hash: 3
242
+ segments:
243
+ - 0
244
+ version: "0"
245
+ type: :runtime
246
+ version_requirements: *id016
234
247
  description: A prototype of the Bloom distributed programming language, as a Ruby DSL.
235
248
  email:
236
249
  - bloomdevs@gmail.com
@@ -259,6 +272,7 @@ files:
259
272
  - lib/bud/errors.rb
260
273
  - lib/bud/graphs.rb
261
274
  - lib/bud/joins.rb
275
+ - lib/bud/metrics.rb
262
276
  - lib/bud/monkeypatch.rb
263
277
  - lib/bud/rebl.rb
264
278
  - lib/bud/rewrite.rb
@@ -272,7 +286,6 @@ files:
272
286
  - lib/bud/viz.rb
273
287
  - lib/bud/viz_util.rb
274
288
  - lib/bud.rb
275
- - lib/bud.rb.orig
276
289
  - bin/budplot
277
290
  - bin/budtimelines
278
291
  - bin/budvis
@@ -281,7 +294,6 @@ files:
281
294
  - docs/bfs_arch.png
282
295
  - docs/bloom-loop.png
283
296
  - docs/bust.md
284
- - docs/c.html
285
297
  - docs/cheat.md
286
298
  - docs/deploy.md
287
299
  - docs/getstarted.md
@@ -302,8 +314,6 @@ files:
302
314
  - examples/chat/chat_protocol.rb
303
315
  - examples/chat/chat_server.rb
304
316
  - examples/chat/README.md
305
- - examples/deploy/deploy_ip_port
306
- - examples/deploy/keys.rb
307
317
  - examples/deploy/tokenring-ec2.rb
308
318
  - examples/deploy/tokenring-fork.rb
309
319
  - examples/deploy/tokenring-thread.rb
@@ -311,7 +321,6 @@ files:
311
321
  - examples/README
312
322
  - README
313
323
  - LICENSE
314
- has_rdoc: true
315
324
  homepage: http://www.bloom-lang.org
316
325
  licenses:
317
326
  - BSD
@@ -343,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
343
352
  requirements: []
344
353
 
345
354
  rubyforge_project: bloom-lang
346
- rubygems_version: 1.6.2
355
+ rubygems_version: 1.8.6
347
356
  signing_key:
348
357
  specification_version: 3
349
358
  summary: A prototype Bloom DSL for distributed programming.
data/docs/c.html DELETED
@@ -1,251 +0,0 @@
1
- <h1>Bud Cheat Sheet</h1>
2
- <h2>General Bloom Syntax Rules</h2>
3
- <p>Bloom programs are unordered sets of statements.<br>
4
- Statements are delimited by semicolons (;) or newlines. <br>
5
- As in Ruby, backslash is used to escape a newline.<br></p>
6
- <h2>Simple embedding of Bud in a Ruby Class</h2>
7
- <pre><code>require 'bud'
8
-
9
- class Foo
10
- include Bud
11
-
12
- state do
13
- ...
14
- end
15
-
16
- bloom do
17
- ...
18
- end
19
- end
20
- </code></pre>
21
- <h2>State Declarations</h2>
22
- <p>A <code>state</code> block contains Bud collection definitions. A Bud collection is a <em>set</em>
23
- of <em>facts</em>; each fact is an array of Ruby values. Note that collections do not
24
- contain duplicates (inserting a duplicate fact into a collection is ignored).</p>
25
- <p>Like tables in a relational database, zero or more columns in a collection make
26
- up the collection's <em>key</em>. Attempting to insert two facts that agree on the key
27
- columns but are not duplicates results in a primary key violation (runtime
28
- exception).</p>
29
- <h3>Default Declaration Syntax</h3>
30
- <p><em>BudCollection :name, [keys] =&gt; [values]</em></p>
31
- <h3>table</h3>
32
- <p>Contents persist in memory until explicitly deleted.<br>
33
- Default attributes: <code>[:key] =&gt; [:val]</code></p>
34
- <pre><code>table :keyvalue
35
- table :composite, [:keyfield1, :keyfield2] =&gt; [:values]
36
- table :noDups, [:field1, field2]
37
- </code></pre>
38
- <h3>scratch</h3>
39
- <p>Contents emptied at start of each timestep.<br>
40
- Default attributes: <code>[:key] =&gt; [:val]</code></p>
41
- <pre><code>scratch :stats
42
- </code></pre>
43
- <h3>interface</h3>
44
- <p>Scratch collections, used as connection points between modules.<br>
45
- Default attributes: <code>[:key] =&gt; [:val]</code></p>
46
- <pre><code>interface input, :request
47
- interface output, :response
48
- </code></pre>
49
- <h3>channel</h3>
50
- <p>Network channel manifested as a scratch collection.<br>
51
- Facts that are inserted into a channel are sent to a remote host; the address of the remote host is specified in an attribute of the channel that is denoted with <code>@</code>.<br>
52
- Default attributes: <code>[:@address, :val] =&gt; []</code></p>
53
- <p>(Bloom statements with channel on lhs must use async merge (<code>&lt;~</code>).)</p>
54
- <pre><code>channel :msgs
55
- channel :req_chan, [:cartnum, :storenum, :@server] =&gt; [:command, :params]
56
- </code></pre>
57
- <h3>periodic</h3>
58
- <p>System timer manifested as a scratch collection.<br>
59
- System-provided attributes: <code>[:key] =&gt; [:val]</code><br>
60
- &nbsp;&nbsp;&nbsp;&nbsp; (<code>key</code> is a unique ID, <code>val</code> is a Ruby Time converted to a string.)<br>
61
- State declaration includes interval (in seconds).</p>
62
- <p>(periodic can only be used on rhs of a Bloom statement.)</p>
63
- <pre><code>periodic :timer, 0.1
64
- </code></pre>
65
- <h3>stdio</h3>
66
- <p>Built-in scratch collection mapped to Ruby's <code>$stdin</code> and <code>$stdout</code><br>
67
- System-provided attributes: <code>[:line] =&gt; []</code></p>
68
- <p>Statements with stdio on lhs must use async merge (<code>&lt;~</code>).<br>
69
- To capture <code>$stdin</code> on rhs, instantiate Bud with <code>:read_stdin</code> option.<br></p>
70
- <h3>tctable</h3>
71
- <p>Table collection mapped to a <a href="http://fallabs.com/tokyocabinet/">Tokyo Cabinet</a> store.<br>
72
- Default attributes: <code>[:key] =&gt; [:val]</code></p>
73
- <pre><code>tctable :t1
74
- tctable :t2, [:k1, :k2] =&gt; [:v1, :v2]
75
- </code></pre>
76
- <h3>zktable</h3>
77
- <p>Table collection mapped to an <a href="http://hadoop.apache.org/zookeeper/">Apache Zookeeper</a> store.<br>
78
- System-provided attributes: <code>[:key] =&gt; [:val]</code><br>
79
- State declaration includes Zookeeper path and optional TCP string (default: "localhost:2181")<br></p>
80
- <pre><code>zktable :foo, "/bat"
81
- zktable :bar, "/dat", "localhost:2182"
82
- </code></pre>
83
- <h2>Bloom Statements</h2>
84
- <p><em>lhs BloomOp rhs</em></p>
85
- <p>Left-hand-side (lhs) is a named <code>BudCollection</code> object.<br>
86
- Right-hand-side (rhs) is a Ruby expression producing a <code>BudCollection</code> or <code>Array</code> of <code>Arrays</code>.<br>
87
- BloomOp is one of the 4 operators listed below.</p>
88
- <h3>Bloom Operators</h3>
89
- <p>merges:</p>
90
- <ul>
91
- <li><code>left &lt;= right</code> &nbsp;&nbsp;&nbsp;&nbsp; (<em>instantaneous</em>)</li>
92
- <li><code>left &lt;+ right</code> &nbsp;&nbsp;&nbsp;&nbsp; (<em>deferred</em>)</li>
93
- <li><code>left &lt;~ right</code> &nbsp;&nbsp;&nbsp;&nbsp; (<em>asynchronous</em>)</li>
94
- </ul>
95
- <p>delete:</p>
96
- <ul>
97
- <li><code>left &lt;- right</code> &nbsp;&nbsp;&nbsp;&nbsp; (<em>deferred</em>)</li>
98
- </ul>
99
- <h3>Collection Methods</h3>
100
- <p>Standard Ruby methods used on a BudCollection <code>bc</code>:</p>
101
- <p>implicit map:</p>
102
- <pre><code>t1 &lt;= bc {|t| [t.col1 + 4, t.col2.chomp]} # formatting/projection
103
- t2 &lt;= bc {|t| t if t.col = 5} # selection
104
- </code></pre>
105
- <p><code>flat_map</code>:</p>
106
- <pre><code>require 'backports' # flat_map not included in Ruby 1.8 by default
107
-
108
- t3 &lt;= bc.flat_map do |t| # unnest a collection-valued attribute
109
- bc.col4.map { |sub| [t.col1, t.col2, t.col3, sub] }
110
- end
111
- </code></pre>
112
- <p><code>bc.reduce</code>, <code>bc.inject</code>:</p>
113
- <pre><code>t4 &lt;= bc.reduce({}) do |memo, t| # example: groupby col1 and count
114
- memo[t.col1] ||= 0
115
- memo[t.col1] += 1
116
- memo
117
- end
118
- </code></pre>
119
- <p><code>bc.include?</code>:</p>
120
- <pre><code>t5 &lt;= bc do |t| # like SQL's NOT IN
121
- t unless t2.include?([t.col1, t.col2])
122
- end
123
- </code></pre>
124
- <h2>BudCollection-Specific Methods</h2>
125
- <p><code>bc.keys</code>: projects <code>bc</code> to key columns<br></p>
126
- <p><code>bc.values</code>: projects <code>bc</code> to non-key columns<br></p>
127
- <p><code>bc.inspected</code>: shorthand for <code>bc {|t| [t.inspect]}</code></p>
128
- <pre><code>stdio &lt;~ bc.inspected
129
- </code></pre>
130
- <p><code>chan.payloads</code>: projects <code>chan</code> to non-address columns. Only defined for channels.</p>
131
- <pre><code># at sender
132
- msgs &lt;~ requests {|r| "127.0.0.1:12345", r}
133
- # at receiver
134
- requests &lt;= msgs.payloads
135
- </code></pre>
136
- <p><code>bc.exists?</code>: test for non-empty collection. Can optionally pass in a block.</p>
137
- <pre><code>stdio &lt;~ [["Wake Up!"] if timer.exists?]
138
- stdio &lt;~ requests do |r|
139
- [r.inspect] if msgs.exists?{|m| r.ident == m.ident}
140
- end
141
- </code></pre>
142
- <h2>SQL-style grouping/aggregation (and then some)</h2>
143
- <ul>
144
- <li><code>bc.group([:col1, :col2], min(:col3))</code>. <em>akin to min(col3) GROUP BY (col1,col2)</em></li>
145
- <li>exemplary aggs: <code>min</code>, <code>max</code>, <code>choose</code></li>
146
- <li>summary aggs: <code>sum</code>, <code>avg</code>, <code>count</code></li>
147
- <li>structural aggs: <code>accum</code></li>
148
- <li><code>bc.argmax([:col1], :col2)</code> &nbsp;&nbsp;&nbsp;&nbsp; <em>returns the bc tuple per col1 that has highest col2</em></li>
149
- <li><code>bc.argmin([:col1], :col2)</code></li>
150
- </ul>
151
- <h3>Built-in Aggregates:</h3>
152
- <ul>
153
- <li>Exemplary aggs: <code>min</code>, <code>max</code>, <code>choose</code></li>
154
- <li>Summary aggs: <code>count</code>, <code>sum</code>, <code>avg</code></li>
155
- <li>Structural aggs: <code>accum</code></li>
156
- </ul>
157
- <p>Note that custom aggregation can be written using <code>reduce</code>.</p>
158
- <h2>Collection Combination (Join)</h2>
159
- <p>To match items across two (or more) collections, use the <code>*</code> operator, followed by methods to filter/format the result (<code>pairs</code>, <code>matches</code>, <code>combos</code>, <code>lefts</code>, <code>rights</code>).</p>
160
- <h3>Methods on Combinations (Joins)</h3>
161
- <p><code>pairs(</code><em>hash pairs</em><code>)</code>: <br>
162
- Given a <code>*</code> expression, form all pairs of items with value matches in the hash-pairs attributes. Hash pairs can be fully qualified (<code>coll1.attr1 =&gt; coll2.attr2</code>) or shorthand (<code>:attr1 =&gt; :attr2</code>).</p>
163
- <pre><code># for each inbound msg, find match in a persistent buffer
164
- result &lt;= (msg * buffer).pairs(:val =&gt; :key) {|m, b| [m.address, m.val, b.val] }
165
- </code></pre>
166
- <p><code>combos(</code><em>hash pairs</em><code>)</code>: <br>
167
- Alias for <code>pairs</code>, more readable for multi-collection <code>*</code> expressions. Must use fully-qualified hash pairs.</p>
168
- <pre><code># the following 2 Bloom statements are equivalent to this SQL
169
- # SELECT r.a, s_tab.b, t.c
170
- # FROM r, s_tab, t
171
- # WHERE r.x = s_tab.x
172
- # AND s_tab.x = t.x;
173
-
174
- # multiple column matches
175
- out &lt;= (r * s_tab * t).combos(r.x =&gt; s_tab.x, s_tab.x =&gt; t.x) do |t1, t2, t3|
176
- [t1.a, t2.b, t3.c]
177
- end
178
-
179
- # column matching done per pair: this will be very slow
180
- out &lt;= (r * s_tab * t).combos do |t1, t2, t3|
181
- [t1.a, t2.b, t3.c] if r.x == s_tab.x and s_tab.x == t.x
182
- end
183
- </code></pre>
184
- <p><code>matches</code>:<br>
185
- Shorthand for <code>combos</code> with hash pairs for all attributes with matching names.</p>
186
- <pre><code># Equivalent to the above statements if x is the only attribute name in common:
187
- out &lt;= (r * s_tab * t).matches do {|t1, t2, t3| [t1.a, t2.b, t3.c]}
188
- </code></pre>
189
- <p><code>lefts(</code><em>hash pairs</em><code>)</code>: <br>
190
- Like <code>pairs</code>, but implicitly includes a block that projects down to the left item in each pair.</p>
191
- <p><code>rights(</code><em>hash pairs</em><code>)</code>:
192
- Like <code>pairs</code>, but implicitly includes a block that projects down to the right item in each pair.</p>
193
- <p><code>flatten</code>:<br>
194
- <code>flatten</code> is a bit like SQL's <code>SELECT *</code>: it produces a collection of concatenated objects, with a schema that is the concatenation of the schemas in tablelist (with duplicate names disambiguated.) Useful for chaining to operators that expect input collections with schemas, e.g. group:</p>
195
- <pre><code>out &lt;= (r * s).matches.flatten.group([:a], max(:b))
196
- </code></pre>
197
- <p><code>outer(</code><em>hash pairs</em><code>)</code>:<br>
198
- Left Outer Join. Like <code>pairs</code>, but objects in the first collection will be produced nil-padded if they have no match in the second collection.</p>
199
- <h2>Temp Collections</h2>
200
- <p><code>temp</code><br>
201
- Temp collections are scratches defined within a <code>bloom</code> block:</p>
202
- <pre><code>temp :my_scratch1 &lt;= foo
203
- </code></pre>
204
- <p>The schema of a temp collection in inherited from the rhs; if the rhs has no
205
- schema, a simple one is manufactured to suit the data found in the rhs at
206
- runtime: <code>[c0, c1, ...]</code>.</p>
207
- <h2>Bud Modules</h2>
208
- <p>A Bud module combines state (collections) and logic (Bloom rules). Using modules allows your program to be decomposed into a collection of smaller units.</p>
209
- <p>Definining a Bud module is identical to defining a Ruby module, except that the module can use the <code>bloom</code>, <code>bootstrap</code>, and <code>state</code> blocks described above.</p>
210
- <p>There are two ways to use a module <em>B</em> in another Bloom module <em>A</em>:</p>
211
- <ol>
212
- <li>
213
- <p><code>include B</code>: This "inlines" the definitions (state and logic) from <em>B</em> into
214
- <em>A</em>. Hence, collections defined in <em>B</em> can be accessed from <em>A</em> (via the
215
- same syntax as <em>A</em>'s own collections). In fact, since Ruby is
216
- dynamically-typed, Bloom statements in <em>B</em> can access collections
217
- in <em>A</em>!</p>
218
- </li>
219
- <li>
220
- <p><code>import B =&gt; :b</code>: The <code>import</code> statement provides a more structured way to
221
- access another module. Module <em>A</em> can now access state defined in <em>B</em> by
222
- using the qualifier <code>b</code>. <em>A</em> can also import two different copies of <em>B</em>,
223
- and give them local names <code>b1</code> and <code>b2</code>; these copies will be independent
224
- (facts inserted into a collection defined in <code>b1</code> won't also be inserted
225
- into <code>b2</code>'s copy of the collection).</p>
226
- </li>
227
- </ol>
228
- <h2>Skeleton of a Bud Module</h2>
229
- <pre><code>require 'rubygems'
230
- require 'bud'
231
-
232
- module YourModule
233
- include Bud
234
-
235
- state do
236
- ...
237
- end
238
-
239
- bootstrap do
240
- ...
241
- end
242
-
243
- bloom :some_stmts do
244
- ...
245
- end
246
-
247
- bloom :more_stmts do
248
- ...
249
- end
250
- end
251
- </code></pre>
@@ -1 +0,0 @@
1
- 67.188.223.50:5555
@@ -1,5 +0,0 @@
1
- access_key_id <= [["AKIAJZHUX3MXJLQULOLQ"]]
2
- secret_access_key <= [['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']]
3
- key_name <= [["nrc"]]
4
- ec2_key_location <= [["/Users/neilc/.ssh/nrc.pem"]]
5
-