rgossip2 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rgossip2/gossipper.rb +2 -1
- data/lib/rgossip2/receiver.rb +12 -5
- metadata +3 -3
data/lib/rgossip2/gossipper.rb
CHANGED
@@ -67,7 +67,8 @@ module RGossip2
|
|
67
67
|
dest = @node_list.choose_except(@self_node)
|
68
68
|
return unless dest # ないとは思うけど…
|
69
69
|
|
70
|
-
|
70
|
+
# 意図的にコメントアウト
|
71
|
+
#debug("Data is transmitted: address=#{dest.address}")
|
71
72
|
|
72
73
|
# チャンクに分けてデータを送信
|
73
74
|
@node_list.serialize.each do |chunk|
|
data/lib/rgossip2/receiver.rb
CHANGED
@@ -65,7 +65,8 @@ module RGossip2
|
|
65
65
|
return unless select([sock], [], [], @context.receive_timeout)
|
66
66
|
message, (afam, port, host, ip) = sock.recvfrom(@context.buffer_size * @context.allowance)
|
67
67
|
|
68
|
-
|
68
|
+
# 意図的にコメントアウト
|
69
|
+
#debug("Data was received: from=#{ip}")
|
69
70
|
|
70
71
|
recv_nodes = unpack_message(message)
|
71
72
|
|
@@ -75,7 +76,9 @@ module RGossip2
|
|
75
76
|
}
|
76
77
|
else
|
77
78
|
# データが取得できなかった場合は無効なデータとして処理
|
78
|
-
|
79
|
+
|
80
|
+
# 意図的にコメントアウト
|
81
|
+
#debug("Invalid data was received: from=#{ip}")
|
79
82
|
end
|
80
83
|
rescue Exception => e
|
81
84
|
handle_error(e)
|
@@ -104,7 +107,8 @@ module RGossip2
|
|
104
107
|
# 受信したNodeのタイムスタンプが新しければ
|
105
108
|
# 持っているNodeを更新
|
106
109
|
if timestamp > node.timestamp
|
107
|
-
|
110
|
+
# 意図的にコメントアウト
|
111
|
+
#debug("The node was updated: address=#{address} timestamp=#{timestamp}")
|
108
112
|
|
109
113
|
node.timestamp = timestamp
|
110
114
|
node.data = data
|
@@ -118,7 +122,8 @@ module RGossip2
|
|
118
122
|
# 受信したNodeのタイムスタンプが新しければ
|
119
123
|
# デッドリストのノードを復活させる
|
120
124
|
if timestamp > node.timestamp
|
121
|
-
|
125
|
+
# 意図的にコメントアウト
|
126
|
+
#debug("Node revived: address=#{address} timestamp=#{timestamp}")
|
122
127
|
|
123
128
|
@dead_list.delete(address)
|
124
129
|
@node_list[address] = node
|
@@ -129,7 +134,9 @@ module RGossip2
|
|
129
134
|
}
|
130
135
|
else
|
131
136
|
# リストにない場合はNodeを追加
|
132
|
-
|
137
|
+
|
138
|
+
# 意図的にコメントアウト
|
139
|
+
#debug("Node was added: address=#{address} timestamp=#{timestamp}")
|
133
140
|
|
134
141
|
node = create(Node, @node_list, @dead_list, address, data, timestamp)
|
135
142
|
@node_list[address] = node
|
metadata
CHANGED