Search in sources :

Example 1 with FlowCreateConfig

use of org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt.FlowCreateConfig 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 FlowCreateConfig

use of org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt.FlowCreateConfig 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)

Aggregations

PathComputerConfig (org.openkilda.pce.PathComputerConfig)2 FlowResourcesConfig (org.openkilda.wfm.share.flow.resources.FlowResourcesConfig)2 FlowCreateConfig (org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt.FlowCreateConfig)2 YFlowCreateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt)2 YFlowCreateConfig (org.openkilda.wfm.topology.flowhs.bolts.YFlowCreateHubBolt.YFlowCreateConfig)2 RuleManagerConfig (org.openkilda.rulemanager.RuleManagerConfig)1 FlowCreateHubBolt (org.openkilda.wfm.topology.flowhs.bolts.FlowCreateHubBolt)1