Search in sources :

Example 1 with RuleManagerConfig

use of org.openkilda.rulemanager.RuleManagerConfig in project open-kilda by telstra.

the class FlowHsTopology method yFlowCreateHub.

private void yFlowCreateHub(TopologyBuilder topologyBuilder, PersistenceManager persistenceManager) {
    int hubTimeout = (int) TimeUnit.SECONDS.toMillis(topologyConfig.getCreateHubTimeoutSeconds());
    FlowCreateConfig config = FlowCreateConfig.flowCreateBuilder().flowCreationRetriesLimit(topologyConfig.getCreateHubRetries()).pathAllocationRetriesLimit(topologyConfig.getPathAllocationRetriesLimit()).pathAllocationRetryDelay(topologyConfig.getPathAllocationRetryDelay()).speakerCommandRetriesLimit(topologyConfig.getCreateSpeakerCommandRetries()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.YFLOW_CREATE_SPEAKER_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    YFlowCreateConfig yFlowCreateConfig = YFlowCreateConfig.builder().speakerCommandRetriesLimit(topologyConfig.getYFlowCreateSpeakerCommandRetriesLimit()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.YFLOW_CREATE_SPEAKER_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    PathComputerConfig pathComputerConfig = configurationProvider.getConfiguration(PathComputerConfig.class);
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    RuleManagerConfig ruleManagerConfig = configurationProvider.getConfiguration(RuleManagerConfig.class);
    YFlowCreateHubBolt hubBolt = new YFlowCreateHubBolt(yFlowCreateConfig, config, persistenceManager, pathComputerConfig, flowResourcesConfig, ruleManagerConfig);
    declareBolt(topologyBuilder, hubBolt, ComponentId.YFLOW_CREATE_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), Stream.ROUTER_TO_YFLOW_CREATE_HUB.name(), FLOW_FIELD).directGrouping(ComponentId.YFLOW_CREATE_SPEAKER_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_YFLOW_CREATE.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) PathComputerConfig(org.openkilda.pce.PathComputerConfig) RuleManagerConfig(org.openkilda.rulemanager.RuleManagerConfig) YFlowCreateConfig(org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt.YFlowCreateConfig) FlowCreateConfig(org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt.FlowCreateConfig) YFlowCreateConfig(org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt.YFlowCreateConfig) YFlowCreateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt)

Example 2 with RuleManagerConfig

use of org.openkilda.rulemanager.RuleManagerConfig in project open-kilda by telstra.

the class AbstractYFlowTest method before.

@Before
public void before() {
    dummyFactory = new PersistenceDummyEntityFactory(persistenceManager);
    FlowResourcesConfig resourceConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    flowResourcesManager = spy(new FlowResourcesManager(persistenceManager, resourceConfig));
    RuleManagerConfig ruleManagerConfig = configurationProvider.getConfiguration(RuleManagerConfig.class);
    ruleManager = spy(new RuleManagerImpl(ruleManagerConfig));
    alterFeatureToggles(true, true, true, true);
    dummyFactory.makeSwitch(SWITCH_SHARED);
    dummyFactory.makeSwitch(SWITCH_FIRST_EP);
    dummyFactory.makeSwitch(SWITCH_SECOND_EP);
    dummyFactory.makeSwitch(SWITCH_TRANSIT);
    dummyFactory.makeSwitch(SWITCH_NEW_TRANSIT);
    dummyFactory.makeSwitch(SWITCH_ALT_TRANSIT);
    dummyFactory.makeSwitch(SWITCH_NEW_FIRST_EP);
    dummyFactory.makeSwitch(SWITCH_NEW_SECOND_EP);
    for (IslDirectionalReference reference : new IslDirectionalReference[] { islSharedToFirst, islSharedToSecond, islSharedToTransit, islTransitToFirst, islTransitToSecond, islSharedToAltTransit, islAltTransitToFirst, islAltTransitToSecond, islTransitToNewFirst, islTransitToNewSecond, islSharedToNewAltTransit, islNewAltTransitToFirst, islNewAltTransitToSecond, islSharedToNewTransit, islNewTransitToFirst, islNewTransitToSecond }) {
        dummyFactory.makeIsl(reference.getSourceEndpoint(), reference.getDestEndpoint());
        dummyFactory.makeIsl(reference.getDestEndpoint(), reference.getSourceEndpoint());
    }
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) RuleManagerConfig(org.openkilda.rulemanager.RuleManagerConfig) PersistenceDummyEntityFactory(org.openkilda.persistence.dummy.PersistenceDummyEntityFactory) IslDirectionalReference(org.openkilda.persistence.dummy.IslDirectionalReference) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) RuleManagerImpl(org.openkilda.rulemanager.RuleManagerImpl) Before(org.junit.Before)

Example 3 with RuleManagerConfig

use of org.openkilda.rulemanager.RuleManagerConfig in project open-kilda by telstra.

the class LldpRuleGeneratorTest method prepareConfig.

protected static RuleManagerConfig prepareConfig() {
    RuleManagerConfig config = mock(RuleManagerConfig.class);
    when(config.getLldpRateLimit()).thenReturn(1);
    when(config.getLldpMeterBurstSizeInPackets()).thenReturn(4096L);
    when(config.getLldpPacketSize()).thenReturn(100);
    return config;
}
Also used : RuleManagerConfig(org.openkilda.rulemanager.RuleManagerConfig)

Example 4 with RuleManagerConfig

use of org.openkilda.rulemanager.RuleManagerConfig in project open-kilda by telstra.

the class Server42IslRttTurningRuleGeneratorTest method setup.

@Before
public void setup() {
    RuleManagerConfig config = mock(RuleManagerConfig.class);
    when(config.getServer42IslRttMagicMacAddress()).thenReturn(MAC_ADDRESS.toString());
    generator = Server42IslRttTurningRuleGenerator.builder().config(config).build();
}
Also used : RuleManagerConfig(org.openkilda.rulemanager.RuleManagerConfig) Before(org.junit.Before)

Example 5 with RuleManagerConfig

use of org.openkilda.rulemanager.RuleManagerConfig in project open-kilda by telstra.

the class ArpRuleGeneratorTest method prepareConfig.

protected static RuleManagerConfig prepareConfig() {
    RuleManagerConfig config = mock(RuleManagerConfig.class);
    when(config.getArpRateLimit()).thenReturn(1);
    when(config.getArpMeterBurstSizeInPackets()).thenReturn(4096L);
    when(config.getArpPacketSize()).thenReturn(100);
    return config;
}
Also used : RuleManagerConfig(org.openkilda.rulemanager.RuleManagerConfig)

Aggregations

RuleManagerConfig (org.openkilda.rulemanager.RuleManagerConfig)12 FlowResourcesConfig (org.openkilda.wfm.share.flow.resources.FlowResourcesConfig)6 Before (org.junit.Before)5 PathComputerConfig (org.openkilda.pce.PathComputerConfig)3 RuleManagerImpl (org.openkilda.rulemanager.RuleManagerImpl)2 SpeakerRequest (org.openkilda.floodlight.api.request.SpeakerRequest)1 IslDirectionalReference (org.openkilda.persistence.dummy.IslDirectionalReference)1 PersistenceDummyEntityFactory (org.openkilda.persistence.dummy.PersistenceDummyEntityFactory)1 FlowResourcesManager (org.openkilda.wfm.share.flow.resources.FlowResourcesManager)1 FlowCreateConfig (org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt.FlowCreateConfig)1 FlowPathSwapHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowPathSwapHubBolt)1 FlowPathSwapConfig (org.openkilda.wfm.topology.flowhs.bolts.FlowPathSwapHubBolt.FlowPathSwapConfig)1 FlowRerouteConfig (org.openkilda.wfm.topology.flowhs.bolts.FlowRerouteHubBolt.FlowRerouteConfig)1 FlowUpdateConfig (org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt.FlowUpdateConfig)1 YFlowCreateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt)1 YFlowCreateConfig (org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt.YFlowCreateConfig)1 YFlowDeleteHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowDeleteHubBolt)1 YFlowDeleteConfig (org.openkilda.wfm.topology.flowhs.bolts.YFlowDeleteHubBolt.YFlowDeleteConfig)1 YFlowRerouteHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowRerouteHubBolt)1 YFlowRerouteConfig (org.openkilda.wfm.topology.flowhs.bolts.YFlowRerouteHubBolt.YFlowRerouteConfig)1