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
data/lib/bud/bust/bust.rb
CHANGED
@@ -15,12 +15,6 @@ module Bust
|
|
15
15
|
# used this for inspiration:
|
16
16
|
# http://blogs.msdn.com/b/abhinaba/archive/2005/10/14/474841.aspx
|
17
17
|
|
18
|
-
# allow state to be queried easily
|
19
|
-
state do
|
20
|
-
table :t_table_info, [:tab_name, :tab_type]
|
21
|
-
table :t_table_schema, [:tab_name, :scheme]
|
22
|
-
end
|
23
|
-
|
24
18
|
bootstrap do
|
25
19
|
# copied from peter's code; this should probably be in the Bud runtime or in
|
26
20
|
# some meta module
|
@@ -34,11 +28,15 @@ module Bust
|
|
34
28
|
BustClass.new(bud, q)
|
35
29
|
end
|
36
30
|
# Wait for socket to be ready before we return from bootstrap.
|
37
|
-
|
31
|
+
r = q.pop
|
32
|
+
if r.class <= Exception
|
33
|
+
raise r
|
34
|
+
else
|
35
|
+
@bust_port = r
|
36
|
+
end
|
38
37
|
end
|
39
38
|
|
40
39
|
class BustClass
|
41
|
-
|
42
40
|
class BustHandler
|
43
41
|
def initialize(session, request, body, bud)
|
44
42
|
@session = session
|
@@ -95,17 +93,21 @@ module Bust
|
|
95
93
|
ensure
|
96
94
|
@session.close
|
97
95
|
end
|
98
|
-
|
99
96
|
end
|
100
97
|
end
|
101
98
|
|
102
99
|
def initialize(bud, q)
|
103
100
|
# allow user-configurable port
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
101
|
+
begin
|
102
|
+
server = TCPServer.new(bud.ip, (bud.options[:bust_port] or 0))
|
103
|
+
port = server.addr[1]
|
104
|
+
puts "Bust server listening on #{bud.ip}:#{port}"
|
105
|
+
# We're now ready to accept connections
|
106
|
+
q << port
|
107
|
+
rescue Exception => e
|
108
|
+
# Avoid deadlock on queue, report exception to caller
|
109
|
+
q << e
|
110
|
+
end
|
109
111
|
|
110
112
|
loop do
|
111
113
|
session = server.accept
|
@@ -124,6 +126,5 @@ module Bust
|
|
124
126
|
end
|
125
127
|
end
|
126
128
|
end
|
127
|
-
|
128
129
|
end
|
129
130
|
end
|