| 2866 | |
| 2867 | |
| 2868 | void Master::sendFrameworkUpdates(const Framework& framework) |
| 2869 | { |
| 2870 | LOG(INFO) << "Sending a FRAMEWORK_UPDATED event for framework " << framework |
| 2871 | << " to all subscribers and broadcasting its up-to-date" |
| 2872 | << " FrameworkInfo and PID to all registered agents"; |
| 2873 | |
| 2874 | if (!subscribers.subscribed.empty()) { |
| 2875 | subscribers.send( |
| 2876 | protobuf::master::event::createFrameworkUpdated(framework)); |
| 2877 | } |
| 2878 | |
| 2879 | // Broadcast the new framework info and pid to all the slaves. We have to do |
| 2880 | // this upon frameworkInfo/pid updates because an executor might be running |
| 2881 | // on a slave but it currently isn't running any tasks. |
| 2882 | foreachvalue (Slave* slave, slaves.registered) { |
| 2883 | UpdateFrameworkMessage message; |
| 2884 | message.mutable_framework_id()->CopyFrom(framework.id()); |
| 2885 | |
| 2886 | // TODO(anand): We set 'pid' to UPID() for http frameworks |
| 2887 | // as 'pid' was made optional in 0.24.0. In 0.25.0, we |
| 2888 | // no longer have to set pid here for http frameworks. |
| 2889 | message.set_pid(framework.pid().getOrElse(UPID())); |
| 2890 | message.mutable_framework_info()->CopyFrom(framework.info); |
| 2891 | send(slave->pid, message); |
| 2892 | } |
| 2893 | } |
| 2894 | |
| 2895 | |
| 2896 | void Master::subscribe( |
nothing calls this directly
no test coverage detected