Search in sources :

Example 1 with FlowResourcesConfig

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

the class FlowHsTopology method flowValidationHub.

private void flowValidationHub(TopologyBuilder topologyBuilder, PersistenceManager persistenceManager) {
    int hubTimeout = (int) TimeUnit.SECONDS.toMillis(topologyConfig.getValidationHubTimeoutSeconds());
    HubBolt.Config config = HubBolt.Config.builder().requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.FLOW_VALIDATION_SPEAKER_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).timeoutMs(hubTimeout).build();
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    FlowValidationHubBolt hubBolt = new FlowValidationHubBolt(config, persistenceManager, flowResourcesConfig, topologyConfig.getFlowMeterMinBurstSizeInKbits(), topologyConfig.getFlowMeterBurstCoefficient());
    declareBolt(topologyBuilder, hubBolt, ComponentId.FLOW_VALIDATION_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), Stream.ROUTER_TO_FLOW_VALIDATION_HUB.name(), FIELDS_KEY).directGrouping(ComponentId.FLOW_VALIDATION_SPEAKER_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_VALIDATION.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) YFlowValidationHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowValidationHubBolt) FlowValidationHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowValidationHubBolt) YFlowValidationHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowValidationHubBolt) FlowMirrorPointCreateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowMirrorPointCreateHubBolt) FlowRerouteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowRerouteHubBolt) YFlowDeleteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowDeleteHubBolt) FlowUpdateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt) FlowMirrorPointDeleteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowMirrorPointDeleteHubBolt) FlowPathSwapHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowPathSwapHubBolt) YFlowRerouteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowRerouteHubBolt) FlowSwapEndpointsHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowSwapEndpointsHubBolt) FlowCreateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt) HubBolt(org.openkilda.wfm.share.hubandspoke.HubBolt) FlowDeleteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowDeleteHubBolt) YFlowCreateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt) FlowValidationHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowValidationHubBolt) YFlowUpdateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt)

Example 2 with FlowResourcesConfig

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

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

the class FlowHsTopology method flowDeleteHub.

private void flowDeleteHub(TopologyBuilder topologyBuilder, PersistenceManager persistenceManager) {
    int hubTimeout = (int) TimeUnit.SECONDS.toMillis(topologyConfig.getDeleteHubTimeoutSeconds());
    FlowDeleteConfig config = FlowDeleteConfig.flowDeleteBuilder().speakerCommandRetriesLimit(topologyConfig.getDeleteSpeakerCommandRetries()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.FLOW_DELETE_SPEAKER_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    FlowDeleteHubBolt hubBolt = new FlowDeleteHubBolt(config, persistenceManager, flowResourcesConfig);
    declareBolt(topologyBuilder, hubBolt, ComponentId.FLOW_DELETE_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), ROUTER_TO_FLOW_DELETE_HUB.name(), FLOW_FIELD).directGrouping(ComponentId.FLOW_DELETE_SPEAKER_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_DELETE.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) FlowDeleteConfig(org.openkilda.wfm.topology.flowhs.bolts.FlowDeleteHubBolt.FlowDeleteConfig) YFlowDeleteConfig(org.openkilda.wfm.topology.flowhs.bolts.YFlowDeleteHubBolt.YFlowDeleteConfig) YFlowDeleteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowDeleteHubBolt) FlowDeleteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowDeleteHubBolt)

Example 4 with FlowResourcesConfig

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

the class FlowHsTopology method flowCreateHub.

private void flowCreateHub(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.FLOW_CREATE_SPEAKER_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    PathComputerConfig pathComputerConfig = configurationProvider.getConfiguration(PathComputerConfig.class);
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    FlowCreateHubBolt hubBolt = new FlowCreateHubBolt(config, persistenceManager, pathComputerConfig, flowResourcesConfig);
    declareBolt(topologyBuilder, hubBolt, ComponentId.FLOW_CREATE_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), ROUTER_TO_FLOW_CREATE_HUB.name(), FLOW_FIELD).directGrouping(ComponentId.FLOW_CREATE_SPEAKER_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_CREATE.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) FlowCreateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt) YFlowCreateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt) PathComputerConfig(org.openkilda.pce.PathComputerConfig) FlowCreateConfig(org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt.FlowCreateConfig) YFlowCreateConfig(org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt.YFlowCreateConfig)

Example 5 with FlowResourcesConfig

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

the class FlowHsTopology method flowRerouteHub.

private void flowRerouteHub(TopologyBuilder topologyBuilder, PersistenceManager persistenceManager) {
    int hubTimeout = (int) TimeUnit.SECONDS.toMillis(topologyConfig.getRerouteHubTimeoutSeconds());
    FlowRerouteConfig config = FlowRerouteConfig.flowRerouteBuilder().pathAllocationRetriesLimit(topologyConfig.getPathAllocationRetriesLimit()).pathAllocationRetryDelay(topologyConfig.getPathAllocationRetryDelay()).speakerCommandRetriesLimit(topologyConfig.getRerouteSpeakerCommandRetries()).resourceAllocationRetriesLimit(topologyConfig.getResourceAllocationRetriesLimit()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.FLOW_REROUTE_SPEAKER_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    PathComputerConfig pathComputerConfig = configurationProvider.getConfiguration(PathComputerConfig.class);
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    FlowRerouteHubBolt hubBolt = new FlowRerouteHubBolt(config, persistenceManager, pathComputerConfig, flowResourcesConfig);
    declareBolt(topologyBuilder, hubBolt, ComponentId.FLOW_REROUTE_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), ROUTER_TO_FLOW_REROUTE_HUB.name(), FLOW_FIELD).directGrouping(ComponentId.FLOW_REROUTE_SPEAKER_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_REROUTE.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowRerouteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowRerouteHubBolt) YFlowRerouteHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowRerouteHubBolt) FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) PathComputerConfig(org.openkilda.pce.PathComputerConfig) YFlowRerouteConfig(org.openkilda.wfm.topology.flowhs.bolts.YFlowRerouteHubBolt.YFlowRerouteConfig) FlowRerouteConfig(org.openkilda.wfm.topology.flowhs.bolts.FlowRerouteHubBolt.FlowRerouteConfig)

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