Search in sources :

Example 1 with FlowUpdateConfig

use of org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt.FlowUpdateConfig in project open-kilda by telstra.

the class FlowHsTopology method flowUpdateHub.

private void flowUpdateHub(TopologyBuilder topologyBuilder, PersistenceManager persistenceManager) {
    int hubTimeout = (int) TimeUnit.SECONDS.toMillis(topologyConfig.getUpdateHubTimeoutSeconds());
    FlowUpdateConfig config = FlowUpdateConfig.flowUpdateBuilder().pathAllocationRetriesLimit(topologyConfig.getPathAllocationRetriesLimit()).pathAllocationRetryDelay(topologyConfig.getPathAllocationRetryDelay()).speakerCommandRetriesLimit(topologyConfig.getUpdateSpeakerCommandRetries()).resourceAllocationRetriesLimit(topologyConfig.getResourceAllocationRetriesLimit()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.FLOW_UPDATE_SPEAKER_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    PathComputerConfig pathComputerConfig = configurationProvider.getConfiguration(PathComputerConfig.class);
    FlowResourcesConfig flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
    FlowUpdateHubBolt hubBolt = new FlowUpdateHubBolt(config, persistenceManager, pathComputerConfig, flowResourcesConfig);
    declareBolt(topologyBuilder, hubBolt, ComponentId.FLOW_UPDATE_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), ROUTER_TO_FLOW_UPDATE_HUB.name(), FLOW_FIELD).directGrouping(ComponentId.FLOW_UPDATE_SPEAKER_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_UPDATE.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) PathComputerConfig(org.openkilda.pce.PathComputerConfig) FlowUpdateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt) YFlowUpdateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt) YFlowUpdateConfig(org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt.YFlowUpdateConfig) FlowUpdateConfig(org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt.FlowUpdateConfig)

Example 2 with FlowUpdateConfig

use of org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt.FlowUpdateConfig in project open-kilda by telstra.

the class FlowHsTopology method yFlowUpdateHub.

private void yFlowUpdateHub(TopologyBuilder topologyBuilder, PersistenceManager persistenceManager) {
    int hubTimeout = (int) TimeUnit.SECONDS.toMillis(topologyConfig.getUpdateHubTimeoutSeconds());
    FlowUpdateConfig flowUpdateConfig = FlowUpdateConfig.flowUpdateBuilder().resourceAllocationRetriesLimit(topologyConfig.getResourceAllocationRetriesLimit()).pathAllocationRetriesLimit(topologyConfig.getPathAllocationRetriesLimit()).pathAllocationRetryDelay(topologyConfig.getPathAllocationRetryDelay()).speakerCommandRetriesLimit(topologyConfig.getCreateSpeakerCommandRetries()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.YFLOW_UPDATE_SPEAKER_WORKER.name()).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).build();
    YFlowUpdateConfig yflowUpdateConfig = YFlowUpdateConfig.builder().speakerCommandRetriesLimit(topologyConfig.getCreateSpeakerCommandRetries()).autoAck(true).timeoutMs(hubTimeout).requestSenderComponent(ComponentId.FLOW_ROUTER_BOLT.name()).workerComponent(ComponentId.YFLOW_UPDATE_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);
    YFlowUpdateHubBolt hubBolt = new YFlowUpdateHubBolt(yflowUpdateConfig, flowUpdateConfig, persistenceManager, pathComputerConfig, flowResourcesConfig, ruleManagerConfig);
    declareBolt(topologyBuilder, hubBolt, ComponentId.YFLOW_UPDATE_HUB.name()).fieldsGrouping(ComponentId.FLOW_ROUTER_BOLT.name(), ROUTER_TO_YFLOW_UPDATE_HUB.name(), FLOW_FIELD).directGrouping(ComponentId.YFLOW_UPDATE_SPEAKER_WORKER.name(), Stream.SPEAKER_WORKER_TO_HUB_YFLOW_UPDATE.name()).allGrouping(ZooKeeperSpout.SPOUT_ID).directGrouping(CoordinatorBolt.ID);
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) YFlowUpdateHubBolt(org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt) PathComputerConfig(org.openkilda.pce.PathComputerConfig) RuleManagerConfig(org.openkilda.rulemanager.RuleManagerConfig) YFlowUpdateConfig(org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt.YFlowUpdateConfig) FlowUpdateConfig(org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt.FlowUpdateConfig) YFlowUpdateConfig(org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt.YFlowUpdateConfig)

Aggregations

PathComputerConfig (org.openkilda.pce.PathComputerConfig)2 FlowResourcesConfig (org.openkilda.wfm.share.flow.resources.FlowResourcesConfig)2 FlowUpdateConfig (org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt.FlowUpdateConfig)2 YFlowUpdateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt)2 YFlowUpdateConfig (org.openkilda.wfm.topology.flowhs.bolts.YFlowUpdateHubBolt.YFlowUpdateConfig)2 RuleManagerConfig (org.openkilda.rulemanager.RuleManagerConfig)1 FlowUpdateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt)1