Skip to content
Snippets Groups Projects
Commit 06a3a116 authored by meiyangbigswitch's avatar meiyangbigswitch
Browse files

minor changes

parent a18e3486
No related branches found
No related tags found
No related merge requests found
......@@ -211,9 +211,6 @@ public interface IDeviceService extends IFloodlightService {
public void removeSuppressAPs(long swId, short port);
public IDevice findDeviceByMac(long macAddress)
throws IllegalArgumentException;
public Set<SwitchPort> getSuppressAPs();
}
......@@ -485,26 +485,6 @@ IFlowReconcileListener, IInfoProvider {
return findDeviceByEntity(e);
}
@Override
public IDevice findDeviceByMac(long macAddress)
throws IllegalArgumentException {
Entity entity = new Entity(macAddress, null, null, null,
null, null);
Long deviceKey = null;
IEntityClass entityClass = null;
entityClass = entityClassifier.classifyEntity(entity);
if (entityClass == null) {
return null;
}
ClassState classState = getClassState(entityClass);
if (classState.classIndex != null) {
deviceKey =
classState.classIndex.findByEntity(entity);
}
if (deviceKey == null) return null;
return deviceMap.get(deviceKey);
}
@Override
public IDevice findClassDevice(IEntityClass entityClass, long macAddress,
Short vlan, Integer ipv4Address)
......
......@@ -74,13 +74,13 @@ public class FlowReconcileManager
String controllerPktInCounterName;
protected SimpleCounter lastPacketInCounter;
protected static int MAX_SYSTEM_LOAD_PER_SECOND = 10000;
protected final static int MAX_SYSTEM_LOAD_PER_SECOND = 10000;
/** a minimum flow reconcile rate so that it won't stave */
protected static int MIN_FLOW_RECONCILE_PER_SECOND = 200;
protected final static int MIN_FLOW_RECONCILE_PER_SECOND = 200;
/** start flow reconcile in 10ms after a new reconcile request is received.
* The max delay is 1 second. */
protected static int FLOW_RECONCILE_DELAY_MILLISEC = 10;
protected final static int FLOW_RECONCILE_DELAY_MILLISEC = 10;
protected Date lastReconcileTime;
/** Config to enable or disable flowReconcile */
......
......@@ -16,6 +16,8 @@
package net.floodlightcontroller.flowcache;
import java.util.Arrays;
import net.floodlightcontroller.devicemanager.IDevice;
import net.floodlightcontroller.devicemanager.SwitchPort;
......@@ -34,7 +36,7 @@ public class FlowReconcileQueryDeviceMove extends FlowReconcileQuery {
public FlowReconcileQueryDeviceMove(IDevice deviceMoved, SwitchPort[] oldAp) {
this();
this.deviceMoved = deviceMoved;
this.oldAp = oldAp;
this.oldAp = oldAp.clone();
}
@Override
......@@ -59,7 +61,7 @@ public class FlowReconcileQueryDeviceMove extends FlowReconcileQuery {
FlowReconcileQueryDeviceMove other = (FlowReconcileQueryDeviceMove) obj;
if (oldAp == null) {
if (other.oldAp != null) return false;
} else if (!oldAp.equals(other.oldAp)) return false;
} else if (!Arrays.equals(oldAp, other.oldAp)) return false;
if (deviceMoved == null) {
if (other.deviceMoved != null) return false;
} else if (!deviceMoved.equals(other.deviceMoved)) return false;
......
......@@ -136,13 +136,20 @@ public class PriorityPendingQueue<E> {
return first;
}
private void insert(E e, EventPriority p) {
if (p==EventPriority.HIGH)
highPriorityQueue.offer(e);
if (p==EventPriority.MEDIUM)
mediumPriorityQueue.offer(e);
if (p==EventPriority.LOW)
lowPriorityQueue.offer(e);
private boolean insert(E e, EventPriority p) {
boolean result = false;
switch (p) {
case HIGH:
result = highPriorityQueue.offer(e);
break;
case MEDIUM:
result = mediumPriorityQueue.offer(e);
break;
case LOW:
result = lowPriorityQueue.offer(e);
break;
}
return result;
}
private void signalNotFull() {
......
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