spark 2.1 ExecutorData and ExecutorInfo

来源:互联网 发布:坚持30秒 h5 源码 编辑:程序博客网 时间:2024/06/03 17:10
  • ExecutorData
/** * Grouping of data for an executor used by CoarseGrainedSchedulerBackend. * * @param executorEndpoint The RpcEndpointRef representing this executor * @param executorAddress The network address of this executor * @param executorHost The hostname that this executor is running on * @param freeCores  The current number of cores available for work on the executor * @param totalCores The total number of cores available to the executor */private[cluster] class ExecutorData(   val executorEndpoint: RpcEndpointRef,   val executorAddress: RpcAddress,   override val executorHost: String,   var freeCores: Int,   override val totalCores: Int,   override val logUrlMap: Map[String, String]) extends ExecutorInfo(executorHost, totalCores, logUrlMap)
  • ExecutorInfo
/** * :: DeveloperApi :: * Stores information about an executor to pass from the scheduler to SparkListeners. */@DeveloperApiclass ExecutorInfo(   val executorHost: String,   val totalCores: Int,   val logUrlMap: Map[String, String]) {  def canEqual(other: Any): Boolean = other.isInstanceOf[ExecutorInfo]  override def equals(other: Any): Boolean = other match {    case that: ExecutorInfo =>      (that canEqual this) &&        executorHost == that.executorHost &&        totalCores == that.totalCores &&        logUrlMap == that.logUrlMap    case _ => false  }  override def hashCode(): Int = {    val state = Seq(executorHost, totalCores, logUrlMap)    state.map(_.hashCode()).foldLeft(0)((a, b) => 31 * a + b)  }}
0 0
原创粉丝点击