bud 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +33 -16
- data/bin/budplot +42 -65
- data/bin/budtimelines +235 -0
- data/bin/budvis +24 -122
- data/bin/rebl +1 -0
- data/docs/README.md +21 -10
- data/docs/bfs.md +4 -6
- data/docs/c.html +251 -0
- data/docs/cheat.md +45 -30
- data/docs/deploy.md +26 -26
- data/docs/getstarted.md +6 -4
- data/docs/visualizations.md +43 -31
- data/examples/chat/chat.rb +4 -9
- data/examples/chat/chat_server.rb +1 -8
- data/examples/deploy/deploy_ip_port +1 -0
- data/examples/deploy/keys.rb +5 -0
- data/examples/deploy/tokenring-ec2.rb +9 -9
- data/examples/deploy/{tokenring-local.rb → tokenring-fork.rb} +3 -5
- data/examples/deploy/tokenring-thread.rb +15 -0
- data/examples/deploy/tokenring.rb +25 -17
- data/lib/bud/aggs.rb +87 -25
- data/lib/bud/bud_meta.rb +48 -31
- data/lib/bud/bust/bust.rb +16 -15
- data/lib/bud/collections.rb +207 -232
- data/lib/bud/depanalysis.rb +1 -0
- data/lib/bud/deploy/countatomicdelivery.rb +8 -20
- data/lib/bud/deploy/deployer.rb +16 -16
- data/lib/bud/deploy/ec2deploy.rb +34 -35
- data/lib/bud/deploy/forkdeploy.rb +90 -0
- data/lib/bud/deploy/threaddeploy.rb +38 -0
- data/lib/bud/graphs.rb +103 -199
- data/lib/bud/joins.rb +190 -41
- data/lib/bud/monkeypatch.rb +84 -0
- data/lib/bud/rebl.rb +8 -1
- data/lib/bud/rewrite.rb +152 -49
- data/lib/bud/server.rb +1 -0
- data/lib/bud/state.rb +24 -10
- data/lib/bud/storage/dbm.rb +170 -0
- data/lib/bud/storage/tokyocabinet.rb +5 -1
- data/lib/bud/stratify.rb +6 -7
- data/lib/bud/viz.rb +31 -17
- data/lib/bud/viz_util.rb +204 -0
- data/lib/bud.rb +271 -244
- data/lib/bud.rb.orig +806 -0
- metadata +43 -22
- data/docs/bfs.raw +0 -251
- data/docs/diffs +0 -181
- data/examples/basics/out +0 -1103
- data/examples/basics/out.new +0 -856
- data/lib/bud/deploy/localdeploy.rb +0 -53
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bud'
|
3
|
-
require 'thread'
|
4
|
-
require 'bud/deploy/deployer'
|
5
|
-
|
6
|
-
# Starts up a bunch of Bud instances locally on 127.0.0.1, with ephemeral ports.
|
7
|
-
module LocalDeploy
|
8
|
-
include Deployer
|
9
|
-
|
10
|
-
def stop_bg
|
11
|
-
super
|
12
|
-
for p in @pids
|
13
|
-
Process.kill("INT", p)
|
14
|
-
end
|
15
|
-
Process.waitall
|
16
|
-
trap("CLD", "DEFAULT")
|
17
|
-
end
|
18
|
-
|
19
|
-
deploystrap do
|
20
|
-
trap("CLD") {
|
21
|
-
pid = Process.wait
|
22
|
-
puts "Child pid #{pid}: terminated"
|
23
|
-
}
|
24
|
-
|
25
|
-
read, write = IO.pipe
|
26
|
-
if node_count[[]]
|
27
|
-
print "Forking local processes"
|
28
|
-
@pids = []
|
29
|
-
(0..node_count[[]].num-1).map do |i|
|
30
|
-
@pids << Process.fork do
|
31
|
-
# Don't want to inherit our parent's random stuff.
|
32
|
-
srand
|
33
|
-
foo = self.class.new
|
34
|
-
foo.run_bg
|
35
|
-
print "."
|
36
|
-
$stdout.flush
|
37
|
-
# Processes write their port to a pipe.
|
38
|
-
write.print foo.port.to_s + "\n"
|
39
|
-
EventMachine.reactor_thread.join
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# Read ports from pipe.
|
44
|
-
(0..node_count[[]].num-1).map do |i|
|
45
|
-
node << [i, "localhost:" + read.readline.rstrip]
|
46
|
-
end
|
47
|
-
read.close
|
48
|
-
write.close
|
49
|
-
puts "done"
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|