Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
e9b5dc2c
Commit
e9b5dc2c
authored
11 years ago
by
abat
Browse files
Options
Downloads
Plain Diff
Merge into master from pull request #3677:
BVS-530 (
https://github.com/bigswitch/bigswitchcontroller/pull/3677
)
parents
8f3d31d6
b2a199c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/flowcache/FlowReconcileManager.java
+35
-3
35 additions, 3 deletions
.../floodlightcontroller/flowcache/FlowReconcileManager.java
with
35 additions
and
3 deletions
src/main/java/net/floodlightcontroller/flowcache/FlowReconcileManager.java
+
35
−
3
View file @
e9b5dc2c
...
...
@@ -36,6 +36,11 @@ import net.floodlightcontroller.counter.CounterStore;
import
net.floodlightcontroller.counter.ICounter
;
import
net.floodlightcontroller.counter.ICounterStoreService
;
import
net.floodlightcontroller.counter.SimpleCounter
;
import
net.floodlightcontroller.debugcounter.IDebugCounter
;
import
net.floodlightcontroller.debugcounter.IDebugCounterService
;
import
net.floodlightcontroller.debugcounter.NullDebugCounter
;
import
net.floodlightcontroller.debugcounter.IDebugCounterService.CounterException
;
import
net.floodlightcontroller.debugcounter.IDebugCounterService.CounterType
;
import
net.floodlightcontroller.flowcache.IFlowReconcileListener
;
import
net.floodlightcontroller.flowcache.OFMatchReconcile
;
import
net.floodlightcontroller.flowcache.PriorityPendingQueue.EventPriority
;
...
...
@@ -55,7 +60,7 @@ public class FlowReconcileManager
/** Reference to dependent modules */
protected
IThreadPoolService
threadPool
;
protected
ICounterStoreService
counterStore
;
protected
IDebugCounterService
debugCounters
;
/**
* The list of flow reconcile listeners that have registered to get
* flow reconcile callbacks. Such callbacks are invoked, for example, when
...
...
@@ -85,6 +90,13 @@ public class FlowReconcileManager
/** Config to enable or disable flowReconcile */
protected
static
final
String
EnableConfigKey
=
"enable"
;
/*
* Debug Counters
*/
public
static
final
String
PACKAGE
=
FlowReconcileManager
.
class
.
getPackage
().
getName
();
private
IDebugCounter
ctrFlowReconcileRequest
;
private
IDebugCounter
ctrReconciledFlows
;
protected
boolean
flowReconcileEnabled
;
public
AtomicInteger
flowReconcileThreadRunCount
;
...
...
@@ -130,6 +142,7 @@ public class FlowReconcileManager
OFMatchReconcile
myOfmRc
=
new
OFMatchReconcile
(
ofmRcIn
);
flowQueue
.
offer
(
myOfmRc
,
priority
);
ctrFlowReconcileRequest
.
updateCounterWithFlush
();
Date
currTime
=
new
Date
();
long
delay
=
0
;
...
...
@@ -187,7 +200,7 @@ public class FlowReconcileManager
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
>();
...
...
@@ -200,12 +213,30 @@ public class FlowReconcileManager
enableValue
.
equalsIgnoreCase
(
"false"
))
{
flowReconcileEnabled
=
false
;
}
registerFlowReconcileManagerDebugCounters
();
flowReconcileThreadRunCount
=
new
AtomicInteger
(
0
);
lastReconcileTime
=
new
Date
(
0
);
logger
.
debug
(
"FlowReconcile is {}"
,
flowReconcileEnabled
);
}
private
void
registerFlowReconcileManagerDebugCounters
()
throws
FloodlightModuleException
{
if
(
debugCounters
==
null
)
{
logger
.
error
(
"Debug Counter Service not found."
);
debugCounters
=
new
NullDebugCounter
();
}
try
{
ctrFlowReconcileRequest
=
debugCounters
.
registerCounter
(
PACKAGE
,
"flow-reconcile-request"
,
"All flow reconcile request received by this module"
,
CounterType
.
ALWAYS_COUNT
);
ctrReconciledFlows
=
debugCounters
.
registerCounter
(
PACKAGE
,
"reconciled-flows"
,
"All flows reconciled successfully by this module"
,
CounterType
.
ALWAYS_COUNT
);
}
catch
(
CounterException
e
)
{
throw
new
FloodlightModuleException
(
e
.
getMessage
());
}
}
@Override
public
void
startUp
(
FloodlightModuleContext
context
)
{
// thread to do flow reconcile
...
...
@@ -264,6 +295,7 @@ public class FlowReconcileManager
reconcileCapacity
--;
if
(
ofmRc
!=
null
)
{
ofmRcList
.
add
(
ofmRc
);
ctrReconciledFlows
.
updateCounterWithFlush
();
if
(
logger
.
isTraceEnabled
())
{
logger
.
trace
(
"Add flow {} to be the reconcileList"
,
ofmRc
.
cookie
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment