use of org.openkilda.wfm.topology.flowhs.bolts.FlowUpdateHubBolt 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);
}
Aggregations