getting number of visible nodes in PySpark

前端 未结 5 676
长发绾君心
长发绾君心 2020-12-24 07:49

I\'m running some operations in PySpark, and recently increased the number of nodes in my configuration (which is on Amazon EMR). However, even though I tripled the number

5条回答
  •  温柔的废话
    2020-12-24 08:29

    It should be possible to get the number of nodes in the cluster using this (similar to @Dan's method above, but shorter and works better!).

    sc._jsc.sc().getExecutorMemoryStatus().keySet().size()
    

提交回复
热议问题