MCPcopy Create free account
hub / github.com/apache/mesos / sendFrameworkUpdates

Method sendFrameworkUpdates

src/master/master.cpp:2868–2893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2866
2867
2868void 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
2896void Master::subscribe(

Callers

nothing calls this directly

Calls 10

createFrameworkUpdatedFunction · 0.85
CopyFromMethod · 0.80
getOrElseMethod · 0.80
foreachvalueFunction · 0.70
sendMethod · 0.65
UPIDClass · 0.50
sendFunction · 0.50
emptyMethod · 0.45
idMethod · 0.45
pidMethod · 0.45

Tested by

no test coverage detected