spark 2.1 BlockManagerId
2017-05-11 14:19
447 查看
When block manager is created, it will generate a id without topology information.
and register itself with the block manager master.
the block manager master will return a id, and it will use this id if the id is not null.
BlockManagerMasterEndpoint.register method
and register itself with the block manager master.
the block manager master will return a id, and it will use this id if the id is not null.
val id = BlockManagerId(executorId, blockTransferService.hostName, blockTransferService.port, None) val idFromMaster = master.registerBlockManager( id, maxMemory, slaveEndpoint) blockManagerId = if (idFromMaster != null) idFromMaster else id
BlockManagerMasterEndpoint.register method
private def register( idWithoutTopologyInfo: BlockManagerId, maxMemSize: Long, slaveEndpoint: RpcEndpointRef): BlockManagerId = { // the dummy id is not expected to contain the topology information. // we get that info here and respond back with a more fleshed out block manager id val id = BlockManagerId( idWithoutTopologyInfo.executorId, idWithoutTopologyInfo.host, idWithoutTopologyInfo.port, topologyMapper.getTopologyForHost(idWithoutTopologyInfo.host)) val time = System.currentTimeMillis() if (!blockManagerInfo.contains(id)) { blockManagerIdByExecutor.get(id.executorId) match { case Some(oldId) => // A block manager of the same executor already exists, so remove it (assumed dead) logError("Got two different block manager registrations on same executor - " + s" will replace old one $oldId with new one $id") removeExecutor(id.executorId) case None => } logInfo("Registering block manager %s with %s RAM, %s".format( id.hostPort, Utils.bytesToString(maxMemSize), id)) blockManagerIdByExecutor(id.executorId) = id blockManagerInfo(id) = new BlockManagerInfo( id, System.currentTimeMillis(), maxMemSize, slaveEndpoint) } listenerBus.post(SparkListenerBlockManagerAdded(time, id, maxMemSize)) id }
相关文章推荐
- spark 2.1 BlockManagerSlaveEndpoint
- spark 2.1 BlockManagerInfo
- spark 2.1 metrics Source and BlockManagerSource
- [Spark性能调优] 源码补充 : Spark 2.1.X 中 Unified 和 Static MemoryManager
- Spark blockmanager架构
- spark core 2.0 BlockManager putBlockData
- Spark BlockManager的通信及内存占用分析(源码阅读九)
- spark 2.1 Encoders and UploadBlock
- spark 2.1 NettyBlockRpcServer use stream to open block
- spark 2.1 DiskBlockObjectWriter
- Spark源码分析 – BlockManager
- Spark源码学习1.8——ShuffleBlockManager.scala
- spark core 2.0 BlockInfo And BlockInfoManager
- spark core 2.0 DiskBlockManager
- Spark源码学习1.5——BlockManager.scala
- spark 2.1 BlockManagerMasterEndpoint
- 深入理解Spark 2.1 Core (五):Standalone模式运行的原理与源码分析
- spark1.6升级spark2.1时候sparkstreaming程序问题总结2018
- Spark MLlib Deep Learning Deep Belief Network (深度学习-深度信念网络)2.1
- Enterprise Manager Database Control Configuration - Errors Due to CA Expiry (文档 ID 1222603.1)