Search in sources :

Example 1 with PathComputer

use of org.openkilda.pce.PathComputer in project open-kilda by telstra.

the class FlowCreateHubBolt method init.

@Override
protected void init() {
    FlowResourcesManager resourcesManager = new FlowResourcesManager(persistenceManager, flowResourcesConfig);
    AvailableNetworkFactory availableNetworkFactory = new AvailableNetworkFactory(pathComputerConfig, persistenceManager.getRepositoryFactory());
    PathComputer pathComputer = new PathComputerFactory(pathComputerConfig, availableNetworkFactory).getPathComputer();
    service = new FlowCreateService(this, persistenceManager, pathComputer, resourcesManager, config.getFlowCreationRetriesLimit(), config.getPathAllocationRetriesLimit(), config.getPathAllocationRetryDelay(), config.getSpeakerCommandRetriesLimit());
}
Also used : PathComputer(org.openkilda.pce.PathComputer) AvailableNetworkFactory(org.openkilda.pce.AvailableNetworkFactory) PathComputerFactory(org.openkilda.pce.PathComputerFactory) FlowCreateService(org.openkilda.wfm.topology.flowhs.service.FlowCreateService) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager)

Example 2 with PathComputer

use of org.openkilda.pce.PathComputer in project open-kilda by telstra.

the class YFlowRerouteHubBolt method init.

@Override
protected void init() {
    FlowResourcesManager resourcesManager = new FlowResourcesManager(persistenceManager, flowResourcesConfig);
    AvailableNetworkFactory availableNetworkFactory = new AvailableNetworkFactory(pathComputerConfig, persistenceManager.getRepositoryFactory());
    PathComputer pathComputer = new PathComputerFactory(pathComputerConfig, availableNetworkFactory).getPathComputer();
    RuleManager ruleManager = new RuleManagerImpl(ruleManagerConfig);
    flowRerouteService = new FlowRerouteService(new FlowRerouteHubCarrierIsolatingResponsesAndLifecycleEvents(this), persistenceManager, pathComputer, resourcesManager, flowRerouteConfig.getPathAllocationRetriesLimit(), flowRerouteConfig.getPathAllocationRetryDelay(), flowRerouteConfig.getResourceAllocationRetriesLimit(), flowRerouteConfig.getSpeakerCommandRetriesLimit());
    yFlowRerouteService = new YFlowRerouteService(this, persistenceManager, pathComputer, resourcesManager, ruleManager, flowRerouteService, yFlowRerouteConfig.getResourceAllocationRetriesLimit(), yFlowRerouteConfig.getSpeakerCommandRetriesLimit());
}
Also used : PathComputer(org.openkilda.pce.PathComputer) AvailableNetworkFactory(org.openkilda.pce.AvailableNetworkFactory) PathComputerFactory(org.openkilda.pce.PathComputerFactory) RuleManager(org.openkilda.rulemanager.RuleManager) YFlowRerouteService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowRerouteService) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) RuleManagerImpl(org.openkilda.rulemanager.RuleManagerImpl) YFlowRerouteService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowRerouteService) FlowRerouteService(org.openkilda.wfm.topology.flowhs.service.FlowRerouteService)

Example 3 with PathComputer

use of org.openkilda.pce.PathComputer in project open-kilda by telstra.

the class YFlowUpdateHubBolt method init.

@Override
protected void init() {
    FlowResourcesManager resourcesManager = new FlowResourcesManager(persistenceManager, flowResourcesConfig);
    AvailableNetworkFactory availableNetworkFactory = new AvailableNetworkFactory(pathComputerConfig, persistenceManager.getRepositoryFactory());
    PathComputer pathComputer = new PathComputerFactory(pathComputerConfig, availableNetworkFactory).getPathComputer();
    RuleManager ruleManager = new RuleManagerImpl(ruleManagerConfig);
    basicFlowUpdateService = new FlowUpdateService(new FlowUpdateHubCarrierIsolatingResponsesAndLifecycleEvents(this), persistenceManager, pathComputer, resourcesManager, flowUpdateConfig.getPathAllocationRetriesLimit(), flowUpdateConfig.getPathAllocationRetryDelay(), flowUpdateConfig.getResourceAllocationRetriesLimit(), flowUpdateConfig.getSpeakerCommandRetriesLimit());
    yflowUpdateService = new YFlowUpdateService(this, persistenceManager, pathComputer, resourcesManager, ruleManager, basicFlowUpdateService, yflowUpdateConfig.getResourceAllocationRetriesLimit(), yflowUpdateConfig.getSpeakerCommandRetriesLimit(), yflowUpdateConfig.getPrefixForGeneratedYFlowId(), yflowUpdateConfig.getPrefixForGeneratedSubFlowId());
}
Also used : PathComputer(org.openkilda.pce.PathComputer) AvailableNetworkFactory(org.openkilda.pce.AvailableNetworkFactory) PathComputerFactory(org.openkilda.pce.PathComputerFactory) RuleManager(org.openkilda.rulemanager.RuleManager) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) YFlowUpdateService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowUpdateService) FlowUpdateService(org.openkilda.wfm.topology.flowhs.service.FlowUpdateService) YFlowUpdateService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowUpdateService) RuleManagerImpl(org.openkilda.rulemanager.RuleManagerImpl)

Example 4 with PathComputer

use of org.openkilda.pce.PathComputer in project open-kilda by telstra.

the class YFlowCreateHubBolt method init.

@Override
protected void init() {
    FlowResourcesManager resourcesManager = new FlowResourcesManager(persistenceManager, flowResourcesConfig);
    AvailableNetworkFactory availableNetworkFactory = new AvailableNetworkFactory(pathComputerConfig, persistenceManager.getRepositoryFactory());
    PathComputer pathComputer = new PathComputerFactory(pathComputerConfig, availableNetworkFactory).getPathComputer();
    RuleManager ruleManager = new RuleManagerImpl(ruleManagerConfig);
    FlowGenericHubCarrierIsolatingResponsesAndLifecycleEvents isolatingCarrier = new FlowGenericHubCarrierIsolatingResponsesAndLifecycleEvents(this);
    flowCreateService = new FlowCreateService(isolatingCarrier, persistenceManager, pathComputer, resourcesManager, flowCreateConfig.getFlowCreationRetriesLimit(), flowCreateConfig.getPathAllocationRetriesLimit(), flowCreateConfig.getPathAllocationRetryDelay(), flowCreateConfig.getSpeakerCommandRetriesLimit());
    flowDeleteService = new FlowDeleteService(isolatingCarrier, persistenceManager, resourcesManager, yFlowCreateConfig.getSpeakerCommandRetriesLimit());
    yFlowCreateService = new YFlowCreateService(this, persistenceManager, pathComputer, resourcesManager, ruleManager, flowCreateService, flowDeleteService, yFlowCreateConfig.getResourceAllocationRetriesLimit(), yFlowCreateConfig.getSpeakerCommandRetriesLimit(), yFlowCreateConfig.getPrefixForGeneratedYFlowId(), yFlowCreateConfig.getPrefixForGeneratedSubFlowId());
}
Also used : PathComputer(org.openkilda.pce.PathComputer) AvailableNetworkFactory(org.openkilda.pce.AvailableNetworkFactory) PathComputerFactory(org.openkilda.pce.PathComputerFactory) RuleManager(org.openkilda.rulemanager.RuleManager) YFlowCreateService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowCreateService) FlowCreateService(org.openkilda.wfm.topology.flowhs.service.FlowCreateService) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) FlowDeleteService(org.openkilda.wfm.topology.flowhs.service.FlowDeleteService) YFlowCreateService(org.openkilda.wfm.topology.flowhs.service.yflow.YFlowCreateService) RuleManagerImpl(org.openkilda.rulemanager.RuleManagerImpl)

Example 5 with PathComputer

use of org.openkilda.pce.PathComputer in project open-kilda by telstra.

the class CostAndBandwidthPathComputationStrategyTest method shouldFailToFindOverIslandsWithAllActiveLinksAndIgnoreBandwidth.

/**
 * Create a couple of islands .. try to find a path between them .. validate no path is returned, and that the
 * function completes in reasonable time ( < 10ms);
 */
@Test
public void shouldFailToFindOverIslandsWithAllActiveLinksAndIgnoreBandwidth() throws RecoverableException, UnroutableFlowException {
    createDiamond(IslStatus.ACTIVE, IslStatus.ACTIVE, 10, 20, "06:", 1);
    createDiamond(IslStatus.ACTIVE, IslStatus.ACTIVE, 10, 20, "07:", 1);
    Switch srcSwitch1 = getSwitchById("06:01");
    Switch destSwitch1 = getSwitchById("06:03");
    // THIS ONE SHOULD WORK
    Flow f1 = getTestFlowBuilder(srcSwitch1, destSwitch1).bandwidth(0).ignoreBandwidth(false).build();
    PathComputer pathComputer = pathComputerFactory.getPathComputer();
    GetPathsResult path = pathComputer.getPath(f1);
    assertNotNull(path);
    assertThat(path.getForward().getSegments(), Matchers.hasSize(1));
    Switch srcSwitch2 = getSwitchById("06:01");
    Switch destSwitch2 = getSwitchById("07:04");
    // THIS ONE SHOULD FAIL
    Flow f2 = getTestFlowBuilder(srcSwitch2, destSwitch2).bandwidth(0).ignoreBandwidth(false).build();
    thrown.expect(UnroutableFlowException.class);
    pathComputer.getPath(f2);
}
Also used : PathComputer(org.openkilda.pce.PathComputer) Switch(org.openkilda.model.Switch) Flow(org.openkilda.model.Flow) GetPathsResult(org.openkilda.pce.GetPathsResult) Test(org.junit.Test)

Aggregations

PathComputer (org.openkilda.pce.PathComputer)56 Test (org.junit.Test)46 Flow (org.openkilda.model.Flow)45 GetPathsResult (org.openkilda.pce.GetPathsResult)39 SwitchId (org.openkilda.model.SwitchId)33 Switch (org.openkilda.model.Switch)27 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)8 FlowPath (org.openkilda.model.FlowPath)7 AvailableNetworkFactory (org.openkilda.pce.AvailableNetworkFactory)7 PathComputerFactory (org.openkilda.pce.PathComputerFactory)7 FlowResourcesManager (org.openkilda.wfm.share.flow.resources.FlowResourcesManager)7 BestWeightAndShortestPathFinder (org.openkilda.pce.finder.BestWeightAndShortestPathFinder)6 PathSegment (org.openkilda.model.PathSegment)4 Segment (org.openkilda.pce.Path.Segment)4 PathId (org.openkilda.model.PathId)3 RuleManager (org.openkilda.rulemanager.RuleManager)3 RuleManagerImpl (org.openkilda.rulemanager.RuleManagerImpl)3 Isl (org.openkilda.model.Isl)2 FlowCreateService (org.openkilda.wfm.topology.flowhs.service.FlowCreateService)2 FlowRerouteService (org.openkilda.wfm.topology.flowhs.service.FlowRerouteService)2