本文整理汇总了Java中net.floodlightcontroller.flowcache.OFMatchReconcile类的典型用法代码示例。如果您正苦于以下问题:Java OFMatchReconcile类的具体用法?Java OFMatchReconcile怎么用?Java OFMatchReconcile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OFMatchReconcile类属于net.floodlightcontroller.flowcache包,在下文中一共展示了OFMatchReconcile类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import net.floodlightcontroller.flowcache.OFMatchReconcile; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class);
threadPoolService = context.getServiceImpl(IThreadPoolService.class);
debugCounterService = context.getServiceImpl(IDebugCounterService.class);
flowQueue = new PriorityPendingQueue<OFMatchReconcile>();
flowReconcileListeners = new ListenerDispatcher<OFType, IFlowReconcileListener>();
Map<String, String> configParam = context.getConfigParams(this);
String enableValue = configParam.get(EnableConfigKey);
registerFlowReconcileManagerDebugCounters();
// Set flowReconcile default to true
flowReconcileEnabled = true;
if (enableValue != null &&
enableValue.equalsIgnoreCase("false")) {
flowReconcileEnabled = false;
}
flowReconcileThreadRunCount = new AtomicInteger(0);
lastReconcileTime = new Date(0);
logger.debug("FlowReconcile is {}", flowReconcileEnabled);
}
示例2: reconcileFlows
import net.floodlightcontroller.flowcache.OFMatchReconcile; //导入依赖的package包/类
@Override
public Command reconcileFlows(ArrayList<OFMatchReconcile> ofmRcList) {
ListIterator<OFMatchReconcile> iter = ofmRcList.listIterator();
while (iter.hasNext()) {
OFMatchReconcile ofm = iter.next();
// Remove the STOPPed flow.
if (Command.STOP == reconcileFlow(ofm)) {
iter.remove();
}
}
if (ofmRcList.size() > 0) {
return Command.CONTINUE;
} else {
return Command.STOP;
}
}
示例3: init
import net.floodlightcontroller.flowcache.OFMatchReconcile; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
threadPool = context.getServiceImpl(IThreadPoolService.class);
counterStore = context.getServiceImpl(ICounterStoreService.class);
debugCounters = context.getServiceImpl(IDebugCounterService.class);
flowQueue = new PriorityPendingQueue<OFMatchReconcile>();
flowReconcileListeners =
new ListenerDispatcher<OFType, IFlowReconcileListener>();
Map<String, String> configParam = context.getConfigParams(this);
String enableValue = configParam.get(EnableConfigKey);
registerFlowReconcileManagerDebugCounters();
// Set flowReconcile default to true
flowReconcileEnabled = true;
if (enableValue != null &&
enableValue.equalsIgnoreCase("false")) {
flowReconcileEnabled = false;
}
flowReconcileThreadRunCount = new AtomicInteger(0);
lastReconcileTime = new Date(0);
logger.debug("FlowReconcile is {}", flowReconcileEnabled);
}
示例4: reconcileFlows
import net.floodlightcontroller.flowcache.OFMatchReconcile; //导入依赖的package包/类
@Override
public Command reconcileFlows(ArrayList<OFMatchReconcile> ofmRcList) {
ListIterator<OFMatchReconcile> iter = ofmRcList.listIterator();
while (iter.hasNext()) {
OFMatchReconcile ofm = iter.next();
// Remove the STOPPed flow.
if (Command.STOP == reconcileFlow(ofm)) {
iter.remove();
}
}
if (ofmRcList.size() > 0) {
return Command.CONTINUE;
} else {
return Command.STOP;
}
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:19,代码来源:DeviceManagerImpl.java
示例5: init
import net.floodlightcontroller.flowcache.OFMatchReconcile; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
threadPool = context.getServiceImpl(IThreadPoolService.class);
counterStore = context.getServiceImpl(ICounterStoreService.class);
flowQueue = new ConcurrentLinkedQueue<OFMatchReconcile>();
flowReconcileListeners =
new ListenerDispatcher<OFType, IFlowReconcileListener>();
Map<String, String> configParam = context.getConfigParams(this);
String enableValue = configParam.get(EnableConfigKey);
// Set flowReconcile default to true
flowReconcileEnabled = true;
if (enableValue != null &&
enableValue.equalsIgnoreCase("false")) {
flowReconcileEnabled = false;
}
flowReconcileThreadRunCount = 0;
lastReconcileTime = new Date(0);
logger.debug("FlowReconcile is {}", flowReconcileEnabled);
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:24,代码来源:FlowReconcileManager.java
示例6: init
import net.floodlightcontroller.flowcache.OFMatchReconcile; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
threadPool = context.getServiceImpl(IThreadPoolService.class);
counterStore = context.getServiceImpl(ICounterStoreService.class);
flowQueue = new ConcurrentLinkedQueue<OFMatchReconcile>();
flowReconcileListeners =
new ListenerDispatcher<OFType, IFlowReconcileListener>();
Map<String, String> configParam = context.getConfigParams(this);
String enableValue = configParam.get(EnableConfigKey);
// Set flowReconcile default to true
flowReconcileEnabled = true;
if (enableValue != null &&
enableValue.equalsIgnoreCase("false")) {
flowReconcileEnabled = false;
}
flowReconcileThreadRunCount = new AtomicInteger(0);
lastReconcileTime = new Date(0);
logger.debug("FlowReconcile is {}", flowReconcileEnabled);
}
示例7: topologyChanged
import net.floodlightcontroller.flowcache.OFMatchReconcile; //导入依赖的package包/类
@Override
public void topologyChanged(List<LDUpdate> appliedUpdates) {
for (LDUpdate ldu : appliedUpdates) {
if (ldu.getOperation()
.equals(ILinkDiscovery.UpdateOperation.PORT_DOWN)) {
// Get the switch ID for the OFMatchWithSwDpid object
IOFSwitch affectedSwitch = switchService.getSwitch(ldu.getSrc());
// Create an OFMatchReconcile object
OFMatchReconcile ofmr = new OFMatchReconcile();
// Generate an OFMatch objects for the OFMatchWithSwDpid object
Match match = affectedSwitch.getOFFactory().buildMatch().build(); // nothing specific set, so all wildcarded
// Generate the OFMatchWithSwDpid
OFMatchWithSwDpid ofmatchsw = new OFMatchWithSwDpid(match, affectedSwitch.getId());
// Set the action to update the path to remove flows routing
// towards the downed port
ofmr.rcAction = OFMatchReconcile.ReconcileAction.UPDATE_PATH;
// Set the match, with the switch dpid
ofmr.ofmWithSwDpid = ofmatchsw;
// Assign the downed port to the OFMatchReconcile's outPort data
// member (I added this to
// the OFMatchReconcile class)
ofmr.outPort = ldu.getSrcPort();
// Tell the reconcile manager to reconcile matching flows
frm.reconcileFlow(ofmr, EventPriority.HIGH);
}
}
}
示例8: reconcileFlow
import net.floodlightcontroller.flowcache.OFMatchReconcile; //导入依赖的package包/类
/**
* Add to-be-reconciled flow to the queue.
*
* @param ofmRcIn the ofm rc in
*/
@Override
public void reconcileFlow(OFMatchReconcile ofmRcIn, EventPriority priority) {
if (ofmRcIn == null) return;
// Make a copy before putting on the queue.
OFMatchReconcile myOfmRc = new OFMatchReconcile(ofmRcIn);
flowQueue.offer(myOfmRc, priority);
ctrFlowReconcileRequest.increment();
Date currTime = new Date();
long delay = 0;
/** schedule reconcile task immidiately if it has been more than 1 sec
* since the last run. Otherwise, schedule the reconcile task in
* DELAY_MILLISEC.
*/
if (currTime.after(new Date(lastReconcileTime.getTime() + 1000))) {
delay = 0;
} else {
delay = FLOW_RECONCILE_DELAY_MILLISEC;
}
flowReconcileTask.reschedule(delay, TimeUnit.MILLISECONDS);
if (logger.isTraceEnabled()) {
logger.trace("Reconciling flow: {}, total: {}",
myOfmRc.toString(), flowQueue.size());
}
}