Yuta HIGUCHI

remove debug trace logs

Change-Id: I83de49ff062bb49cad4509d764d7a6b32b543e2e
...@@ -6,9 +6,6 @@ import java.io.IOException; ...@@ -6,9 +6,6 @@ import java.io.IOException;
6 import java.util.Set; 6 import java.util.Set;
7 import java.util.Timer; 7 import java.util.Timer;
8 import java.util.TimerTask; 8 import java.util.TimerTask;
9 -import java.util.concurrent.TimeUnit;
10 -import java.util.concurrent.TimeoutException;
11 -
12 import org.apache.felix.scr.annotations.Activate; 9 import org.apache.felix.scr.annotations.Activate;
13 import org.apache.felix.scr.annotations.Component; 10 import org.apache.felix.scr.annotations.Component;
14 import org.apache.felix.scr.annotations.Deactivate; 11 import org.apache.felix.scr.annotations.Deactivate;
...@@ -36,7 +33,6 @@ import org.onlab.netty.Message; ...@@ -36,7 +33,6 @@ import org.onlab.netty.Message;
36 import org.onlab.netty.MessageHandler; 33 import org.onlab.netty.MessageHandler;
37 import org.onlab.netty.MessagingService; 34 import org.onlab.netty.MessagingService;
38 import org.onlab.netty.NettyMessagingService; 35 import org.onlab.netty.NettyMessagingService;
39 -import org.onlab.netty.Response;
40 import org.slf4j.Logger; 36 import org.slf4j.Logger;
41 import org.slf4j.LoggerFactory; 37 import org.slf4j.LoggerFactory;
42 38
...@@ -123,13 +119,10 @@ public class ClusterCommunicationManager ...@@ -123,13 +119,10 @@ public class ClusterCommunicationManager
123 checkArgument(node != null, "Unknown nodeId: %s", toNodeId); 119 checkArgument(node != null, "Unknown nodeId: %s", toNodeId);
124 Endpoint nodeEp = new Endpoint(node.ip().toString(), node.tcpPort()); 120 Endpoint nodeEp = new Endpoint(node.ip().toString(), node.tcpPort());
125 try { 121 try {
126 - log.info("sending..."); 122 + messagingService.sendAsync(nodeEp,
127 - Response resp = messagingService.sendAndReceive(nodeEp,
128 message.subject().value(), SERIALIZER.encode(message)); 123 message.subject().value(), SERIALIZER.encode(message));
129 - resp.get(1, TimeUnit.SECONDS);
130 - log.info("sent...");
131 return true; 124 return true;
132 - } catch (IOException | TimeoutException e) { 125 + } catch (IOException e) {
133 log.error("Failed to send cluster message to nodeId: " + toNodeId, e); 126 log.error("Failed to send cluster message to nodeId: " + toNodeId, e);
134 } 127 }
135 128
...@@ -197,8 +190,7 @@ public class ClusterCommunicationManager ...@@ -197,8 +190,7 @@ public class ClusterCommunicationManager
197 } 190 }
198 } 191 }
199 192
200 - // FIXME: revert static 193 + private final class InternalClusterMessageHandler implements MessageHandler {
201 - private class InternalClusterMessageHandler implements MessageHandler {
202 194
203 private final ClusterMessageHandler handler; 195 private final ClusterMessageHandler handler;
204 196
...@@ -208,17 +200,12 @@ public class ClusterCommunicationManager ...@@ -208,17 +200,12 @@ public class ClusterCommunicationManager
208 200
209 @Override 201 @Override
210 public void handle(Message message) { 202 public void handle(Message message) {
211 - // FIXME: remove me
212 - log.info("InternalClusterMessageHandler.handle({})", message);
213 try { 203 try {
214 - log.info("before decode");
215 ClusterMessage clusterMessage = SERIALIZER.decode(message.payload()); 204 ClusterMessage clusterMessage = SERIALIZER.decode(message.payload());
216 - log.info("Subject:({}), Sender:({})", clusterMessage.subject(), clusterMessage.sender());
217 handler.handle(clusterMessage); 205 handler.handle(clusterMessage);
218 - message.respond("ACK".getBytes());
219 } catch (Exception e) { 206 } catch (Exception e) {
220 - // TODO Auto-generated catch block 207 + log.error("Exception caught during ClusterMessageHandler", e);
221 - log.error("failed", e); 208 + throw e;
222 } 209 }
223 } 210 }
224 } 211 }
......