17 #ifndef __MASTER_HPP__ 18 #define __MASTER_HPP__ 99 class ObjectApprovers;
117 struct BoundedRateLimiter;
127 const MachineID& _machineId,
128 const std::string& _version,
129 std::vector<SlaveInfo::Capability> _capabilites,
131 std::vector<Resource> _checkpointedResources,
133 std::vector<ExecutorInfo> executorInfos = std::vector<ExecutorInfo>(),
134 std::vector<Task> tasks = std::vector<Task>());
139 const FrameworkID& frameworkId,
140 const TaskID& taskId)
const;
142 void addTask(Task* task);
150 void recoverResources(Task* task);
152 void removeTask(Task* task);
156 void recoverResources(
Operation* operation);
158 void removeOperation(
Operation* operation);
166 void markOperationAsOrphan(
Operation* operation);
168 Operation* getOperation(
const UUID& uuid)
const;
170 void addOffer(Offer* offer);
172 void removeOffer(Offer* offer);
174 void addInverseOffer(InverseOffer* inverseOffer);
176 void removeInverseOffer(InverseOffer* inverseOffer);
179 const FrameworkID& frameworkId,
180 const ExecutorID& executorId)
const;
183 const FrameworkID& frameworkId,
184 const ExecutorInfo& executorInfo);
187 const FrameworkID& frameworkId,
188 const ExecutorID& executorId);
190 void apply(
const std::vector<ResourceConversion>& conversions);
193 const SlaveInfo& info,
194 const std::string& _version,
195 const std::vector<SlaveInfo::Capability>& _capabilites,
350 return stream << slave.
id <<
" at " << slave.
pid 351 <<
" (" << slave.
info.hostname() <<
")";
364 const Option<std::shared_ptr<process::RateLimiter>>&
373 const MasterInfo& masterInfo,
const Registry& registry);
376 void submitScheduler(
377 const std::string&
name);
379 void registerFramework(
381 RegisterFrameworkMessage&& registerFrameworkMessage);
383 void reregisterFramework(
385 ReregisterFrameworkMessage&& reregisterFrameworkMessage);
387 void unregisterFramework(
389 const FrameworkID& frameworkId);
391 void deactivateFramework(
393 const FrameworkID& frameworkId);
396 void resourceRequest(
398 const FrameworkID& frameworkId,
399 const std::vector<Request>& requests);
403 LaunchTasksMessage&& launchTasksMessage);
407 const FrameworkID& frameworkId,
408 const std::vector<std::string>& role);
412 const FrameworkID& frameworkId,
413 const TaskID& taskId);
415 void statusUpdateAcknowledgement(
417 StatusUpdateAcknowledgementMessage&& statusUpdateAcknowledgementMessage);
419 void schedulerMessage(
421 FrameworkToExecutorMessage&& frameworkToExecutorMessage);
423 void executorMessage(
425 ExecutorToFrameworkMessage&& executorToFrameworkMessage);
429 RegisterSlaveMessage&& registerSlaveMessage);
433 ReregisterSlaveMessage&& incomingMessage);
435 void unregisterSlave(
437 const SlaveID& slaveId);
440 StatusUpdateMessage&& statusUpdateMessage);
444 ReconcileTasksMessage&& reconcileTasksMessage);
446 void updateOperationStatus(
447 UpdateOperationStatusMessage&&
update);
451 const SlaveID& slaveId,
452 const FrameworkID& frameworkId,
453 const ExecutorID& executorId,
456 void updateSlave(UpdateSlaveMessage&& message);
458 void updateUnavailability(
459 const MachineID& machineId,
475 const SlaveInfo& slave,
476 bool duringMasterFailover,
477 const std::string& message);
479 void markGone(
const SlaveID& slaveId,
const TimeInfo& goneTime);
488 void frameworkFailoverTimeout(
489 const FrameworkID& frameworkId,
493 const FrameworkID& frameworkId,
497 const FrameworkID& frameworkId,
526 const FrameworkID& frameworkId,
534 void agentReregisterTimeout(
const SlaveID& slaveId);
535 Nothing _agentReregisterTimeout(
const SlaveID& slaveId);
551 void exceededCapacity(
558 void recoveredSlavesTimeout(
const Registry& registry);
562 RegisterSlaveMessage&& registerSlaveMessage,
566 void __registerSlave(
568 RegisterSlaveMessage&& registerSlaveMessage,
571 void _reregisterSlave(
573 ReregisterSlaveMessage&& incomingMessage,
577 void __reregisterSlave(
579 ReregisterSlaveMessage&& incomingMessage,
582 void ___reregisterSlave(
584 ReregisterSlaveMessage&& incomingMessage,
587 void updateSlaveFrameworks(
589 const std::vector<FrameworkInfo>& frameworks);
599 const std::string&
path);
608 void reconcileKnownSlave(
610 const std::vector<ExecutorInfo>& executors,
611 const std::vector<Task>& tasks);
624 void recoverFramework(
const FrameworkInfo& info);
630 void connectAndActivateRecoveredFramework(
638 void failoverFramework(
645 void failoverFramework(
650 void _failoverFramework(
Framework* framework);
654 void removeFramework(
Framework* framework);
670 void updateFramework(
672 const FrameworkInfo& frameworkInfo,
673 ::mesos::scheduler::OfferConstraints&& offerConstraints,
676 void sendFrameworkUpdates(
const Framework& framework);
679 void deactivate(
Framework* framework,
bool rescind);
681 void disconnect(
Slave* slave);
685 void deactivate(
Slave* slave);
690 std::vector<Archive::Framework>&& completedFrameworks);
692 void _markUnreachable(
693 const SlaveInfo& slave,
694 const TimeInfo& unreachableTime,
695 bool duringMasterFailover,
696 const std::string& message,
697 bool registrarResult);
699 void sendSlaveLost(
const SlaveInfo& slaveInfo);
706 const std::string& message,
716 const std::string& removalCause,
731 const std::string& message,
736 const FrameworkInfo& frameworkInfo,
750 std::vector<authorization::ActionObject>&& actionObjects);
753 bool isLaunchExecutor (
754 const ExecutorID& executorId,
760 const ExecutorInfo& executorInfo,
765 void addTask(
const TaskInfo& task,
Framework* framework,
Slave* slave);
769 void updateTask(Task* task,
const StatusUpdate&
update);
775 void removeTask(Task* task,
bool unreachable =
false);
780 const FrameworkID& frameworkId,
781 const ExecutorID& executorId);
793 void updateOperation(
795 const UpdateOperationStatusMessage& update,
796 bool convertResources =
true);
799 void removeOperation(
Operation* operation);
802 void sendBulkOperationFeedback(
804 OperationState operationState,
805 const std::string& message);
818 const StatusUpdate& update,
823 void offerTimeout(
const OfferID& offerId);
841 void _removeOffer(
Framework* framework, Offer* offer);
844 void inverseOfferTimeout(
const OfferID& inverseOfferId);
847 void removeInverseOffer(InverseOffer* inverseOffer,
bool rescind =
false);
849 bool isCompletedFramework(
const FrameworkID& frameworkId)
const;
851 Framework* getFramework(
const FrameworkID& frameworkId)
const;
852 Offer*
getOffer(
const OfferID& offerId)
const;
855 FrameworkID newFrameworkId();
856 OfferID newOfferId();
857 SlaveID newSlaveId();
873 const std::string& message);
878 const std::string& message);
883 const std::string& message);
887 const mesos::scheduler::Call::Suppress& suppress,
888 const std::string& message);
892 const mesos::scheduler::Call::Revive& revive,
893 const std::string& message);
902 mesos::scheduler::Call::Subscribe&& subscribe);
906 FrameworkInfo&& frameworkInfo,
907 scheduler::OfferConstraints&& offerConstraints,
914 mesos::scheduler::Call::Subscribe&& subscribe);
918 FrameworkInfo&& frameworkInfo,
919 scheduler::OfferConstraints&& offerConstraints,
926 void updateFramework(
928 mesos::scheduler::Call::UpdateFramework&& call);
932 mesos::scheduler::Call::UpdateFramework&& call);
943 mesos::scheduler::Call::Accept&&
accept);
946 const FrameworkID& frameworkId,
947 const SlaveID& slaveId,
948 mesos::scheduler::Call::Accept&& accept);
950 void acceptInverseOffers(
952 const mesos::scheduler::Call::AcceptInverseOffers& accept);
956 mesos::scheduler::Call::Decline&& decline);
958 void declineInverseOffers(
960 const mesos::scheduler::Call::DeclineInverseOffers& decline);
966 void checkAndTransitionDrainingAgent(
Slave* slave);
970 const mesos::scheduler::Call::Revive& revive);
974 const mesos::scheduler::Call::Kill&
kill);
978 const mesos::scheduler::Call::Shutdown&
shutdown);
982 mesos::scheduler::Call::Acknowledge&& acknowledge);
984 void acknowledgeOperationStatus(
986 mesos::scheduler::Call::AcknowledgeOperationStatus&& acknowledge);
990 mesos::scheduler::Call::Reconcile&& reconcile);
992 void reconcileOperations(
994 mesos::scheduler::Call::ReconcileOperations&& reconcile);
998 mesos::scheduler::Call::Message&& message);
1002 const mesos::scheduler::Call::Request&
request);
1006 const mesos::scheduler::Call::Suppress& suppress);
1008 bool elected()
const 1010 return leader.isSome() && leader.get() == info_;
1013 void scheduleRegistryGc();
1015 void doRegistryGc();
1030 std::vector<std::string> knownRoles()
const;
1039 bool isWhitelistedRole(
const std::string& name)
const;
1045 struct RoleResourceBreakdown
1048 RoleResourceBreakdown(
const Master*
const master_,
const std::string& role_)
1049 :
master(master_), role(role_) {}
1058 const std::string role;
1067 Option<Error> validateFramework(
const FrameworkInfo& frameworkInfo)
const;
1079 explicit QuotaHandler(
Master* _master) :
master(_master)
1138 const std::vector<Resources>& agents,
1140 const mesos::quota::QuotaInfo& request);
1162 void rescindOffers(
const mesos::quota::QuotaInfo& request)
const;
1166 const std::string& role)
const;
1173 const mesos::quota::QuotaInfo&
quotaInfo)
const;
1177 const mesos::quota::QuotaConfig& quotaConfig)
const;
1184 const google::protobuf::RepeatedPtrField<mesos::quota::QuotaConfig>&
1185 quotaConfigs)
const;
1188 const mesos::quota::QuotaRequest& quotaRequest,
1193 const mesos::quota::QuotaInfo& quotaInfo,
1197 const std::string& role,
1202 const std::string& role)
const;
1217 class WeightsHandler
1220 explicit WeightsHandler(
Master* _master) :
master(_master)
1248 const WeightInfo& weight)
const;
1252 const std::vector<std::string>& roles)
const;
1255 const std::vector<WeightInfo>& weightInfos,
1256 const std::vector<bool>& roleAuthorizations)
const;
1264 const google::protobuf::RepeatedPtrField<WeightInfo>& weightInfos)
1268 const std::vector<WeightInfo>& weightInfos)
const;
1272 void rescindOffers(
const std::vector<WeightInfo>& weightInfos)
const;
1318 std::pair<process::http::Response, Option<PostProcessing>> frameworks(
1324 std::pair<process::http::Response, Option<PostProcessing>> roles(
1330 std::pair<process::http::Response, Option<PostProcessing>> slaves(
1336 std::pair<process::http::Response, Option<PostProcessing>> state(
1342 std::pair<process::http::Response, Option<PostProcessing>> stateSummary(
1348 std::pair<process::http::Response, Option<PostProcessing>> tasks(
1354 std::pair<process::http::Response, Option<PostProcessing>> getState(
1360 std::pair<process::http::Response, Option<PostProcessing>> getAgents(
1366 std::pair<process::http::Response, Option<PostProcessing>> getFrameworks(
1372 std::pair<process::http::Response, Option<PostProcessing>> getExecutors(
1378 std::pair<process::http::Response, Option<PostProcessing>> getOperations(
1384 std::pair<process::http::Response, Option<PostProcessing>> getTasks(
1390 std::pair<process::http::Response, Option<PostProcessing>>
getRoles(
1396 std::pair<process::http::Response, Option<PostProcessing>> subscribe(
1402 std::string serializeGetState(
1404 std::string serializeGetAgents(
1406 std::string serializeGetFrameworks(
1408 std::string serializeGetExecutors(
1410 std::string serializeGetOperations(
1412 std::string serializeGetTasks(
1414 std::string serializeGetRoles(
1416 std::string serializeSubscribe(
1419 std::function<void(JSON::ObjectWriter*)> jsonifyGetState(
1421 std::function<void(JSON::ObjectWriter*)> jsonifyGetAgents(
1423 std::function<void(JSON::ObjectWriter*)> jsonifyGetFrameworks(
1425 std::function<void(JSON::ObjectWriter*)> jsonifyGetExecutors(
1427 std::function<void(JSON::ObjectWriter*)> jsonifyGetOperations(
1429 std::function<void(JSON::ObjectWriter*)> jsonifyGetTasks(
1431 std::function<void(JSON::ObjectWriter*)> jsonifyGetRoles(
1433 std::function<void(JSON::ObjectWriter*)> jsonifySubscribe(
1446 readonlyHandler(_master),
1447 quotaHandler(_master),
1448 weightsHandler(_master) {}
1590 static std::string API_HELP();
1591 static std::string SCHEDULER_HELP();
1592 static std::string FLAGS_HELP();
1593 static std::string FRAMEWORKS_HELP();
1594 static std::string HEALTH_HELP();
1595 static std::string REDIRECT_HELP();
1596 static std::string ROLES_HELP();
1597 static std::string TEARDOWN_HELP();
1598 static std::string SLAVES_HELP();
1599 static std::string STATE_HELP();
1600 static std::string STATESUMMARY_HELP();
1601 static std::string TASKS_HELP();
1602 static std::string MAINTENANCE_SCHEDULE_HELP();
1603 static std::string MAINTENANCE_STATUS_HELP();
1604 static std::string MACHINE_DOWN_HELP();
1605 static std::string MACHINE_UP_HELP();
1606 static std::string CREATE_VOLUMES_HELP();
1607 static std::string DESTROY_VOLUMES_HELP();
1608 static std::string RESERVE_HELP();
1609 static std::string UNRESERVE_HELP();
1610 static std::string QUOTA_HELP();
1611 static std::string WEIGHTS_HELP();
1624 const size_t offset,
1625 const std::string& order,
1630 const FrameworkID&
id,
1635 const FrameworkID&
id)
const;
1638 const mesos::maintenance::Schedule&
schedule,
1643 const mesos::maintenance::Schedule& schedule,
1647 const mesos::maintenance::Schedule& schedule,
1648 bool applied)
const;
1650 mesos::maintenance::Schedule _getMaintenanceSchedule(
1657 const google::protobuf::RepeatedPtrField<MachineID>& machineIds,
1661 const google::protobuf::RepeatedPtrField<MachineID>& machineIds,
1665 const SlaveID& slaveId,
1667 const bool markGone,
1671 const SlaveID& slaveId,
1675 const SlaveID& slaveId,
1679 const SlaveID& slaveId,
1680 const google::protobuf::RepeatedPtrField<Resource>& source,
1681 const google::protobuf::RepeatedPtrField<Resource>& resources,
1686 const SlaveID& slaveId,
1687 const google::protobuf::RepeatedPtrField<Resource>& resources,
1692 const SlaveID& slaveId,
1693 const google::protobuf::RepeatedPtrField<Resource>& volumes,
1698 const SlaveID& slaveId,
1699 const google::protobuf::RepeatedPtrField<Resource>& volumes,
1720 const SlaveID& slaveId,
1870 static std::function<void(JSON::ObjectWriter*)> jsonifySubscribe(
1873 std::string serializeSubscribe(
1896 const SlaveID& slaveId)
const;
1900 const mesos::scheduler::Call::ReconcileOperations& call,
1909 QuotaHandler quotaHandler;
1913 WeightsHandler weightsHandler;
1932 ReadOnlyRequestHandler handler,
1938 void processRequestsBatch()
const;
1940 struct BatchedRequest
1942 ReadOnlyRequestHandler handler;
1950 mutable std::vector<BatchedRequest> batchedRequests;
1961 friend struct SlavesWriter;
1962 friend struct Subscriber;
2001 std::list<mesos::maintenance::Schedule> schedules;
2045 bool contains(
const SlaveID& slaveId)
const 2047 return ids.contains(slaveId);
2052 return pids.contains(pid);
2055 Slave*
get(
const SlaveID& slaveId)
const 2057 return ids.get(slaveId).getOrElse(
nullptr);
2062 return pids.get(pid).getOrElse(
nullptr);
2065 void put(
Slave* slave)
2067 CHECK_NOTNULL(slave);
2068 ids[slave->
id] = slave;
2072 void remove(
Slave* slave)
2074 CHECK_NOTNULL(slave);
2075 ids.erase(slave->
id);
2085 size_t size()
const {
return ids.size(); }
2090 iterator begin() {
return ids.begin(); }
2091 iterator end() {
return ids.end(); }
2093 const_iterator begin()
const {
return ids.begin(); }
2094 const_iterator end()
const {
return ids.end(); }
2172 Frameworks(
const Flags& masterFlags)
2173 : completed(masterFlags.max_completed_frameworks) {}
2202 Subscribers(
Master* _master,
size_t maxSubscribers)
2204 subscribed(maxSubscribers) {};
2217 "subscriber " +
stringify(http.streamId),
2220 event.set_type(mesos::master::Event::HEARTBEAT);
2226 approvers(_approvers) {}
2267 Subscribers subscribers;
2294 std::vector<std::string> authenticatorNames;
2307 int64_t nextFrameworkId;
2308 int64_t nextOfferId;
2309 int64_t nextSlaveId;
2315 std::shared_ptr<Metrics>
metrics;
2318 double _uptime_secs()
2325 return elected() ? 1 : 0;
2328 double _slaves_connected();
2329 double _slaves_disconnected();
2330 double _slaves_active();
2331 double _slaves_inactive();
2332 double _slaves_unreachable();
2336 double _const_slaves_connected()
const;
2337 double _const_slaves_disconnected()
const;
2338 double _const_slaves_active()
const;
2339 double _const_slaves_inactive()
const;
2340 double _const_slaves_unreachable()
const;
2342 double _frameworks_connected();
2343 double _frameworks_disconnected();
2344 double _frameworks_active();
2345 double _frameworks_inactive();
2347 double _outstanding_offers()
2349 return static_cast<double>(offers.size());
2352 double _event_queue_messages()
2354 return static_cast<double>(eventCount<process::MessageEvent>());
2357 double _event_queue_dispatches()
2359 return static_cast<double>(eventCount<process::DispatchEvent>());
2362 double _event_queue_http_requests()
2364 return static_cast<double>(eventCount<process::HttpEvent>());
2367 double _tasks_staging();
2368 double _tasks_starting();
2369 double _tasks_running();
2370 double _tasks_unreachable();
2371 double _tasks_killing();
2373 double _resources_total(
const std::string& name);
2374 double _resources_used(
const std::string& name);
2375 double _resources_percent(
const std::string& name);
2377 double _resources_revocable_total(
const std::string& name);
2378 double _resources_revocable_used(
const std::string& name);
2379 double _resources_revocable_percent(
const std::string& name);
2386 offerConstraintsFilterOptions;
2391 std::ostream& stream,
2418 const Flags& masterFlags,
2419 const FrameworkInfo& info,
2420 ::mesos::scheduler::OfferConstraints&& offerConstraints,
2426 const Flags& masterFlags,
2427 const FrameworkInfo& info,
2428 ::mesos::scheduler::OfferConstraints&& offerConstraints,
2434 const Flags& masterFlags,
2435 const FrameworkInfo& info);
2439 Task* getTask(
const TaskID& taskId);
2441 void addTask(Task* task);
2449 void recoverResources(Task* task);
2452 template <
typename Message>
2453 void send(
const Message& message);
2455 void addCompletedTask(Task&& task);
2457 void addUnreachableTask(
const Task& task);
2463 void removeTask(Task* task,
bool unreachable);
2465 void addOffer(Offer* offer);
2467 void removeOffer(Offer* offer);
2469 void addInverseOffer(InverseOffer* inverseOffer);
2471 void removeInverseOffer(InverseOffer* inverseOffer);
2473 bool hasExecutor(
const SlaveID& slaveId,
2474 const ExecutorID& executorId);
2476 void addExecutor(
const SlaveID& slaveId,
2477 const ExecutorInfo& executorInfo);
2479 void removeExecutor(
const SlaveID& slaveId,
2480 const ExecutorID& executorId);
2482 void addOperation(
Operation* operation);
2486 void recoverResources(
Operation* operation);
2488 void removeOperation(
Operation* operation);
2490 const FrameworkID id()
const;
2496 const FrameworkInfo& newInfo,
2497 ::mesos::scheduler::OfferConstraints&& offerConstraints);
2501 void updateConnection(
2505 void updateConnection(
2527 bool isTrackedUnderRole(
const std::string& role)
const;
2528 void trackUnderRole(
const std::string& role);
2529 void untrackUnderRole(
const std::string& role);
2542 const FrameworkInfo& frameworkInfo);
2550 return offerConstraints_;
2637 const Flags& masterFlags,
2638 const FrameworkInfo& _info,
2639 ::mesos::scheduler::OfferConstraints&& offerConstraints,
2658 void setState(
State state_);
2675 ::mesos::scheduler::OfferConstraints offerConstraints_;
2680 template <
typename Message>
2683 metrics.incrementEvent(message);
2686 LOG(WARNING) <<
"Master attempting to send message to disconnected" 2687 <<
" framework " << *
this;
2702 if (http_.isSome()) {
2703 if (!http_->send(message)) {
2704 LOG(WARNING) <<
"Unable to send message to framework " << *
this <<
":" 2705 <<
" connection closed";
2707 }
else if (pid().isSome()) {
2708 master->
send(pid().
get(), message);
2710 LOG(WARNING) <<
"Unable to send message to framework " << *
this <<
":" 2711 <<
" framework is recovered but has not reregistered";
2718 inline const FrameworkID Framework::id()
const 2726 std::ostream& stream,
2731 stream << framework.
id() <<
" (" << framework.
info.name() <<
")";
2734 stream <<
" at " << framework.
pid().
get();
2747 const std::string& _role)
2748 : master(_master), role(_role) {}
2752 frameworks[framework->
id()] = framework;
2757 frameworks.erase(framework->
id());
2774 mesos::master::Response::GetFrameworks::Framework
model(
2782 #endif // __MASTER_HPP__ Protocol< RecoverRequest, RecoverResponse > recover
ReadOnlyHandler(const Master *_master)
Definition: master.hpp:1315
hashmap< ResourceProviderID, ResourceProvider > resourceProviders
Definition: master.hpp:340
Per-framework allocator-specific options that are not part of FrameworkInfo.
Definition: allocator.hpp:147
Definition: nothing.hpp:16
hashmap< TaskID, Task * > tasks
Definition: master.hpp:2567
Definition: master.hpp:2742
Master *const master
Definition: master.hpp:2553
ContentType
Definition: http.hpp:43
hashmap< UUID, Operation * > operations
Definition: master.hpp:255
std::ostream & operator<<(std::ostream &stream, const Future< T > &future)
Definition: future.hpp:1826
Try< bool > update(const std::string &link, const Handle &parent, uint16_t protocol, const action::Mirror &mirror)
void finalize(bool finalize_wsa=false)
Clean up the library.
Try< Bytes > size(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:130
Future< Response > request(const Request &request, bool streamedResponse=false)
Asynchronously sends an HTTP request to the process and returns the HTTP response once the entire res...
SlaveInfo info
Definition: master.hpp:201
bool connected() const
Definition: master.hpp:2524
Definition: master.hpp:27
process::Owned< ObjectApprovers > approvers
Definition: master.hpp:1306
const SlaveID id
Definition: master.hpp:200
hashset< Offer * > offers
Definition: master.hpp:271
Option< process::Timer > reregistrationTimer
Definition: master.hpp:230
bool connected
Definition: master.hpp:217
const Option< StreamingHttpConnection< v1::scheduler::Event > > & http() const
Definition: master.hpp:2531
Definition: resource_quantities.hpp:63
bool initialize(const Option< std::string > &delegate=None(), const Option< std::string > &readwriteAuthenticationRealm=None(), const Option< std::string > &readonlyAuthenticationRealm=None())
Initialize the library.
Definition: allocator.hpp:98
Resources totalResources
Definition: master.hpp:297
constexpr Duration DEFAULT_HEARTBEAT_INTERVAL
Definition: constants.hpp:61
Definition: protobuf_utils.hpp:332
hashmap< SlaveID, Resources > offeredResources
Definition: master.hpp:2630
protobuf::framework::Capabilities capabilities
Definition: master.hpp:2559
const Option< process::UPID > & pid() const
Definition: master.hpp:2536
std::set< std::string > getRoles(const FrameworkInfo &frameworkInfo)
Definition: master.hpp:1302
Result< ProcessStatus > status(pid_t pid)
Definition: proc.hpp:166
InverseOffer * getInverseOffer(Master *master, const OfferID &offerId)
Try< Nothing > machines(const google::protobuf::RepeatedPtrField< MachineID > &ids)
Performs the following checks on a list of machines:
mesos::v1::scheduler::Call Call
Definition: mesos.hpp:2851
Definition: resources.hpp:83
Resources totalUsedResources
Definition: master.hpp:2622
Slave * getSlave(Master *master, const SlaveID &slaveId)
Definition: metrics.hpp:276
Definition: authorization.hpp:36
~Subscriber()
Definition: master.hpp:2240
Definition: registrar.hpp:88
void addFramework(Framework *framework)
Definition: master.hpp:2750
Option< Error > reregisterSlave(const ReregisterSlaveMessage &message)
Definition: master.hpp:1304
Operation
Definition: cgroups.hpp:444
Future< Nothing > redirect(int_fd from, Option< int_fd > to, size_t chunk=4096, const std::vector< lambda::function< void(const std::string &)>> &hooks={})
Redirect output from the 'from' file descriptor to the 'to' file descriptor (or /dev/null if 'to' is ...
Option< process::Time > estimatedDrainStartTime
Definition: master.hpp:316
hashmap< UUID, Operation * > operations
Definition: master.hpp:337
void send(const process::UPID &to, const google::protobuf::Message &message)
Definition: protobuf.hpp:126
bool isSome() const
Definition: option.hpp:116
Definition: event.hpp:209
hashmap< FrameworkID, hashmap< TaskID, Task * > > tasks
Definition: master.hpp:247
multihashmap< FrameworkID, TaskID > killedTasks
Definition: master.hpp:251
mesos::v1::scheduler::Event Event
Definition: mesos.hpp:2852
Definition: master.hpp:2405
Definition: hashmap.hpp:38
Option< UUID > resourceVersion
Definition: master.hpp:310
FrameworkMetrics metrics
Definition: master.hpp:2633
Definition: master.hpp:318
bool active() const
Definition: master.hpp:2522
Resources checkpointedResources
Definition: master.hpp:290
SlaveObserver * observer
Definition: master.hpp:312
Try< Nothing > unavailability(const Unavailability &unavailability)
An "untyped" PID, used to encapsulate the process ID for lower-layer abstractions (eg...
Definition: pid.hpp:39
BoundedHashMap< TaskID, process::Owned< Task > > unreachableTasks
Definition: master.hpp:2580
Definition: master.hpp:2210
process::Future< Nothing > removed(const std::string &link)
Variant< Subscribe > state
Definition: master.hpp:1312
bool recovered() const
Definition: master.hpp:2525
Result< std::vector< Filter< Classifier > > > filters(const std::string &_link, const Handle &parent)
Definition: internal.hpp:769
process::Time registeredTime
Definition: master.hpp:213
bool active
Definition: master.hpp:222
An abstraction for contending to be a leading master.
Definition: contender.hpp:40
std::set< std::string > roles
Definition: master.hpp:2557
const Master * master
Definition: master.hpp:2760
hashset< UUID > orphanedOperations
Definition: master.hpp:268
process::UPID pid
Definition: master.hpp:205
Definition: protobuf_utils.hpp:631
Option< process::Time > reregisteredTime
Definition: master.hpp:214
Definition: master.hpp:2409
process::Time reregisteredTime
Definition: master.hpp:2562
Master *const master
Definition: master.hpp:199
Option< Error > quotaInfo(const mesos::quota::QuotaInfo "aInfo)
const T & get() const &
Definition: option.hpp:119
const std::string role
Definition: master.hpp:2761
Protocol< PromiseRequest, PromiseResponse > promise
Definition: protobuf.hpp:108
process::Time registeredTime
Definition: master.hpp:2561
Try< int_fd > accept(int_fd s)
Definition: network.hpp:31
Definition: whitelist_watcher.hpp:37
void removeFramework(Framework *framework)
Definition: master.hpp:2755
MasterInfo info() const
Definition: master.hpp:512
StreamingHttpConnection< v1::master::Event > http
Definition: master.hpp:2249
UUID resourceVersion
Definition: master.hpp:333
FrameworkInfo info
Definition: master.hpp:2555
ResponseHeartbeater< mesos::master::Event, v1::master::Event > heartbeater
Definition: master.hpp:2250
bool exited(const UPID &from, const UPID &to)
Simulates disconnection of the link between 'from' and 'to' by sending an ExitedEvent to 'to'...
Definition: master.hpp:1299
Definition: boundedhashmap.hpp:27
Basic model of an allocator: resources are allocated to a framework in the form of offers...
Definition: allocator.hpp:172
const process::Owned< ObjectApprovers > approvers
Definition: master.hpp:2251
#define flags
Definition: decoder.hpp:18
Definition: attributes.hpp:24
hashset< InverseOffer * > inverseOffers
Definition: master.hpp:2584
Subscriber(const StreamingHttpConnection< v1::master::Event > &_http, const process::Owned< ObjectApprovers > &_approvers)
Definition: master.hpp:2212
Definition: executor.hpp:48
const MachineID machineId
Definition: master.hpp:203
Definition: master.hpp:122
constexpr size_t MAX_REMOVED_SLAVES
Definition: constants.hpp:93
hashset< InverseOffer * > inverseOffers
Definition: master.hpp:274
An abstraction of a Master detector which can be used to detect the leading master from a group...
Definition: detector.hpp:38
static Time now()
The current clock time for either the current process that makes this call or the global clock time i...
Resources totalResources
Definition: master.hpp:320
Definition: event.hpp:103
Definition: metrics.hpp:41
State
Definition: master.hpp:2399
Offer * getOffer(Master *master, const OfferID &offerId)
Try< Nothing > kill(const std::string &hierarchy, const std::string &cgroup, int signal)
hashmap< FrameworkID, Framework * > frameworks
Definition: master.hpp:2770
mesos::master::Response::GetFrameworks::Framework model(const Framework &framework)
process::Time unregisteredTime
Definition: master.hpp:2563
mesos::v1::scheduler::Response Response
Definition: mesos.hpp:2854
std::string version
Definition: master.hpp:208
URI http(const std::string &host, const std::string &path="/", const Option< int > &port=None(), const Option< std::string > &query=None(), const Option< std::string > &fragment=None(), const Option< std::string > &user=None(), const Option< std::string > &password=None())
Creates an http URI with the given parameters.
Definition: http.hpp:35
ResourceProviderInfo info
Definition: master.hpp:319
hashmap< FrameworkID, hashmap< ExecutorID, ExecutorInfo > > executors
Definition: master.hpp:237
hashset< Offer * > offers
Definition: master.hpp:2582
std::string stringify(int flags)
Definition: master.hpp:2397
protobuf::slave::Capabilities capabilities
Definition: master.hpp:211
hashmap< SlaveID, hashmap< ExecutorID, ExecutorInfo > > executors
Definition: master.hpp:2589
circular_buffer< process::Owned< Task > > completedTasks
Definition: master.hpp:2574
hashmap< OperationID, UUID > operationUUIDs
Definition: master.hpp:2597
hashmap< UUID, Operation * > operations
Definition: master.hpp:2593
Try< std::set< pid_t > > pids()
Definition: freebsd.hpp:62
hashmap< SlaveID, Resources > usedResources
Definition: master.hpp:2626
Resources totalOfferedResources
Definition: master.hpp:2629
Definition: master.hpp:355
PID< MetricsProcess > metrics
Resources offeredResources
Definition: master.hpp:281
const FrameworkID id() const
Definition: master.hpp:2718
constexpr const char * name
Definition: shell.hpp:41
hashmap< FrameworkID, Resources > usedResources
Definition: master.hpp:279
bool contains(const Resource &left, const Resource &right)
Try< std::vector< Value > > time(const std::string &hierarchy, const std::string &cgroup)
Try< Nothing > schedule(const mesos::maintenance::Schedule &schedule, const hashmap< MachineID, Machine > &machines)
Performs the following checks on the new maintenance schedule:
const ::mesos::scheduler::OfferConstraints & offerConstraints() const
Definition: master.hpp:2548
Option< Error > registerSlave(const RegisterSlaveMessage &message)
StreamingHttpConnection< v1::master::Event > connection
Definition: master.hpp:1307
Role(const Master *_master, const std::string &_role)
Definition: master.hpp:2746
Future< size_t > send(const int_fd &fd, const void *buf, size_t size)