Skip to content
Snippets Groups Projects
Commit b41147e4 authored by Rob Adams's avatar Rob Adams
Browse files

Merge branch 'master' of github.com:bigswitch/bigswitchcontroller into bigsync

Conflicts:
	bigfloodlight/src/test/java/com/bigswitch/floodlight/tunnelmanager/TunnelManagerTest.java
parents 1ec0c00c 06cb326f
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,6 @@ package net.floodlightcontroller.core; ...@@ -20,7 +20,6 @@ package net.floodlightcontroller.core;
import java.io.IOException; import java.io.IOException;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.util.Collection; import java.util.Collection;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.Future; import java.util.concurrent.Future;
...@@ -293,7 +292,7 @@ public interface IOFSwitch { ...@@ -293,7 +292,7 @@ public interface IOFSwitch {
* Retrieves the date the switch connected to this controller * Retrieves the date the switch connected to this controller
* @return the date * @return the date
*/ */
public Date getConnectedSince(); public String getConnectedSince();
/** /**
* Returns the next available transaction id * Returns the next available transaction id
......
...@@ -72,7 +72,7 @@ import org.slf4j.LoggerFactory; ...@@ -72,7 +72,7 @@ import org.slf4j.LoggerFactory;
public abstract class OFSwitchBase implements IOFSwitch { public abstract class OFSwitchBase implements IOFSwitch {
// TODO: should we really do logging in the class or should we throw // TODO: should we really do logging in the class or should we throw
// exception that can then be handled by callers? // exception that can then be handled by callers?
protected static Logger log = LoggerFactory.getLogger(OFSwitchBase.class); protected static final Logger log = LoggerFactory.getLogger(OFSwitchBase.class);
protected ConcurrentMap<Object, Object> attributes; protected ConcurrentMap<Object, Object> attributes;
protected IFloodlightProviderService floodlightProvider; protected IFloodlightProviderService floodlightProvider;
...@@ -144,8 +144,8 @@ public abstract class OFSwitchBase implements IOFSwitch { ...@@ -144,8 +144,8 @@ public abstract class OFSwitchBase implements IOFSwitch {
// Defaults properties for an ideal switch // Defaults properties for an ideal switch
this.setAttribute(PROP_FASTWILDCARDS, OFMatch.OFPFW_ALL); this.setAttribute(PROP_FASTWILDCARDS, OFMatch.OFPFW_ALL);
this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, new Boolean(true)); this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.valueOf(true));
this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, new Boolean(true)); this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.valueOf(true));
} }
...@@ -187,8 +187,15 @@ public abstract class OFSwitchBase implements IOFSwitch { ...@@ -187,8 +187,15 @@ public abstract class OFSwitchBase implements IOFSwitch {
} }
// For driver subclass to set throttling // For driver subclass to set throttling
@LogMessageDoc(level="INFO",
message="Enabled write throttling to {switch}",
explanation="OFMessage writes to switch is throttled " +
"to prevent excessively long queues")
protected void enableWriteThrottle(boolean enable) { protected void enableWriteThrottle(boolean enable) {
this.writeThrottleEnabled = enable; this.writeThrottleEnabled = enable;
if (enable) {
log.info("Enabled write throttling to {}", this);
}
} }
@Override @Override
...@@ -433,8 +440,8 @@ public abstract class OFSwitchBase implements IOFSwitch { ...@@ -433,8 +440,8 @@ public abstract class OFSwitchBase implements IOFSwitch {
} }
@Override @Override
public Date getConnectedSince() { public String getConnectedSince() {
return connectedSince; return connectedSince.toString();
} }
@JsonIgnore @JsonIgnore
......
...@@ -31,6 +31,7 @@ import java.util.HashMap; ...@@ -31,6 +31,7 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
...@@ -62,6 +63,7 @@ import net.floodlightcontroller.core.RoleInfo; ...@@ -62,6 +63,7 @@ import net.floodlightcontroller.core.RoleInfo;
import net.floodlightcontroller.core.annotations.LogMessageDoc; import net.floodlightcontroller.core.annotations.LogMessageDoc;
import net.floodlightcontroller.core.annotations.LogMessageDocs; import net.floodlightcontroller.core.annotations.LogMessageDocs;
import net.floodlightcontroller.core.internal.OFChannelState.HandshakeState; import net.floodlightcontroller.core.internal.OFChannelState.HandshakeState;
import net.floodlightcontroller.core.internal.RoleChanger.PendingRoleRequestEntry;
import net.floodlightcontroller.core.util.ListenerDispatcher; import net.floodlightcontroller.core.util.ListenerDispatcher;
import net.floodlightcontroller.core.util.SingletonTask; import net.floodlightcontroller.core.util.SingletonTask;
import net.floodlightcontroller.core.web.CoreWebRoutable; import net.floodlightcontroller.core.web.CoreWebRoutable;
...@@ -1017,7 +1019,9 @@ public class Controller implements IFloodlightProviderService, ...@@ -1017,7 +1019,9 @@ public class Controller implements IFloodlightProviderService,
// the master to someone else. // the master to someone else.
// Only send if there are no pending requests. // Only send if there are no pending requests.
synchronized(roleChanger) { synchronized(roleChanger) {
if (roleChanger.pendingRequestMap.get(sw) == null) { LinkedList<PendingRoleRequestEntry> list =
roleChanger.pendingRequestMap.get(sw);
if (list == null || list.isEmpty()) {
log.info("Tell switch {} who is the master", sw); log.info("Tell switch {} who is the master", sw);
roleChanger.submitRequest(Collections.singleton(sw), role); roleChanger.submitRequest(Collections.singleton(sw), role);
} }
......
...@@ -21,7 +21,6 @@ import java.io.IOException; ...@@ -21,7 +21,6 @@ import java.io.IOException;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.util.Collection; import java.util.Collection;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.Future; import java.util.concurrent.Future;
...@@ -228,7 +227,7 @@ public class OFMessageDamperMockSwitch implements IOFSwitch { ...@@ -228,7 +227,7 @@ public class OFMessageDamperMockSwitch implements IOFSwitch {
} }
@Override @Override
public Date getConnectedSince() { public String getConnectedSince() {
assertTrue("Unexpected method call", false); assertTrue("Unexpected method call", false);
return null; return null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment