Skip to content
Browse files

Removed useless thing in leader election combos, changed tc_leader_el…

…ection to tick more times, multicast pairs on ident
  • Loading branch information...
1 parent a3a61a5 commit 4ad55123cf5854d18336c20e54a59ee22bf8e959 @kristinechen kristinechen committed Dec 13, 2011
View
2 new_sandbox/multicast/multicast.rb
@@ -52,7 +52,7 @@ module Multicast
bloom :done_mcast do
acked_count <= pipe_sent.group([:ident], count(:ident))
- unacked_count <+- (acked_count * unacked_count).pairs do |a, u|
+ unacked_count <+- (acked_count * unacked_count).pairs(:ident => :ident) do |a, u|
[a.ident, u.num - a.num]
end
mcast_done <= unacked_count {|u| [u.ident] if u.num == 0}
View
6 new_sandbox/paxos/leader_election.rb
@@ -52,7 +52,6 @@ module LeaderMembership
magenta <= leader { |l| ["leader: #{l.host}"] }
blue <= leader_vote { |lv| ["leader_vote: #{lv.inspect}"] }
green <= member_list { |ml| ["member_list: #{ml.inspect}"] }
- #cyan <= potential_member
end
# Each node, when receiving a message from pipe_out, needs to determine
@@ -110,9 +109,10 @@ module LeaderMembership
get_count <= [[:mcast_msg]]
temp :did_add_member <= added_member.group([], count(:ident))
mcast_send <= (return_count *
- new_leader *
- did_add_member).combos do |r, n, d|
+ new_leader).pairs do |r, n|
if r.ident == :mcast_msg
+ puts "#{n.host} at #{ip_port}"
+ puts "#{member.inspected} at #{ip_port}"
["vote_#{r.tally}", [:vote, n.host]]
end
end
View
4 new_sandbox/tests/tc_leader_election.rb
@@ -31,7 +31,7 @@ def test_simple
puts "We have 3 hosts: #{hosts.inspect}"
q = Queue.new
- 6.times { q.push(true) }
+ 10.times { q.push(true) }
respondedp = {}
lms.each do |lm|
@@ -48,7 +48,7 @@ def test_simple
cb.each do |row|
if row.host == "127.0.0.1:3001" and !respondedp[lm]
q.pop
-# respondedp[lm] = true
+ #respondedp[lm] = true
end
end
end

0 comments on commit 4ad5512

Please sign in to comment.
Something went wrong with that request. Please try again.