Package net.floodlightcontroller.flowcache

Examples of net.floodlightcontroller.flowcache.OFMatchReconcile


                // Get the switch ID for the OFMatchWithSwDpid object
                long affectedSwitch = floodlightProvider.getSwitch(ldu.getSrc())
                                                        .getId();

                // Create an OFMatchReconcile object
                OFMatchReconcile ofmr = new OFMatchReconcile();

                // Generate an OFMatch objects for the OFMatchWithSwDpid object
                OFMatch match = new OFMatch().setWildcards(OFMatch.OFPFW_ALL);

                // Generate the OFMatchWithSwDpid
View Full Code Here


    @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.updateCounterWithFlush();

        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());
        }
    }
View Full Code Here

        int reconcileCapacity = getCurrentCapacity();
        if (logger.isTraceEnabled()) {
            logger.trace("Reconcile capacity {} flows", reconcileCapacity);
        }
        while (!flowQueue.isEmpty() && reconcileCapacity > 0) {
            OFMatchReconcile ofmRc = flowQueue.poll();
            reconcileCapacity--;
            if (ofmRc != null) {
                ofmRcList.add(ofmRc);
                ctrReconciledFlows.updateCounterWithFlush();
                if (logger.isTraceEnabled()) {
View Full Code Here

    // ***************
    @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();
            }
View Full Code Here

        flowReconcileMgr.addFlowReconcileListener(r3);
       
        int pre_flowReconcileThreadRunCount =
                flowReconcileMgr.flowReconcileThreadRunCount.get();
        Date startTime = new Date();
        OFMatchReconcile ofmRcIn = new OFMatchReconcile();
        try {
            flowReconcileMgr.reconcileFlow(ofmRcIn,EventPriority.HIGH);
            flowReconcileMgr.doReconcile();
        } catch (RuntimeException e) {
            assertEquals(e.getMessage()
View Full Code Here

                    (ArrayList<OFMatchReconcile>)EasyMock.
                        getCurrentArguments()[0];
                ListIterator<OFMatchReconcile> lit = ofmList.listIterator();
                int index = 0;
                while (lit.hasNext()) {
                    OFMatchReconcile ofm = lit.next();
                    assertEquals(index++, ofm.cookie);
                }
                return Command.STOP;
            }
        }).times(1);
       
        SimpleCounter cnt = (SimpleCounter)SimpleCounter.createCounter(
                            new Date(),
                            CounterType.LONG);
        cnt.increment();
        expect(counterStore.getCounter(
                flowReconcileMgr.controllerPktInCounterName))
                .andReturn(cnt)
                .anyTimes();
       
        replay(r1, counterStore);
        flowReconcileMgr.clearFlowReconcileListeners();
        flowReconcileMgr.addFlowReconcileListener(r1);
       
        OFMatchReconcile ofmRcIn = new OFMatchReconcile();
        int index = 0;
        for (index = 0; index < 10; index++) {
            ofmRcIn.cookie = index;
            flowReconcileMgr.reconcileFlow(ofmRcIn,EventPriority.HIGH);
        }
View Full Code Here

    }
   
    private class FlowReconcileWorker implements Runnable {
    @Override
        public void run() {
            OFMatchReconcile ofmRc = new OFMatchReconcile();
            // push large number of flows to be reconciled.
            for (int i = 0; i < NUM_FLOWS_PER_THREAD; i++) {
                flowReconcileMgr.reconcileFlow(ofmRc,EventPriority.LOW);
            }
        }
View Full Code Here

        // Here we create the OFMatch Reconcile list we wish to pass
        lofmr = new ArrayList<OFMatchReconcile>();

        // Create the only OFMatch Reconcile object that will be in the list
        ofmr = new OFMatchReconcile();
        long affectedSwitch = sw1.getId();
        OFMatchWithSwDpid ofmatchsw = new OFMatchWithSwDpid(new OFMatch().setWildcards(OFMatch.OFPFW_ALL),
                                                            affectedSwitch);
        ofmr.rcAction = OFMatchReconcile.ReconcileAction.UPDATE_PATH;
        ofmr.ofmWithSwDpid = ofmatchsw;
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.flowcache.OFMatchReconcile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.