![]() |
Open Kilda Java Documentation
|
Classes | |
class | Plan |
Public Member Functions | |
DiscoveryManager (Map< SwitchId, Set< DiscoveryLink >> linksBySwitch, int islHealthCheckInterval, int islConsecutiveFailureLimit, int maxAttempts, Integer minutesKeepRemovedIsl) | |
Plan | makeDiscoveryPlan () |
boolean | handleDiscovered (SwitchId srcSwitch, int srcPort, SwitchId dstSwitch, int dstPort) |
boolean | handleFailed (SwitchId switchId, int portId) |
void | handleSentDiscoPacket (NetworkEndpoint endpoint) |
void | handleSwitchUp (SwitchId switchId) |
void | handleSwitchDown (SwitchId switchId) |
void | handlePortUp (SwitchId switchId, int portId) |
DiscoveryLink | registerPort (SwitchId switchId, int portId) |
void | handlePortDown (SwitchId switchId, int portId) |
boolean | isIslMoved (SwitchId srcSwitch, int srcPort, SwitchId dstSwitch, int dstPort) |
NetworkEndpoint | getLinkDestination (SwitchId srcSwitch, int srcPort) |
void | deactivateLinkFromEndpoint (NetworkEndpoint endpoint) |
boolean | isInDiscoveryPlan (SwitchId switchId, int portId) |
The DiscoveryManager holds the core logic for managing ISLs. This includes all of the business rules related to Switch Up/Down, Port Up/Down, failure counts and limits, etc. Comments on the business logic and rules are embedded in the rest of this class.
TODO: Refactor DiscoveryManager in the following ways: 1) Integrate any remaining business logic for storm code into this class so that the logic is concentrated in one place 2) The timers/counters are a little bit out of whack and should be cleaned up:
Definition at line 59 of file DiscoveryManager.java.
org.openkilda.wfm.isl.DiscoveryManager.DiscoveryManager | ( | Map< SwitchId, Set< DiscoveryLink >> | linksBySwitch, |
int | islHealthCheckInterval, | ||
int | islConsecutiveFailureLimit, | ||
int | maxAttempts, | ||
Integer | minutesKeepRemovedIsl | ||
) |
Base constructor of discovery manager.
linksBySwitch | - links storage. |
islHealthCheckInterval | - how frequently (in ticks) to check. |
islConsecutiveFailureLimit | - the threshold for sending ISL down, if it is an ISL |
maxAttempts | - the limit for stopping all checks. |
Definition at line 85 of file DiscoveryManager.java.
void org.openkilda.wfm.isl.DiscoveryManager.deactivateLinkFromEndpoint | ( | NetworkEndpoint | endpoint | ) |
Deactivate link from switch/port and mark it as inactive. The link will be pulled from main discovery queue or from temporary storage where we store ISLs to be deleted.
Definition at line 443 of file DiscoveryManager.java.
NetworkEndpoint org.openkilda.wfm.isl.DiscoveryManager.getLinkDestination | ( | SwitchId | srcSwitch, |
int | srcPort | ||
) |
Returns the endpoint of the link.
Definition at line 427 of file DiscoveryManager.java.
boolean org.openkilda.wfm.isl.DiscoveryManager.handleDiscovered | ( | SwitchId | srcSwitch, |
int | srcPort, | ||
SwitchId | dstSwitch, | ||
int | dstPort | ||
) |
ISL Discovery Event.
Definition at line 181 of file DiscoveryManager.java.
boolean org.openkilda.wfm.isl.DiscoveryManager.handleFailed | ( | SwitchId | switchId, |
int | portId | ||
) |
ISL Failure Event.
Definition at line 224 of file DiscoveryManager.java.
void org.openkilda.wfm.isl.DiscoveryManager.handlePortDown | ( | SwitchId | switchId, |
int | portId | ||
) |
Handle port down event.
Definition at line 338 of file DiscoveryManager.java.
void org.openkilda.wfm.isl.DiscoveryManager.handlePortUp | ( | SwitchId | switchId, |
int | portId | ||
) |
Handle port up event.
Definition at line 296 of file DiscoveryManager.java.
void org.openkilda.wfm.isl.DiscoveryManager.handleSentDiscoPacket | ( | NetworkEndpoint | endpoint | ) |
Processes response from speaker. Speaker notifies us that disco packet is sent as requested.
endpoint | the switch and the port from which disco packets is sent. |
Definition at line 251 of file DiscoveryManager.java.
void org.openkilda.wfm.isl.DiscoveryManager.handleSwitchDown | ( | SwitchId | switchId | ) |
Handle deactivated switch.
switchId | id of the switch. |
Definition at line 288 of file DiscoveryManager.java.
void org.openkilda.wfm.isl.DiscoveryManager.handleSwitchUp | ( | SwitchId | switchId | ) |
Handle added/activated switch.
switchId | id of the switch. |
Definition at line 263 of file DiscoveryManager.java.
boolean org.openkilda.wfm.isl.DiscoveryManager.isInDiscoveryPlan | ( | SwitchId | switchId, |
int | portId | ||
) |
Checks if we are sending disco packets from specified endpoint.
switchId | switch datapath id. |
portId | port number. |
Definition at line 460 of file DiscoveryManager.java.
boolean org.openkilda.wfm.isl.DiscoveryManager.isIslMoved | ( | SwitchId | srcSwitch, |
int | srcPort, | ||
SwitchId | dstSwitch, | ||
int | dstPort | ||
) |
Check whether destination of the ISL is changed (replugged to another port/switch).
Definition at line 411 of file DiscoveryManager.java.
Plan org.openkilda.wfm.isl.DiscoveryManager.makeDiscoveryPlan | ( | ) |
The discovery plan takes into consideration multiple metrics to determine what should be discovered.
At present, we want to send Discovery health checks on every ISL every x period. And, if the Discovery fails (either isn't an ISL or ISL is down) then we may want to give up checking.
General algorithm: 1) if the node is an ISL (isFoundIsl) .. and is UP .. keep checking 2) if the node is not an ISL (ie !isFoundIsl), then check less frequently 3) if the node is an ISL .. and is DOWN .. keep checking
Definition at line 108 of file DiscoveryManager.java.
DiscoveryLink org.openkilda.wfm.isl.DiscoveryManager.registerPort | ( | SwitchId | switchId, |
int | portId | ||
) |
Register a switch port for the discovery process.
switchId | the port's switch. |
portId | the port number. |
Definition at line 318 of file DiscoveryManager.java.