spark 2.1 spark executor topology information
来源:互联网 发布:淘宝实拍保护怎么申请 编辑:程序博客网 时间:2024/05/21 22:31
BlockManagerMasterEndpoint return block manager id with topology information.
In register method, calls topologyMapper.getTopologyForHost(idWithoutTopologyInfo.host)
val id = BlockManagerId( idWithoutTopologyInfo.executorId, idWithoutTopologyInfo.host, idWithoutTopologyInfo.port, topologyMapper.getTopologyForHost(idWithoutTopologyInfo.host))
The defaule class of topologyMapper is DefaultTopologyMapper.
private val topologyMapper = { val topologyMapperClassName = conf.get( "spark.storage.replication.topologyMapper", classOf[DefaultTopologyMapper].getName) val clazz = Utils.classForName(topologyMapperClassName) val mapper = clazz.getConstructor(classOf[SparkConf]).newInstance(conf).asInstanceOf[TopologyMapper] logInfo(s"Using $topologyMapperClassName for getting topology information") mapper }
DefaultTopologyMapper. It assumes all nodes are in the same rack
@DeveloperApiclass DefaultTopologyMapper(conf: SparkConf) extends TopologyMapper(conf) with Logging { override def getTopologyForHost(hostname: String): Option[String] = { logDebug(s"Got a request for $hostname") None }}
TopologyMapper
/** * ::DeveloperApi:: * TopologyMapper provides topology information for a given host * @param conf SparkConf to get required properties, if needed */@DeveloperApiabstract class TopologyMapper(conf: SparkConf) { /** * Gets the topology information given the host name * * @param hostname Hostname * @return topology information for the given hostname. One can use a 'topology delimiter' * to make this topology information nested. * For example : ‘/myrack/myhost’, where ‘/’ is the topology delimiter, * ‘myrack’ is the topology identifier, and ‘myhost’ is the individual host. * This function only returns the topology information without the hostname. * This information can be used when choosing executors for block replication * to discern executors from a different rack than a candidate executor, for example. * * An implementation can choose to use empty strings or None in case topology info * is not available. This would imply that all such executors belong to the same rack. */ def getTopologyForHost(hostname: String): Option[String]}
FileBasedTopologyMapper
/** * A simple file based topology mapper. This expects topology information provided as a * [[java.util.Properties]] file. The name of the file is obtained from SparkConf property * `spark.storage.replication.topologyFile`. To use this topology mapper, set the * `spark.storage.replication.topologyMapper` property to * [[org.apache.spark.storage.FileBasedTopologyMapper]] * @param conf SparkConf object */@DeveloperApiclass FileBasedTopologyMapper(conf: SparkConf) extends TopologyMapper(conf) with Logging { val topologyFile = conf.getOption("spark.storage.replication.topologyFile") require(topologyFile.isDefined, "Please specify topology file via " + "spark.storage.replication.topologyFile for FileBasedTopologyMapper.") val topologyMap = Utils.getPropertiesFromFile(topologyFile.get) override def getTopologyForHost(hostname: String): Option[String] = { val topology = topologyMap.get(hostname) if (topology.isDefined) { logDebug(s"$hostname -> ${topology.get}") } else { logWarning(s"$hostname does not have any topology information") } topology }}
0 0
- spark 2.1 spark executor topology information
- Spark-executor
- Spark Executor
- spark executor
- Spark executor.memory
- Spark Executor 长时间空闲
- Spark Executor on YARN
- spark core 2.0 Executor
- spark executor内幕解密
- Spark维护Executor列表
- Spark Executor原理
- Spark EXecutor彻底解密
- spark动态分配executor
- jmx监控spark executor配置
- spark中的动态executor分配
- spark core 2.0 Executor ClassLoader
- spark core 2.0 Executor Heartbeat
- spark Lost executor on YARN
- PE文件结构详解(四)PE导入表
- Openfire集成Sip服务器
- Android 开机启动广播
- 系统间通信:基于TCP协议的RPC实现范例
- ViewGroup之removeAllViews方法‘失效’问题总结(帧动画的坑)
- spark 2.1 spark executor topology information
- Spring WebSocket 初探
- 使用射线法判断echarts上地图中的点是否在地图范围中
- linux系统调用的三种方法
- 错误 Apple Mach-O Linker Error
- linux命令之history
- PE文件结构详解(五)延迟导入表
- linux下的mysql 的安装
- iOS 开发的一些权限问题