set maximizeresourceallocation=true在sparkscala的emr集群级别编程实现

moiiocjp  于 2021-07-14  发布在  Spark
关注(0)|答案(1)|浏览(377)

我试图找到一种方法来设置spark scala中emr集群级别的maximizeresourceallocation=true属性。我在spark submit命令中使用了--conf maximizeresourceallocation=true参数,但看起来没有任何效果。

ogq8wdun

ogq8wdun1#

下面的代码有助于在集群级别设置配置

import java.util
 val sparkProperties = new util.HashMap[String, String]
 sparkProperties.put("maximizeResourceAllocation", "true")
 val sparkConfiguration = new Configuration().withClassification("spark").withProperties(sparkProperties)

 new RunJobFlowRequest()
  .withAdditionalInfo(additionalInfoStr)
  .withApplications(spark)
  ...... 
  .withConfigurations(sparkConfiguration)

相关问题