use of org.apache.helix.controller.pipeline.PipelineRegistry in project helix by apache.
the class GenericHelixController method createDefaultRegistry.
private static PipelineRegistry createDefaultRegistry(String pipelineName) {
logger.info("createDefaultRegistry");
synchronized (GenericHelixController.class) {
PipelineRegistry registry = new PipelineRegistry();
// cluster data cache refresh
Pipeline dataRefresh = new Pipeline(pipelineName);
dataRefresh.addStage(new ReadClusterDataStage());
// rebalance pipeline
Pipeline rebalancePipeline = new Pipeline(pipelineName);
rebalancePipeline.addStage(new ResourceComputationStage());
rebalancePipeline.addStage(new ResourceValidationStage());
rebalancePipeline.addStage(new CurrentStateComputationStage());
rebalancePipeline.addStage(new BestPossibleStateCalcStage());
rebalancePipeline.addStage(new IntermediateStateCalcStage());
rebalancePipeline.addStage(new MessageGenerationPhase());
rebalancePipeline.addStage(new MessageSelectionStage());
rebalancePipeline.addStage(new MessageThrottleStage());
rebalancePipeline.addStage(new TaskAssignmentStage());
rebalancePipeline.addStage(new PersistAssignmentStage());
rebalancePipeline.addStage(new TargetExteralViewCalcStage());
// external view generation
Pipeline externalViewPipeline = new Pipeline(pipelineName);
externalViewPipeline.addStage(new ExternalViewComputeStage());
// backward compatibility check
Pipeline liveInstancePipeline = new Pipeline(pipelineName);
liveInstancePipeline.addStage(new CompatibilityCheckStage());
registry.register(ClusterEventType.IdealStateChange, dataRefresh, rebalancePipeline);
registry.register(ClusterEventType.CurrentStateChange, dataRefresh, rebalancePipeline, externalViewPipeline);
registry.register(ClusterEventType.InstanceConfigChange, dataRefresh, rebalancePipeline);
registry.register(ClusterEventType.ResourceConfigChange, dataRefresh, rebalancePipeline);
registry.register(ClusterEventType.ClusterConfigChange, dataRefresh, rebalancePipeline);
registry.register(ClusterEventType.LiveInstanceChange, dataRefresh, liveInstancePipeline, rebalancePipeline, externalViewPipeline);
registry.register(ClusterEventType.MessageChange, dataRefresh, rebalancePipeline);
registry.register(ClusterEventType.ExternalViewChange, dataRefresh);
registry.register(ClusterEventType.Resume, dataRefresh, rebalancePipeline, externalViewPipeline);
registry.register(ClusterEventType.PeriodicalRebalance, dataRefresh, rebalancePipeline, externalViewPipeline);
return registry;
}
}
Aggregations