Open Kilda Java Documentation
org.openkilda.pce.janitor.FlowJanitor Class Reference

Classes

class  Config
 

Public Member Functions

int CountDuplicateCookies ()
 
List< String > FlowsWithDuplicateCookies (boolean verbose)
 

Static Public Member Functions

static final void updateFlows (FlowJanitor.Config config, List< String > flowsToUpdate)
 
static void main (String[] args)
 

Static Public Attributes

static final String DUPLICATE_COOKIES_QUERY
 
static final String DUPLICATE_VLAN_QUERY
 
static final String DUPLICATE_FLOWS_QUERY
 
static final String DELETE_DUPLICATE_FLOW
 

Detailed Description

FlowJanitor holds methods that facilitate detecting and fixing issues with flows. Examples will be included over time.

Definition at line 32 of file FlowJanitor.java.

Member Function Documentation

◆ CountDuplicateCookies()

int org.openkilda.pce.janitor.FlowJanitor.CountDuplicateCookies ( )
Returns
the number of cookies that have more than one flow. This shouldn't happen, but this is here to catch scenarios where it does. '2' means two cookies have more than 1 flow each.

Definition at line 93 of file FlowJanitor.java.

◆ FlowsWithDuplicateCookies()

List<String> org.openkilda.pce.janitor.FlowJanitor.FlowsWithDuplicateCookies ( boolean  verbose)
Returns
the number of cookies that have more than one flow. This shouldn't happen, but this is here to catch scenarios where it does. '2' means two cookies have more than 1 flow each.

Definition at line 101 of file FlowJanitor.java.

◆ main()

static void org.openkilda.pce.janitor.FlowJanitor.main ( String []  args)
static

With the right URL, username, password, and method keyword, the methods above can be called.

Parameters
args

Definition at line 158 of file FlowJanitor.java.

◆ updateFlows()

static final void org.openkilda.pce.janitor.FlowJanitor.updateFlows ( FlowJanitor.Config  config,
List< String >  flowsToUpdate 
)
static

Definition at line 106 of file FlowJanitor.java.

Member Data Documentation

◆ DELETE_DUPLICATE_FLOW

final String org.openkilda.pce.janitor.FlowJanitor.DELETE_DUPLICATE_FLOW
static
Initial value:
=
"MATCH (:switch) -[rel:flow]-> (:switch)"+
" WHERE rel.flowid = %s AND rel.cookie = %d"+
" DELETE rel"

Use to delete a flow (ie in conjunction with DUPLICATE_FLOWS_QUERY)

Definition at line 73 of file FlowJanitor.java.

◆ DUPLICATE_COOKIES_QUERY

final String org.openkilda.pce.janitor.FlowJanitor.DUPLICATE_COOKIES_QUERY
static
Initial value:
=
"MATCH (:switch) -[rel:flow]-> (:switch)" +
" WITH rel.cookie as affected_cookie, COUNT(rel.cookie) as cookie_num" +
" WHERE cookie_num > 1" +
" MATCH (:switch) -[rel2:flow]-> (:switch)" +
" WHERE rel2.cookie = affected_cookie" +
" RETURN affected_cookie, rel2.flowid as affected_flow_id" +
" ORDER BY affected_cookie "

Use to get the flows that share the same cookie (eg 1 cookie, N flows)

Definition at line 37 of file FlowJanitor.java.

◆ DUPLICATE_FLOWS_QUERY

final String org.openkilda.pce.janitor.FlowJanitor.DUPLICATE_FLOWS_QUERY
static
Initial value:
=
"MATCH (:switch) -[rel:flow]-> (:switch)"+
" WITH rel.flowid as affected_flow_id, COUNT(rel.flowid) as flow_num"+
" WHERE flow_num > 2"+
" MATCH (:switch) -[rel2:flow]-> (:switch)"+
" WHERE rel2.flowid = affected_flow_id"+
" RETURN affected_flow_id, rel2.cookie as affected_flow_cookie" +
" ORDER BY affected_flow_id"

Use to get the flows that have multiple instances (ie N flows .. should be just 1 flow)

Definition at line 61 of file FlowJanitor.java.

◆ DUPLICATE_VLAN_QUERY

final String org.openkilda.pce.janitor.FlowJanitor.DUPLICATE_VLAN_QUERY
static
Initial value:
=
"MATCH (:switch) -[rel:flow]-> (:switch)" +
" WITH rel.transit_vlan as affected_cookie, COUNT(rel.transit_vlan) as cookie_num" +
" WHERE cookie_num > 1" +
" MATCH (:switch) -[rel2:flow]-> (:switch)" +
" WHERE rel2.transit_vlan = affected_cookie and rel2.transit_vlan > 0" +
" RETURN affected_cookie, rel.transit_vlan AS transit_vlan, rel2.flowid as affected_flow_id" +
" ORDER BY affected_cookie"

Use to get the flows that share the same transit vlan (eg 1 t-vlan, N flows)

Definition at line 49 of file FlowJanitor.java.


The documentation for this class was generated from the following file: