您好,登錄后才能下訂單哦!
作者 | 白松
注:本文為原創,引用轉載需與數瀾聯系。
功能:Basic service interface shared by both CentralizedServiceMaster and CentralizedServiceWorker.
cdn.xitu.io/2019/7/19/16c08d3d927c9e2a?w=640&h=291&f=png&s=61631">
功能:At most, there will be one active master at a time, but many threads can be trying to be the active master.
功能:All workers should have access to this centralized service to execute the following methods.
功能:Zookeeper-based implementation of CentralizedService.
功能:ZooKeeper-based implementation of CentralizedServiceMaster.
功能:ZooKeeper-based implementation of CentralizedServiceWorker.
BspServiceWorker類有WorkerClient和WorkerServer實例,分別作為IPC通信的客戶端和服務器端,通過Netty來發送數據。WorkerClient實例實際為NettyWorkerClient對象,WorkerServert實例實際為NettyWorkerServer對象。
NettyWorkerClient implements WorkerClient接口,NettyWorkerServer implements WorkerServer接口。
NettyWorkerServer類的構造方法中創建一個NettyServer對象,用于底層的IPC的通信,還有一個ServerData對象,作為數據實體。ServerData中包含該Worker的partitionStore、edgeStore、incomingMessageStore、currentMessageStore、聚集值等。
NettyWorkerClient類的構造方法中創建一個NettyClient對象,用于底層的IPC的通信,作為客戶端。
功能:用于加載頂點或邊 輸入splits,每個線程都有一個WorkerClientRequestProcessor實例(實為 NettyWorkerClientRequestProcessor對象),負責向遠端的worker發送數據。
NettyWorkerClientRequestProcessor對象用于發送的WorkerClient對象就是BspServiceWorker里面的WorkerClient對象。
VertexInputSplitsCallable類中的readInputSplit()方法用來從split中讀取頂點的信息,然后調用NettyWorkerClientRequestProcessor對象的sendVertexRequest()方法把頂點發送到它所屬的Partition上。
在該對象中完成“計算-通信-同步”的過程。每個線程都有一個WorkerClientRequestProcessor實例(實為 NettyWorkerClientRequestProcessor對象),負責向遠端的worker發送數據。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。