关注 spark技术分享,
撸spark源码 玩spark最佳实践

YarnSparkHadoopUtil

YarnSparkHadoopUtil

YarnSparkHadoopUtil is…​FIXME

YarnSparkHadoopUtil can only be created when SPARK_YARN_MODE flag is enabled.

Note
YarnSparkHadoopUtil belongs to org.apache.spark.deploy.yarn package.
Tip

Enable DEBUG logging level for org.apache.spark.deploy.yarn.YarnSparkHadoopUtil logger to see what happens inside.

Add the following line to conf/log4j.properties:

Refer to Logging.

startCredentialUpdater Method

Caution
FIXME

Getting YarnSparkHadoopUtil Instance — get Method

Caution
FIXME

addPathToEnvironment Method

Caution
FIXME

startExecutorDelegationTokenRenewer

Caution
FIXME

stopExecutorDelegationTokenRenewer

Caution
FIXME

getApplicationAclsForYarn Method

Caution
FIXME

MEMORY_OVERHEAD_FACTOR

MEMORY_OVERHEAD_FACTOR is a constant that equals to 10% for memory overhead.

MEMORY_OVERHEAD_MIN

MEMORY_OVERHEAD_MIN is a constant that equals to 384L for memory overhead.

Resolving Environment Variable — expandEnvironment Method

expandEnvironment resolves environment variable using YARN’s Environment.$ or Environment.$$ methods (depending on the version of Hadoop used).

Computing YARN’s ContainerId — getContainerId Method

getContainerId is a private[spark] method that gets YARN’s ContainerId from the YARN environment variable ApplicationConstants.Environment.CONTAINER_ID and converts it to the return object using YARN’s ConverterUtils.toContainerId.

Calculating Initial Number of Executors — getInitialTargetExecutorNumber Method

getInitialTargetExecutorNumber calculates the initial number of executors for Spark on YARN. It varies by whether dynamic allocation is enabled or not.

Note
The default number of executors (aka DEFAULT_NUMBER_EXECUTORS) is 2.

With dynamic allocation enabled, getInitialTargetExecutorNumber is spark.dynamicAllocation.initialExecutors or spark.dynamicAllocation.minExecutors to fall back to 0 if the others are undefined.

With dynamic allocation disabled, getInitialTargetExecutorNumber is the value of spark.executor.instances property or SPARK_EXECUTOR_INSTANCES environment variable, or the default value (of the input parameter numExecutors) 2.

Note
getInitialTargetExecutorNumber is used to calculate totalExpectedExecutors to start Spark on YARN in client or cluster modes.
赞(0) 打赏
未经允许不得转载:spark技术分享 » YarnSparkHadoopUtil
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏