bud 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/README +33 -16
  2. data/bin/budplot +42 -65
  3. data/bin/budtimelines +235 -0
  4. data/bin/budvis +24 -122
  5. data/bin/rebl +1 -0
  6. data/docs/README.md +21 -10
  7. data/docs/bfs.md +4 -6
  8. data/docs/c.html +251 -0
  9. data/docs/cheat.md +45 -30
  10. data/docs/deploy.md +26 -26
  11. data/docs/getstarted.md +6 -4
  12. data/docs/visualizations.md +43 -31
  13. data/examples/chat/chat.rb +4 -9
  14. data/examples/chat/chat_server.rb +1 -8
  15. data/examples/deploy/deploy_ip_port +1 -0
  16. data/examples/deploy/keys.rb +5 -0
  17. data/examples/deploy/tokenring-ec2.rb +9 -9
  18. data/examples/deploy/{tokenring-local.rb → tokenring-fork.rb} +3 -5
  19. data/examples/deploy/tokenring-thread.rb +15 -0
  20. data/examples/deploy/tokenring.rb +25 -17
  21. data/lib/bud/aggs.rb +87 -25
  22. data/lib/bud/bud_meta.rb +48 -31
  23. data/lib/bud/bust/bust.rb +16 -15
  24. data/lib/bud/collections.rb +207 -232
  25. data/lib/bud/depanalysis.rb +1 -0
  26. data/lib/bud/deploy/countatomicdelivery.rb +8 -20
  27. data/lib/bud/deploy/deployer.rb +16 -16
  28. data/lib/bud/deploy/ec2deploy.rb +34 -35
  29. data/lib/bud/deploy/forkdeploy.rb +90 -0
  30. data/lib/bud/deploy/threaddeploy.rb +38 -0
  31. data/lib/bud/graphs.rb +103 -199
  32. data/lib/bud/joins.rb +190 -41
  33. data/lib/bud/monkeypatch.rb +84 -0
  34. data/lib/bud/rebl.rb +8 -1
  35. data/lib/bud/rewrite.rb +152 -49
  36. data/lib/bud/server.rb +1 -0
  37. data/lib/bud/state.rb +24 -10
  38. data/lib/bud/storage/dbm.rb +170 -0
  39. data/lib/bud/storage/tokyocabinet.rb +5 -1
  40. data/lib/bud/stratify.rb +6 -7
  41. data/lib/bud/viz.rb +31 -17
  42. data/lib/bud/viz_util.rb +204 -0
  43. data/lib/bud.rb +271 -244
  44. data/lib/bud.rb.orig +806 -0
  45. metadata +43 -22
  46. data/docs/bfs.raw +0 -251
  47. data/docs/diffs +0 -181
  48. data/examples/basics/out +0 -1103
  49. data/examples/basics/out.new +0 -856
  50. 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