Tez分析

Tez相关类

AMNodeImpl

.addTransition(AMNodeState.ACTIVE, AMNodeState.UNHEALTHY, 
               AMNodeEventType.N_TURNED_UNHEALTHY,     
               new NodeTurnedUnhealthyTransition())

Node状态变化

生产者
AMRMClientAsyncImpl.HeartbeatThread.run()
    ->AMRMClientImpl.allocate()
    ->ApplicationMasterProtocolPBClientImpl.allocate()
    ->ApplicationMasterProtocolPBServiceImpl.allocate()
  
Resourcemanager
ApplicationMasterProtocolPBServiceImpl.allocate()
	->ApplicationMasterService.allocate()

消费者
AMRMClientAsyncImpl.CallbackHandlerThread.run()
  ->YarnTaskSchedulerService.onNodesUpdated()
  ->TaskSchedulerContextImpl.nodesUpdated()
  ->TaskSchedulerManager.nodesUpdated()
  ->EventHandler.handle(new AMNodeEventStateChanged())
  ->AMContainerImpl.handle()
  ->AMContainerImpl.stateMachine

TezConfiguration

/**  * Boolean value. Enabled blacklisting of nodes of nodes that are considered faulty. These nodes  * will not be used to execute tasks.  */ 
@ConfigurationScope(Scope.AM) 
@ConfigurationProperty(type="boolean") 
public static final String TEZ_AM_NODE_BLACKLISTING_ENABLED = TEZ_AM_PREFIX + "node-blacklisting.enabled"; 
public static final boolean TEZ_AM_NODE_BLACKLISTING_ENABLED_DEFAULT = true;

ShuffleScheduler

/**  * Boolean value. Enabled blacklisting of nodes of nodes that are considered faulty. These nodes  * will not be used to execute tasks.  */ 
@ConfigurationScope(Scope.AM) 
@ConfigurationProperty(type="boolean") 
public static final String TEZ_AM_NODE_BLACKLISTING_ENABLED = TEZ_AM_PREFIX + "node-blacklisting.enabled"; 
public static final boolean TEZ_AM_NODE_BLACKLISTING_ENABLED_DEFAULT = true;

VertexImpl

public VertexConfigImpl(Configuration conf) {  
	this.maxFailedTaskAttempts = conf.getInt(TezConfiguration.TEZ_AM_TASK_MAX_FAILED_ATTEMPTS,      TezConfiguration.TEZ_AM_TASK_MAX_FAILED_ATTEMPTS_DEFAULT);  		
  	this.taskRescheduleHigherPriority =      conf.getBoolean(TezConfiguration.TEZ_AM_TASK_RESCHEDULE_HIGHER_PRIORITY,          TezConfiguration.TEZ_AM_TASK_RESCHEDULE_HIGHER_PRIORITY_DEFAULT);  		
  	this.taskRescheduleRelaxedLocality =      conf.getBoolean(TezConfiguration.TEZ_AM_TASK_RESCHEDULE_RELAXED_LOCALITY,          TezConfiguration.TEZ_AM_TASK_RESCHEDULE_RELAXED_LOCALITY_DEFAULT); 
  	this.maxAllowedOutputFailures = conf.getInt(TezConfiguration      .TEZ_TASK_MAX_ALLOWED_OUTPUT_FAILURES, TezConfiguration      .TEZ_TASK_MAX_ALLOWED_OUTPUT_FAILURES_DEFAULT); 
	this.maxAllowedOutputFailuresFraction = conf.getDouble(TezConfiguration.TEZ_TASK_MAX_ALLOWED_OUTPUT_FAILURES_FRACTION, TezConfiguration.TEZ_TASK_MAX_ALLOWED_OUTPUT_FAILURES_FRACTION_DEFAULT); 
	this.maxAllowedTimeForTaskReadErrorSec = conf.getInt(      TezConfiguration.TEZ_AM_MAX_ALLOWED_TIME_FOR_TASK_READ_ERROR_SEC,      TezConfiguration.TEZ_AM_MAX_ALLOWED_TIME_FOR_TASK_READ_ERROR_SEC_DEFAULT);}

TaskAttemptImpl

.addTransition(    TaskAttemptStateInternal.SUBMITTED,    EnumSet.of(TaskAttemptStateInternal.FAIL_IN_PROGRESS,        TaskAttemptStateInternal.SUBMITTED),    TaskAttemptEventType.TA_OUTPUT_FAILED,    new OutputReportedFailedTransition())

TaskAttemptImpl.OutputReportedFailedTransition()

TezContainerLauncherImpl

启动任务,运行在ApplicationMaster上

posted @ 2021-12-10 11:27  Yu\.W  阅读(152)  评论(0编辑  收藏  举报