use of org.apache.hadoop.hdds.scm.node.HealthyReadOnlyNodeHandler in project ozone by apache.
the class StorageContainerManager method initializeEventHandlers.
private void initializeEventHandlers() {
CloseContainerEventHandler closeContainerHandler = new CloseContainerEventHandler(pipelineManager, containerManager, scmContext);
NodeReportHandler nodeReportHandler = new NodeReportHandler(scmNodeManager);
PipelineReportHandler pipelineReportHandler = new PipelineReportHandler(scmSafeModeManager, pipelineManager, scmContext, configuration);
CommandStatusReportHandler cmdStatusReportHandler = new CommandStatusReportHandler();
NewNodeHandler newNodeHandler = new NewNodeHandler(pipelineManager, scmDecommissionManager, configuration, serviceManager);
StaleNodeHandler staleNodeHandler = new StaleNodeHandler(scmNodeManager, pipelineManager, configuration);
DeadNodeHandler deadNodeHandler = new DeadNodeHandler(scmNodeManager, pipelineManager, containerManager);
StartDatanodeAdminHandler datanodeStartAdminHandler = new StartDatanodeAdminHandler(scmNodeManager, pipelineManager);
ReadOnlyHealthyToHealthyNodeHandler readOnlyHealthyToHealthyNodeHandler = new ReadOnlyHealthyToHealthyNodeHandler(configuration, serviceManager);
HealthyReadOnlyNodeHandler healthyReadOnlyNodeHandler = new HealthyReadOnlyNodeHandler(scmNodeManager, pipelineManager, configuration);
ContainerActionsHandler actionsHandler = new ContainerActionsHandler();
ContainerReportHandler containerReportHandler = new ContainerReportHandler(scmNodeManager, containerManager, scmContext, configuration);
IncrementalContainerReportHandler incrementalContainerReportHandler = new IncrementalContainerReportHandler(scmNodeManager, containerManager, scmContext);
PipelineActionHandler pipelineActionHandler = new PipelineActionHandler(pipelineManager, scmContext, configuration);
CRLStatusReportHandler crlStatusReportHandler = new CRLStatusReportHandler(certificateStore, configuration);
eventQueue.addHandler(SCMEvents.DATANODE_COMMAND, scmNodeManager);
eventQueue.addHandler(SCMEvents.RETRIABLE_DATANODE_COMMAND, scmNodeManager);
eventQueue.addHandler(SCMEvents.NODE_REPORT, nodeReportHandler);
// Use the same executor for both ICR and FCR.
// The Executor maps the event to a thread for DN.
// Dispatcher should always dispatch FCR first followed by ICR
List<ThreadPoolExecutor> executors = FixedThreadPoolWithAffinityExecutor.initializeExecutorPool(SCMEvents.CONTAINER_REPORT.getName() + "_OR_" + SCMEvents.INCREMENTAL_CONTAINER_REPORT.getName());
EventExecutor<ContainerReportFromDatanode> containerReportExecutors = new FixedThreadPoolWithAffinityExecutor<>(EventQueue.getExecutorName(SCMEvents.CONTAINER_REPORT, containerReportHandler), executors);
EventExecutor<IncrementalContainerReportFromDatanode> incrementalReportExecutors = new FixedThreadPoolWithAffinityExecutor<>(EventQueue.getExecutorName(SCMEvents.INCREMENTAL_CONTAINER_REPORT, incrementalContainerReportHandler), executors);
eventQueue.addHandler(SCMEvents.CONTAINER_REPORT, containerReportExecutors, containerReportHandler);
eventQueue.addHandler(SCMEvents.INCREMENTAL_CONTAINER_REPORT, incrementalReportExecutors, incrementalContainerReportHandler);
eventQueue.addHandler(SCMEvents.CONTAINER_ACTIONS, actionsHandler);
eventQueue.addHandler(SCMEvents.CLOSE_CONTAINER, closeContainerHandler);
eventQueue.addHandler(SCMEvents.NEW_NODE, newNodeHandler);
eventQueue.addHandler(SCMEvents.STALE_NODE, staleNodeHandler);
eventQueue.addHandler(SCMEvents.HEALTHY_READONLY_TO_HEALTHY_NODE, readOnlyHealthyToHealthyNodeHandler);
eventQueue.addHandler(SCMEvents.HEALTHY_READONLY_NODE, healthyReadOnlyNodeHandler);
eventQueue.addHandler(SCMEvents.DEAD_NODE, deadNodeHandler);
eventQueue.addHandler(SCMEvents.START_ADMIN_ON_NODE, datanodeStartAdminHandler);
eventQueue.addHandler(SCMEvents.CMD_STATUS_REPORT, cmdStatusReportHandler);
eventQueue.addHandler(SCMEvents.DELETE_BLOCK_STATUS, (DeletedBlockLogImpl) scmBlockManager.getDeletedBlockLog());
eventQueue.addHandler(SCMEvents.PIPELINE_ACTIONS, pipelineActionHandler);
eventQueue.addHandler(SCMEvents.PIPELINE_REPORT, pipelineReportHandler);
eventQueue.addHandler(SCMEvents.CRL_STATUS_REPORT, crlStatusReportHandler);
}
Aggregations