Signed-off-by: Madhavan Kasthurirangan <mkasthur@cisco.com>
14 files changed:
* This is to avoid continuous flooding
*/
if (Arrays.equals(sourceMAC, getControllerMAC())) {
* This is to avoid continuous flooding
*/
if (Arrays.equals(sourceMAC, getControllerMAC())) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(
"Receive the self originated packet (srcMAC {}) --> DROP",
HexEncode.bytesToHexString(sourceMAC));
"Receive the self originated packet (srcMAC {}) --> DROP",
HexEncode.bytesToHexString(sourceMAC));
subnet = switchManager.getSubnetByNetworkAddress(sourceIP);
}
if (subnet == null) {
subnet = switchManager.getSubnetByNetworkAddress(sourceIP);
}
if (subnet == null) {
- logger.debug("can't find subnet matching {}, drop packet", sourceIP
- .toString());
+ logger.debug("can't find subnet matching {}, drop packet",sourceIP);
- logger.debug("Found {} matching {}", subnet.toString(), sourceIP
- .toString());
+ logger.debug("Found {} matching {}", subnet, sourceIP);
/*
* Make sure that the host is a legitimate member of this subnet
*/
if (!subnet.hasNodeConnector(p)) {
logger.debug("{} showing up on {} does not belong to {}",
/*
* Make sure that the host is a legitimate member of this subnet
*/
if (!subnet.hasNodeConnector(p)) {
logger.debug("{} showing up on {} does not belong to {}",
- new Object[] { sourceIP.toString(), p, subnet.toString() });
+ new Object[] { sourceIP, p, subnet });
}
public void find(InetAddress networkAddress) {
}
public void find(InetAddress networkAddress) {
- logger.debug("Received find IP {}", networkAddress.toString());
+ logger.debug("Received find IP {}", networkAddress);
Subnet subnet = null;
if (switchManager != null) {
subnet = switchManager.getSubnetByNetworkAddress(networkAddress);
}
if (subnet == null) {
Subnet subnet = null;
if (switchManager != null) {
subnet = switchManager.getSubnetByNetworkAddress(networkAddress);
}
if (subnet == null) {
- logger.debug("can't find subnet matching IP {}", networkAddress
- .toString());
+ logger.debug("can't find subnet matching IP {}", networkAddress);
- logger.debug("found subnet {}", subnet.toString());
+ logger.debug("found subnet {}", subnet);
// send a broadcast ARP Request to this interface
sendBcastARPRequest(networkAddress, subnet);
// send a broadcast ARP Request to this interface
sendBcastARPRequest(networkAddress, subnet);
}
if (subnet == null) {
logger.debug("can't find subnet matching {}", host
}
if (subnet == null) {
logger.debug("can't find subnet matching {}", host
- .getNetworkAddress().toString());
return;
}
sendUcastARPRequest(host, subnet);
return;
}
sendUcastARPRequest(host, subnet);
subnet = switchManager.getSubnetByNetworkAddress(dIP);
}
if (subnet == null) {
subnet = switchManager.getSubnetByNetworkAddress(dIP);
}
if (subnet == null) {
- logger.debug("can't find subnet matching {}, drop packet", dIP
- .toString());
+ logger.debug("can't find subnet matching {}, drop packet", dIP);
- logger.debug("Found {} matching {}", subnet.toString(), dIP.toString());
+ logger.debug("Found {} matching {}", subnet, dIP);
/*
* unknown destination host, initiate ARP request
*/
/*
* unknown destination host, initiate ARP request
*/
arphost.setHostIP(networkAddr);
arphost.setSent_count((short) 1);
ARPPendingList.add(arphost);
arphost.setHostIP(networkAddr);
arphost.setSent_count((short) 1);
ARPPendingList.add(arphost);
- logger.debug("Host Added to ARPPending List, IP: {}",
- networkAddr.toString());
+ logger.debug("Host Added to ARPPending List, IP: {}", networkAddr);
}
private void removePendingARPFromList(int index) {
}
private void removePendingARPFromList(int index) {
*/
removePendingARPFromList(i);
logger.debug("Host Removed from ARPPending List, IP: {}",
*/
removePendingARPFromList(i);
logger.debug("Host Removed from ARPPending List, IP: {}",
- networkAddr.toString());
*/
failedARPReqList.remove(i);
logger.debug("Host Removed from FailedARPReqList List, IP: {}",
*/
failedARPReqList.remove(i);
logger.debug("Host Removed from FailedARPReqList List, IP: {}",
- networkAddr.toString());
for (String switchName : hierarchy) {
buf.append(switchName + "/");
}
for (String switchName : hierarchy) {
buf.append(switchName + "/");
}
- logger.debug("{} -> {}", getContainerName(), buf.toString());
+ logger.debug("{} -> {}", getContainerName(), buf);
* Use the services of arphandler to check if host is still
* there
*/
* Use the services of arphandler to check if host is still
* there
*/
- logger.trace(
- "ARP Probing ({}) for {}({})",
- new Object[] {
- arp_cntdown,
- host.getNetworkAddress().getHostAddress(),
- HexEncode.bytesToHexString(host
- .getDataLayerAddressBytes()) });
+ if (logger.isTraceEnabled()) {
+ logger.trace(
+ "ARP Probing ({}) for {}({})",
+ new Object[] {
+ arp_cntdown,
+ host.getNetworkAddress().getHostAddress(),
+ HexEncode.bytesToHexString(host
+ .getDataLayerAddressBytes()) });
+ }
host.setArpSendCountDown(arp_cntdown);
hostFinder.probe(host);
}
host.setArpSendCountDown(arp_cntdown);
hostFinder.probe(host);
}
switch (type) {
case REMOVED:
long sid = (Long) node.getID();
switch (type) {
case REMOVED:
long sid = (Long) node.getID();
- logger.debug("Received removedSwitch for sw id {}",
- HexEncode.longToHexString(sid));
+ if (logger.isDebugEnabled()) {
+ logger.debug("Received removedSwitch for sw id {}",
+ HexEncode.longToHexString(sid));
+ }
for (Entry<InetAddress, HostNodeConnector> entry : hostsDB
.entrySet()) {
HostNodeConnector host = entry.getValue();
for (Entry<InetAddress, HostNodeConnector> entry : hostsDB
.entrySet()) {
HostNodeConnector host = entry.getValue();
ISwitch existingSwitch = switches.get(sid);
if (existingSwitch != null) {
logger.info("Replacing existing {} with New {}",
ISwitch existingSwitch = switches.get(sid);
if (existingSwitch != null) {
logger.info("Replacing existing {} with New {}",
- existingSwitch.toString(), sw.toString());
disconnectSwitch(existingSwitch);
}
switches.put(sid, sw);
disconnectSwitch(existingSwitch);
}
switches.put(sid, sw);
public void addMessageListener(OFType type, IMessageListener listener) {
IMessageListener currentListener = this.messageListeners.get(type);
if (currentListener != null) {
public void addMessageListener(OFType type, IMessageListener listener) {
IMessageListener currentListener = this.messageListeners.get(type);
if (currentListener != null) {
- logger.warn("{} is already listened by {}", type.toString(),
- currentListener.toString());
+ logger.warn("{} is already listened by {}", type,
+ currentListener);
}
this.messageListeners.put(type, listener);
}
this.messageListeners.put(type, listener);
- logger.debug("{} is now listened by {}", type.toString(),
- listener.toString());
+ logger.debug("{} is now listened by {}", type, listener);
}
@Override
public void removeMessageListener(OFType type, IMessageListener listener) {
IMessageListener currentListener = this.messageListeners.get(type);
if ((currentListener != null) && (currentListener == listener)) {
}
@Override
public void removeMessageListener(OFType type, IMessageListener listener) {
IMessageListener currentListener = this.messageListeners.get(type);
if ((currentListener != null) && (currentListener == listener)) {
- logger.debug("{} listener {} is Removed", type.toString(),
- listener.toString());
+ logger.debug("{} listener {} is Removed", type, listener);
this.messageListeners.remove(type);
}
}
this.messageListeners.remove(type);
}
}
public void addSwitchStateListener(ISwitchStateListener listener) {
if (this.switchStateListener != null) {
logger.warn("Switch events are already listened by {}",
public void addSwitchStateListener(ISwitchStateListener listener) {
if (this.switchStateListener != null) {
logger.warn("Switch events are already listened by {}",
- this.switchStateListener.toString());
+ this.switchStateListener);
}
this.switchStateListener = listener;
}
this.switchStateListener = listener;
- logger.debug("Switch events are now listened by {}",
- listener.toString());
+ logger.debug("Switch events are now listened by {}", listener);
}
@Override
public void removeSwitchStateListener(ISwitchStateListener listener) {
if ((this.switchStateListener != null)
&& (this.switchStateListener == listener)) {
}
@Override
public void removeSwitchStateListener(ISwitchStateListener listener) {
if ((this.switchStateListener != null)
&& (this.switchStateListener == listener)) {
- logger.debug("SwitchStateListener {} is Removed",
- listener.toString());
+ logger.debug("SwitchStateListener {} is Removed", listener);
this.switchStateListener = null;
}
}
this.switchStateListener = null;
}
}
if (((SwitchHandler) sw).isOperational()) {
Long sid = sw.getId();
if (this.switches.remove(sid, sw)) {
if (((SwitchHandler) sw).isOperational()) {
Long sid = sw.getId();
if (this.switches.remove(sid, sw)) {
- logger.warn("{} is Disconnected", sw.toString());
+ logger.warn("{} is Disconnected", sw);
notifySwitchDeleted(sw);
}
}
notifySwitchDeleted(sw);
}
}
this.clientSelectionKey = this.socket.register(this.selector,
SelectionKey.OP_WRITE, this);
}
this.clientSelectionKey = this.socket.register(this.selector,
SelectionKey.OP_WRITE, this);
}
- logger.trace("Message sent: {}", msg.toString());
+ logger.trace("Message sent: {}", msg);
SelectionKey.OP_READ, this);
}
SelectionKey.OP_READ, this);
}
- logger.trace("Message sent: {}", msg.toString());
+ logger.trace("Message sent: {}", msg);
- logger.debug("{} is down", toString());
+ logger.debug("{} is down", this);
// the connection is down, inform core
reportSwitchStateChange(false);
return;
}
for (OFMessage msg : msgs) {
// the connection is down, inform core
reportSwitchStateChange(false);
return;
}
for (OFMessage msg : msgs) {
- logger.trace("Message received: {}", msg.toString());
+ logger.trace("Message received: {}", msg);
this.lastMsgReceivedTimeStamp = System.currentTimeMillis();
OFType type = msg.getType();
switch (type) {
this.lastMsgReceivedTimeStamp = System.currentTimeMillis();
OFType type = msg.getType();
switch (type) {
// send a probe to see if the switch is still alive
logger.debug(
"Send idle probe (Echo Request) to {}",
// send a probe to see if the switch is still alive
logger.debug(
"Send idle probe (Echo Request) to {}",
probeSent = true;
OFMessage echo = factory
.getMessage(OFType.ECHO_REQUEST);
probeSent = true;
OFMessage echo = factory
.getMessage(OFType.ECHO_REQUEST);
|| e instanceof InterruptedException
|| e instanceof SocketException || e instanceof IOException
|| e instanceof ClosedSelectorException) {
|| e instanceof InterruptedException
|| e instanceof SocketException || e instanceof IOException
|| e instanceof ClosedSelectorException) {
- logger.debug("Caught exception {}", e.getMessage());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Caught exception {}", e.getMessage());
+ }
} else {
logger.warn("Caught exception ", e);
}
} else {
logger.warn("Caught exception ", e);
}
if (!transmitQ.isEmpty()) {
PriorityMessage pmsg = transmitQ.poll();
msgReadWriteService.asyncSend(pmsg.msg);
if (!transmitQ.isEmpty()) {
PriorityMessage pmsg = transmitQ.poll();
msgReadWriteService.asyncSend(pmsg.msg);
- logger.trace("Message sent: {}", pmsg.toString());
+ logger.trace("Message sent: {}", pmsg);
/*
* If syncReply is set to true, wait for the response
* back.
/*
* If syncReply is set to true, wait for the response
* back.
// if result is not null, this means the switch can't handle
// this message
// the result if OFError already
// if result is not null, this means the switch can't handle
// this message
// the result if OFError already
- logger.debug("Send {} failed --> {}", msg.getType().toString(),
- ((OFError) result).toString());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Send {} failed --> {}", msg.getType(),
+ ((OFError) result));
+ }
}
return result;
} catch (Exception e) {
}
return result;
} catch (Exception e) {
.get(GlobalConstants.DEFAULT.toString());
if (defaultOutService != null) {
defaultOutService.receiveDataPacket(dataPacket);
.get(GlobalConstants.DEFAULT.toString());
if (defaultOutService != null) {
defaultOutService.receiveDataPacket(dataPacket);
- logger.trace(
- "Dispatched to apps a frame of size: {} on container: {}: {}",
- new Object[] {
+ if (logger.isTraceEnabled()) {
+ logger.trace(
+ "Dispatched to apps a frame of size: {} on " +
+ "container: {}: {}", new Object[] {
ofPacket.getPacketData().length,
GlobalConstants.DEFAULT.toString(),
HexEncode.bytesToHexString(dataPacket
.getPacketData()) });
ofPacket.getPacketData().length,
GlobalConstants.DEFAULT.toString(),
HexEncode.bytesToHexString(dataPacket
.getPacketData()) });
}
// Now check the mapping between nodeConnector and
// Container and later on optimally filter based on
}
// Now check the mapping between nodeConnector and
// Container and later on optimally filter based on
if (s != null) {
// TODO add filtering on a per-flowSpec base
s.receiveDataPacket(dataPacket);
if (s != null) {
// TODO add filtering on a per-flowSpec base
s.receiveDataPacket(dataPacket);
- logger.trace(
- "Dispatched to apps a frame of size: {} on container: {}: {}",
- new Object[] {
+ if (logger.isTraceEnabled()) {
+ logger.trace(
+ "Dispatched to apps a frame of size: {}" +
+ " on container: {}: {}", new Object[] {
ofPacket.getPacketData().length,
ofPacket.getPacketData().length,
- GlobalConstants.DEFAULT.toString(),
- HexEncode
- .bytesToHexString(dataPacket
- .getPacketData()) });
-
+ container,
+ HexEncode.bytesToHexString(dataPacket
+ .getPacketData()) });
+ }
descriptionListeners = new HashSet<IStatisticsListener>();
configStatsPollIntervals();
descriptionListeners = new HashSet<IStatisticsListener>();
configStatsPollIntervals();
// Initialize managed timers
statisticsTimer = new Timer();
statisticsTimerTask = new TimerTask() {
// Initialize managed timers
statisticsTimer = new Timer();
statisticsTimerTask = new TimerTask() {
ByteBuffer data = ByteBuffer.allocate(length);
stat.writeTo(data);
data.rewind();
ByteBuffer data = ByteBuffer.allocate(length);
stat.writeTo(data);
data.rewind();
- log.trace("getV6ReplyStatistics: Buffer BYTES ARE {}",
- HexString.toHexString(data.array()));
+ if (log.isTraceEnabled()) {
+ log.trace("getV6ReplyStatistics: Buffer BYTES ARE {}",
+ HexString.toHexString(data.array()));
+ }
int vendor = data.getInt(); // first 4 bytes is vendor id.
if (vendor != V6StatsRequest.NICIRA_VENDOR_ID) {
int vendor = data.getInt(); // first 4 bytes is vendor id.
if (vendor != V6StatsRequest.NICIRA_VENDOR_ID) {
action.writeTo(data);
}
}
action.writeTo(data);
}
}
- logger.trace("{}", this.toString());
+ logger.trace("{}", this);
data.put(ipv6ext_dstport_msg);
}
}
data.put(ipv6ext_dstport_msg);
}
}
- logger.trace("{}", this.toString());
+ logger.trace("{}", this);
}
private void readInPort(ByteBuffer data, int nxmLen, boolean hasMask) {
}
private void readInPort(ByteBuffer data, int nxmLen, boolean hasMask) {
try {
path = mtp.getMaxThroughputPath(src, dst);
} catch (IllegalArgumentException ie) {
try {
path = mtp.getMaxThroughputPath(src, dst);
} catch (IllegalArgumentException ie) {
- log.debug("A vertex is yet not known between {} {}",
- src.toString(), dst.toString());
+ log.debug("A vertex is yet not known between {} {}", src, dst);
return null;
}
Path res;
try {
res = new Path(path);
} catch (ConstructionException e) {
return null;
}
Path res;
try {
res = new Path(path);
} catch (ConstructionException e) {
- log.debug("A vertex is yet not known between {} {}",
- src.toString(), dst.toString());
+ log.debug("A vertex is yet not known between {} {}", src, dst);
return null;
}
return res;
return null;
}
return res;
try {
path = spt.getPath(src, dst);
} catch (IllegalArgumentException ie) {
try {
path = spt.getPath(src, dst);
} catch (IllegalArgumentException ie) {
- log.debug("A vertex is yet not known between {} {}",
- src.toString(), dst.toString());
+ log.debug("A vertex is yet not known between {} {}", src, dst);
return null;
}
Path res;
try {
res = new Path(path);
} catch (ConstructionException e) {
return null;
}
Path res;
try {
res = new Path(path);
} catch (ConstructionException e) {
- log.debug("A vertex is yet not known between {} {}",
- src.toString(), dst.toString());
+ log.debug("A vertex is yet not known between {} {}", src, dst);
return null;
}
return res;
return null;
}
return res;
if (props != null)
props.remove(bw);
if (props != null)
props.remove(bw);
- log.debug("edgeUpdate: {} bw: {}", e.toString(), bw.getValue());
+ if (log.isDebugEnabled()) {
+ log.debug("edgeUpdate: {} bw: {}", e, bw.getValue());
+ }
Short baseBW = Short.valueOf((short) 0);
boolean add = (type == UpdateType.ADDED) ? true : false;
Short baseBW = Short.valueOf((short) 0);
boolean add = (type == UpdateType.ADDED) ? true : false;
int lldpOffset = bitOffset; // LLDP start
int lldpSize = size; // LLDP size
int lldpOffset = bitOffset; // LLDP start
int lldpSize = size; // LLDP size
- logger.trace("LLDP: {} (offset {} bitsize {})", new Object[] {
- HexEncode.bytesToHexString(data), lldpOffset, lldpSize });
+ if (logger.isTraceEnabled()) {
+ logger.trace("LLDP: {} (offset {} bitsize {})", new Object[] {
+ HexEncode.bytesToHexString(data), lldpOffset, lldpSize });
+ }
/*
* Deserialize the TLVs until we reach the end of the packet
*/
/*
* Deserialize the TLVs until we reach the end of the packet
*/
throw new PacketException(e.getMessage());
}
throw new PacketException(e.getMessage());
}
- logger.trace("LLDP: serialized: {}",
- HexEncode.bytesToHexString(serializedBytes));
+ if (logger.isTraceEnabled()) {
+ logger.trace("LLDP: serialized: {}",
+ HexEncode.bytesToHexString(serializedBytes));
+ }
return serializedBytes;
}
return serializedBytes;
}
* Store the raw read value, checks the payload type and set the
* payloadClass accordingly
*/
* Store the raw read value, checks the payload type and set the
* payloadClass accordingly
*/
- logger.trace("{}: {}: {} (offset {} bitsize {})",
- new Object[] { this.getClass().getSimpleName(), hdrField,
- HexEncode.bytesToHexString(hdrFieldBytes),
- startOffset, numBits });
+ if (logger.isTraceEnabled()) {
+ logger.trace("{}: {}: {} (offset {} bitsize {})",
+ new Object[] { this.getClass().getSimpleName(), hdrField,
+ HexEncode.bytesToHexString(hdrFieldBytes),
+ startOffset, numBits });
+ }
this.setHeaderField(hdrField, hdrFieldBytes);
}
this.setHeaderField(hdrField, hdrFieldBytes);
}
}
postSerializeCustomOperation(headerBytes);
}
postSerializeCustomOperation(headerBytes);
- logger.trace("{}: {}", this.getClass().getSimpleName(),
- HexEncode.bytesToHexString(headerBytes));
+ if (logger.isTraceEnabled()) {
+ logger.trace("{}: {}", this.getClass().getSimpleName(),
+ HexEncode.bytesToHexString(headerBytes));
+ }
//short tag = container.getTag((Long)nextNode.getNodeID());
short tag = 0;
if (tag != 0) {
//short tag = container.getTag((Long)nextNode.getNodeID());
short tag = 0;
if (tag != 0) {
- log.debug("adding SET_VLAN " + tag
- + " for traffic leaving " + currNode + "/"
- + outPort + "toward switch " + nextNode);
+ log.debug("adding SET_VLAN {} for traffic " +
+ "leaving {}/{} toward switch {}",
+ new Object[] { tag, currNode, outPort,
+ nextNode});
actions.add(new SetVlanId(tag));
} else {
actions.add(new SetVlanId(tag));
} else {
- log.debug("No tag assigned to switch " + nextNode);
+ log.debug("No tag assigned to switch {}", nextNode);
//short tag = container.getTag((Long)currNode.getNodeID());
short tag = 0;
if (tag != 0) {
//short tag = container.getTag((Long)currNode.getNodeID());
short tag = 0;
if (tag != 0) {
- log.debug("adding MATCH VLAN " + tag
- + " for traffic entering " + currNode + "/"
- + inPort);
+ log.debug("adding MATCH VLAN {} for traffic entering" +
+ " {}/{}",
+ new Object[] {tag, currNode, inPort});
match.setField(MatchType.DL_VLAN, tag);
} else {
match.setField(MatchType.DL_VLAN, tag);
} else {
- log.debug("No tag assigned to switch " + currNode);
+ log.debug("No tag assigned to switch {}", currNode);
pos.put(inPort, po);
this.rulesDB.put(key, pos);
if (!inPort.getType().equals(NodeConnectorIDType.ALL)) {
pos.put(inPort, po);
this.rulesDB.put(key, pos);
if (!inPort.getType().equals(NodeConnectorIDType.ALL)) {
- log.debug("Adding Match(inPort=" + inPort + ",DIP="
- + host.getNetworkAddress().getHostAddress()
- + ") Action(outPort=" + outPort + ") to node "
- + currNode);
+ log.debug("Adding Match(inPort = {} , DIP = {})" +
+ " Action(outPort= {}) to node {}",
+ new Object[] { inPort,
+ host.getNetworkAddress().getHostAddress(),
+ outPort, currNode});
if ((removed_po != null)
&& (!po.getFlow().getMatch().equals(
removed_po.getFlow().getMatch()))) {
if ((removed_po != null)
&& (!po.getFlow().getMatch().equals(
removed_po.getFlow().getMatch()))) {
- log.debug("Adding policy Match(DIP="
- + host.getNetworkAddress().getHostAddress()
- + ") Action(outPort=" + outPort + ") to node "
- + currNode);
+ log.debug("Adding policyMatch(DIP = {}) Action(outPort= {}) " +
+ "to node {}", new Object[] {
+ host.getNetworkAddress().getHostAddress(), outPort,
+ currNode});
if ((res == null) || ((links = res.getEdges()) == null)) {
// Still the path that connect node to rootNode
// doesn't exists
if ((res == null) || ((links = res.getEdges()) == null)) {
// Still the path that connect node to rootNode
// doesn't exists
- log.debug("NO Route/Path between SW[" + node + "] --> SW["
- + rootNode + "] cleaning potentially existing entries");
+ log.debug("NO Route/Path between SW[{}] --> SW[{}] cleaning " +
+ "potentially existing entries", node, rootNode);
key = new HostNodePair(host, node);
pos = this.rulesDB.get(key);
if (pos != null) {
key = new HostNodePair(host, node);
pos = this.rulesDB.get(key);
if (pos != null) {
- log.debug("Route between SW[" + node + "] --> SW[" + rootNode
- + "]");
+ log.debug("Route between SW[{}] --> SW[{}]", node, rootNode);
Integer curr;
Node currNode = node;
key = new HostNodePair(host, currNode);
Integer curr;
Node currNode = node;
key = new HostNodePair(host, currNode);
if ((res == null) || ((links = res.getEdges()) == null)) {
// Still the path that connect node to rootNode
// doesn't exists
if ((res == null) || ((links = res.getEdges()) == null)) {
// Still the path that connect node to rootNode
// doesn't exists
- log.debug("NO Route/Path between SW[" + node + "] --> SW["
- + rootNode + "] cleaning potentially existing entries");
+ log.debug("NO Route/Path between SW[{}] --> SW[{}] cleaning " +
+ "potentially existing entries", node, rootNode);
key = new HostNodePair(host, node);
pos = this.rulesDB.get(key);
if (pos != null) {
key = new HostNodePair(host, node);
pos = this.rulesDB.get(key);
if (pos != null) {
- log.debug("Route between SW[" + node + "] --> SW[" + rootNode + "]");
+ log.debug("Route between SW[{}] --> SW[{}]", node, rootNode);
Integer curr;
Node currNode = node;
key = new HostNodePair(host, currNode);
Integer curr;
Node currNode = node;
key = new HostNodePair(host, currNode);
- log.debug("Link [" + currNode + "/" + link.getHeadNodeConnector()
- + "] --> ["
- + link.getHeadNodeConnector().getNode() + "/"
- + link.getTailNodeConnector() + "]");
+ log.debug("Link [{}/{}] --> [{}/{}]", new Object[] {
+ currNode, link.getHeadNodeConnector(),
+ link.getHeadNodeConnector().getNode(),
+ link.getTailNodeConnector()});
// Index all the switches to be programmed
switchesToProgram.add(currNode);
// Index all the switches to be programmed
switchesToProgram.add(currNode);
+ po.toString() + " on switch " + swId);
}
} else {
+ po.toString() + " on switch " + swId);
}
} else {
- log.error("Cannot find a policy for SW:{" + swId
- + "} Host: {" + host + "}");
+ log.error("Cannot find a policy for SW:({}) Host: ({})",
+ swId, host);
/* // Now dump every single rule */
/* for (HostNodePair dumpkey : this.rulesDB.keySet()) { */
/* po = this.rulesDB.get(dumpkey); */
/* // Now dump every single rule */
/* for (HostNodePair dumpkey : this.rulesDB.keySet()) { */
/* po = this.rulesDB.get(dumpkey); */
for (HostNodePair key : this.rulesDB.keySet()) {
Node node = key.getNode();
if (targetNode == null || node.equals(targetNode)) {
for (HostNodePair key : this.rulesDB.keySet()) {
Node node = key.getNode();
if (targetNode == null || node.equals(targetNode)) {
- log.debug("Work on " + node + " host " + key.getHost());
+ log.debug("Work on {} host {}", node, key.getHost());
pos = this.rulesDB.get(key);
for (Map.Entry<NodeConnector, FlowEntry> e : pos.entrySet()) {
po = e.getValue();
pos = this.rulesDB.get(key);
for (Map.Entry<NodeConnector, FlowEntry> e : pos.entrySet()) {
po = e.getValue();
this.frm.uninstallFlowEntry(po);
}
}
this.frm.uninstallFlowEntry(po);
}
}
- log.debug("Remove " + key);
+ log.debug("Remove {}", key);
this.rulesDB.remove(key);
}
}
this.rulesDB.remove(key);
}
}
}
pl.add(po);
log.debug("Adding Pruned Policy for SwId: {}", swId);
}
pl.add(po);
log.debug("Adding Pruned Policy for SwId: {}", swId);
- log.debug("Old Policy: " + po.toString());
- log.debug("New Policy: " + new_po.toString());
+ log.debug("Old Policy: {}", po);
+ log.debug("New Policy: {}", new_po);
}
private void pruneExcessRules(Set<Node> switches) {
}
private void pruneExcessRules(Set<Node> switches) {
switch (type) {
case REMOVED:
switch (type) {
case REMOVED:
- log.debug("Node " + node + " gone, doing a cleanup");
+ log.debug("Node {} gone, doing a cleanup", node);
uninstallPerNodeRules(node);
break;
default:
uninstallPerNodeRules(node);
break;
default: