@ GuardedBy ( "workerInfo" ) private void processWorkerAddedBlocks ( MasterWorkerInfo workerInfo , Map < String , List < Long > > addedBlockIds ) { for ( Map . Entry < String , List < Long > > entry : addedBlockIds . entrySet ( ) ) { for ( long blockId : entry . getValue ( ) ) { try ( LockResource lr = lockBlock ( blockId ) ) { Optional < BlockMeta > block = mBlockStore . getBlock ( blockId ) ; if ( block . isPresent ( ) ) { workerInfo . addBlock ( blockId ) ; mBlockStore . addLocation ( blockId , BlockLocation . newBuilder ( ) . setWorkerId ( workerInfo . getId ( ) ) . setTier ( entry . getKey ( ) ) . build ( ) ) ; mLostBlocks . remove ( blockId ) ; } else { LOG . warn ( "Invalid block: {} from worker {}." , blockId , workerInfo . getWorkerAddress ( ) . getHost ( ) ) ; } } } } }
Updates the worker and block metadata for blocks added to a worker .