Search in sources :

Example 6 with FlowResourcesConfig

use of org.openkilda.wfm.share.flow.resources.FlowResourcesConfig in project open-kilda by telstra.

the class FlowHsTopology method flowCreateMirrorPointHub.

private void flowCreateMirrorPointHub(TopologyBuilder topologyBuilder, PersistenceManager persistenceManager) {
    int hubTimeout = (int) TimeUnit.SECONDS.toMillis(topologyConfig.getCreateMirrorPointHubTimeoutSeconds());
    FlowMirrorPointCreateConfig config = FlowMirrorPointCreateConfig.flowMirrorPointCreateBuilder().pathAllocationRetriesLimit(topologyConfig.getPathAllocationRetriesLimit()).pathAllocationRetryDelay(topologyConfig.getPathAllocationRetryDelay()).speakerCommandRetriesLimit(topologyConfig.getCreateMirrorPointSpeakerCommandRetries()).resourceAllocationRetriesLimit(topologyConfig.getResourceAllocationRetriesLimit()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.FLOW_CREATE_MIRROR_POINT_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    PathComputerConfig pathComputerConfig = configurationProvider.getConfiguration(PathComputerConfig.class);
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    FlowMirrorPointCreateHubBolt hubBolt = new FlowMirrorPointCreateHubBolt(config, persistenceManager, pathComputerConfig, flowResourcesConfig);
    declareBolt(topologyBuilder, hubBolt, ComponentId.FLOW_CREATE_MIRROR_POINT_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), ROUTER_TO_FLOW_CREATE_MIRROR_POINT_HUB.name(), FLOW_FIELD).directGrouping(ComponentId.FLOW_CREATE_MIRROR_POINT_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_CREATE_MIRROR_POINT.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) PathComputerConfig(org.openkilda.pce.PathComputerConfig) FlowMirrorPointCreateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowMirrorPointCreateHubBolt) FlowMirrorPointCreateConfig(org.openkilda.wfm.topology.flowhs.bolts.FlowMirrorPointCreateHubBolt.FlowMirrorPointCreateConfig)

Example 7 with FlowResourcesConfig

use of org.openkilda.wfm.share.flow.resources.FlowResourcesConfig in project open-kilda by telstra.

the class FlowHsTopology method flowDeleteMirrorPointHub.

private void flowDeleteMirrorPointHub(TopologyBuilder topologyBuilder, PersistenceManager persistenceManager) {
    int hubTimeout = (int) TimeUnit.SECONDS.toMillis(topologyConfig.getDeleteMirrorPointHubTimeoutSeconds());
    FlowMirrorPointDeleteConfig config = FlowMirrorPointDeleteConfig.flowMirrorPointDeleteBuilder().speakerCommandRetriesLimit(topologyConfig.getDeleteMirrorPointSpeakerCommandRetries()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.FLOW_DELETE_MIRROR_POINT_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    FlowMirrorPointDeleteHubBolt hubBolt = new FlowMirrorPointDeleteHubBolt(config, persistenceManager, flowResourcesConfig);
    declareBolt(topologyBuilder, hubBolt, ComponentId.FLOW_DELETE_MIRROR_POINT_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), ROUTER_TO_FLOW_DELETE_MIRROR_POINT_HUB.name(), FLOW_FIELD).directGrouping(ComponentId.FLOW_DELETE_MIRROR_POINT_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_DELETE_MIRROR_POINT.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) FlowMirrorPointDeleteConfig(org.openkilda.wfm.topology.flowhs.bolts.FlowMirrorPointDeleteHubBolt.FlowMirrorPointDeleteConfig) FlowMirrorPointDeleteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowMirrorPointDeleteHubBolt)

Example 8 with FlowResourcesConfig

use of org.openkilda.wfm.share.flow.resources.FlowResourcesConfig 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 9 with FlowResourcesConfig

use of org.openkilda.wfm.share.flow.resources.FlowResourcesConfig in project open-kilda by telstra.

the class PingTopology method flowFetcher.

private void flowFetcher(TopologyBuilder topology) {
    PersistenceManager persistenceManager = new PersistenceManager(configurationProvider);
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    FlowFetcher bolt = new FlowFetcher(persistenceManager, flowResourcesConfig, topologyConfig.getPeriodicPingCacheExpirationInterval());
    declareBolt(topology, bolt, FlowFetcher.BOLT_ID).globalGrouping(TickDeduplicator.BOLT_ID, TickDeduplicator.STREAM_PING_ID).shuffleGrouping(InputRouter.BOLT_ID, InputRouter.STREAM_ON_DEMAND_REQUEST_ID).shuffleGrouping(InputRouter.BOLT_ID, InputRouter.STREAM_ON_DEMAND_Y_FLOW_REQUEST_ID).allGrouping(InputRouter.BOLT_ID, InputRouter.STREAM_PERIODIC_PING_UPDATE_REQUEST_ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) FlowFetcher(org.openkilda.wfm.topology.ping.bolt.FlowFetcher) PersistenceManager(org.openkilda.persistence.PersistenceManager)

Example 10 with FlowResourcesConfig

use of org.openkilda.wfm.share.flow.resources.FlowResourcesConfig in project open-kilda by telstra.

the class CommandBuilderImplTest method setUpOnce.

@BeforeClass
public static void setUpOnce() {
    Properties configProps = new Properties();
    configProps.setProperty("flow.meter-id.max", "40");
    configProps.setProperty("flow.vlan.max", "50");
    PropertiesBasedConfigurationProvider configurationProvider = new PropertiesBasedConfigurationProvider(configProps);
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    commandBuilder = new CommandBuilderImpl(persistenceManager().build(), flowResourcesConfig);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) PropertiesBasedConfigurationProvider(org.openkilda.config.provider.PropertiesBasedConfigurationProvider) SwitchProperties(org.openkilda.model.SwitchProperties) Properties(java.util.Properties) BeforeClass(org.junit.BeforeClass)

Aggregations

FlowResourcesConfig (org.openkilda.wfm.share.flow.resources.FlowResourcesConfig)18 PathComputerConfig (org.openkilda.pce.PathComputerConfig)7 RuleManagerConfig (org.openkilda.rulemanager.RuleManagerConfig)6 YFlowCreateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt)4 YFlowDeleteHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowDeleteHubBolt)4 YFlowRerouteHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowRerouteHubBolt)4 Before (org.junit.Before)3 FlowCreateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt)3 FlowDeleteHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowDeleteHubBolt)3 FlowMirrorPointCreateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowMirrorPointCreateHubBolt)3 FlowMirrorPointDeleteHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowMirrorPointDeleteHubBolt)3 FlowPathSwapHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowPathSwapHubBolt)3 FlowRerouteHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowRerouteHubBolt)3 FlowUpdateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt)3 YFlowUpdateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt)3 Properties (java.util.Properties)2 PropertiesBasedConfigurationProvider (org.openkilda.config.provider.PropertiesBasedConfigurationProvider)2 IslDirectionalReference (org.openkilda.persistence.dummy.IslDirectionalReference)2 PersistenceDummyEntityFactory (org.openkilda.persistence.dummy.PersistenceDummyEntityFactory)2 FlowResourcesManager (org.openkilda.wfm.share.flow.resources.FlowResourcesManager)2