All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spark.deploy.DeployMessage.scala Maven / Gradle / Ivy

The newest version!
package spark.deploy

import spark.deploy.ExecutorState.ExecutorState
import spark.deploy.master.{WorkerInfo, ApplicationInfo}
import spark.deploy.worker.ExecutorRunner
import scala.collection.immutable.List


private[spark] sealed trait DeployMessage extends Serializable

// Worker to Master

private[spark]
case class RegisterWorker(
    id: String,
    host: String,
    port: Int,
    cores: Int,
    memory: Int,
    webUiPort: Int,
    publicAddress: String)
  extends DeployMessage

private[spark] 
case class ExecutorStateChanged(
    appId: String,
    execId: Int,
    state: ExecutorState,
    message: Option[String],
    exitStatus: Option[Int])
  extends DeployMessage

private[spark] case class Heartbeat(workerId: String) extends DeployMessage

// Master to Worker

private[spark] case class RegisteredWorker(masterWebUiUrl: String) extends DeployMessage
private[spark] case class RegisterWorkerFailed(message: String) extends DeployMessage
private[spark] case class KillExecutor(appId: String, execId: Int) extends DeployMessage

private[spark] case class LaunchExecutor(
    appId: String,
    execId: Int,
    appDesc: ApplicationDescription,
    cores: Int,
    memory: Int,
    sparkHome: String)
  extends DeployMessage

// Client to Master

private[spark] case class RegisterApplication(appDescription: ApplicationDescription)
  extends DeployMessage

// Master to Client

private[spark] 
case class RegisteredApplication(appId: String) extends DeployMessage

private[spark] 
case class ExecutorAdded(id: Int, workerId: String, host: String, cores: Int, memory: Int)

private[spark]
case class ExecutorUpdated(id: Int, state: ExecutorState, message: Option[String],
                           exitStatus: Option[Int])

private[spark]
case class appKilled(message: String)

// Internal message in Client

private[spark] case object StopClient

// MasterWebUI To Master

private[spark] case object RequestMasterState

// Master to MasterWebUI

private[spark] 
case class MasterState(host: String, port: Int, workers: Array[WorkerInfo],
  activeApps: Array[ApplicationInfo], completedApps: Array[ApplicationInfo]) {

  def uri = "spark://" + host + ":" + port
}

//  WorkerWebUI to Worker
private[spark] case object RequestWorkerState

// Worker to WorkerWebUI

private[spark]
case class WorkerState(host: String, port: Int, workerId: String, executors: List[ExecutorRunner],
  finishedExecutors: List[ExecutorRunner], masterUrl: String, cores: Int, memory: Int, 
  coresUsed: Int, memoryUsed: Int, masterWebUiUrl: String)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy