zoukankan      html  css  js  c++  java
  • Spark application注册master机制

    直接上Master类的代码:

     case RegisterApplication(description) => {
          if (state == RecoveryState.STANDBY) {
            // ignore, don't send response
          } else {
            logInfo("Registering app " + description.name)
            val app = createApplication(description, sender)
            registerApplication(app)
            logInfo("Registered app " + description.name + " with ID " + app.id)
            persistenceEngine.addApplication(app)
            sender ! RegisteredApplication(app.id, masterUrl)
            schedule()
          }
        }

    代码很直白-》

    1:如果是(standby)备用master节点的话那么SparkDeploySchedulerBakend注册过来后什么都不做!

    2:如果是active master的话就会根据standalone启动jar包时配置的参数(传递过来后被封装成ApplicationDescription对象),映射到ApplicationInfo中,并添加到app集合中;

    3:sender ! RegisteredApplication(app.id, masterUrl)就是多个Actor之间的通信机制,相当于SparkDeploySchedulerBakend注册到master后的反注册动作;

  • 相关阅读:
    接口型模式
    spring-cloud-config安全问题
    适配器模式
    spring boot + quartz 集群
    LeetCode Weekly Contest 147
    LeetCode Weekly Contest 146
    LeetCode Weekly Contest 144
    LeetCode Weekly Contest 143
    LeetCode Weekly Contest 142
    LeetCode Weekly Contest 141
  • 原文地址:https://www.cnblogs.com/zzq-include/p/8681862.html
Copyright © 2011-2022 走看看