1. 程式人生 > >2.1.4、SparkEnv中創建BroadcastManager

2.1.4、SparkEnv中創建BroadcastManager

sync color clas actor man zed nag ive call

在SparkEnv中創建BroadcastManager,

// 此處只是聲明, 只有調用initialize, 才會生效
val broadcastManager = new BroadcastManager(isDriver, conf, securityManager)

initialize()

  // Called by SparkContext or Executor before using Broadcast
  private def initialize() {
    synchronized {
      if (!initialized) {
        broadcastFactory 
= new TorrentBroadcastFactory broadcastFactory.initialize(isDriver, conf, securityManager) initialized = true } } }

2.1.4、SparkEnv中創建BroadcastManager