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());
}
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());
}
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());
}
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());
}
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);
}
Aggregations