17 #ifndef __MESOS_V1_HPP__ 18 #define __MESOS_V1_HPP__ 24 #include <boost/functional/hash.hpp> 26 #include <mesos/v1/mesos.pb.h> 45 bool operator==(
const CommandInfo& left,
const CommandInfo& right);
46 bool operator==(
const CommandInfo::URI& left,
const CommandInfo::URI& right);
47 bool operator==(
const ContainerInfo& left,
const ContainerInfo& right);
48 bool operator==(
const Credential& left,
const Credential& right);
49 bool operator==(
const CSIPluginInfo& left,
const CSIPluginInfo& right);
52 const CSIPluginContainerInfo& left,
53 const CSIPluginContainerInfo& right);
55 bool operator==(
const DiscoveryInfo& left,
const DiscoveryInfo& right);
56 bool operator==(
const DrainInfo& left,
const DrainInfo& right);
57 bool operator==(
const Environment& left,
const Environment& right);
58 bool operator==(
const ExecutorInfo& left,
const ExecutorInfo& right);
59 bool operator==(
const FileInfo& left,
const FileInfo& right);
60 bool operator==(
const Label& left,
const Label& right);
61 bool operator==(
const Labels& left,
const Labels& right);
62 bool operator==(
const MasterInfo& left,
const MasterInfo& right);
67 const ResourceProviderInfo& left,
68 const ResourceProviderInfo& right);
71 const ResourceStatistics& left,
72 const ResourceStatistics& right);
74 bool operator==(
const AgentInfo& left,
const AgentInfo& right);
75 bool operator==(
const TaskStatus& left,
const TaskStatus& right);
76 bool operator==(
const URL& left,
const URL& right);
77 bool operator==(
const Volume& left,
const Volume& right);
79 bool operator!=(
const Labels& left,
const Labels& right);
82 bool operator!=(
const TaskStatus& left,
const TaskStatus& right);
85 inline bool operator==(
const ContainerID& left,
const ContainerID& right)
87 return left.value() == right.value();
91 inline bool operator==(
const ExecutorID& left,
const ExecutorID& right)
93 return left.value() == right.value();
97 inline bool operator==(
const FrameworkID& left,
const FrameworkID& right)
99 return left.value() == right.value();
106 bool operator==(
const FrameworkInfo& left,
const FrameworkInfo& right) =
delete;
109 namespace typeutils {
114 bool equivalent(
const FrameworkInfo& left,
const FrameworkInfo& right);
123 inline bool operator==(
const OfferID& left,
const OfferID& right)
125 return left.value() == right.value();
129 inline bool operator==(
const OperationID& left,
const OperationID& right)
131 return left.value() == right.value();
136 const ResourceProviderID& left,
137 const ResourceProviderID& right)
139 return left.value() == right.value();
145 return left.value() == right.value();
149 inline bool operator==(
const AgentID& left,
const AgentID& right)
151 return left.value() == right.value();
155 inline bool operator==(
const TaskID& left,
const TaskID& right)
157 return left.value() == right.value();
161 inline bool operator==(
const TimeInfo& left,
const TimeInfo& right)
163 return left.nanoseconds() == right.nanoseconds();
167 inline bool operator==(
const DurationInfo& left,
const DurationInfo& right)
169 return left.nanoseconds() == right.nanoseconds();
173 inline bool operator==(
const ContainerID& left,
const std::string& right)
175 return left.value() == right;
179 inline bool operator==(
const ExecutorID& left,
const std::string& right)
181 return left.value() == right;
185 inline bool operator==(
const FrameworkID& left,
const std::string& right)
187 return left.value() == right;
191 inline bool operator==(
const OfferID& left,
const std::string& right)
193 return left.value() == right;
197 inline bool operator==(
const AgentID& left,
const std::string& right)
199 return left.value() == right;
203 inline bool operator==(
const TaskID& left,
const std::string& right)
205 return left.value() == right;
210 const DomainInfo::FaultDomain::RegionInfo& left,
211 const DomainInfo::FaultDomain::RegionInfo& right)
213 return left.name() == right.name();
218 const DomainInfo::FaultDomain::ZoneInfo& left,
219 const DomainInfo::FaultDomain::ZoneInfo& right)
221 return left.name() == right.name();
226 const DomainInfo::FaultDomain& left,
227 const DomainInfo::FaultDomain& right)
229 return left.region() == right.region() && left.zone() == right.zone();
233 inline bool operator==(
const DomainInfo& left,
const DomainInfo& right)
235 return left.fault_domain() == right.fault_domain();
243 inline bool operator==(
const MachineID& left,
const MachineID& right)
247 return left.has_hostname() == right.has_hostname() &&
249 left.has_ip() == right.has_ip() &&
250 left.ip() == right.ip();
254 inline bool operator!=(
const ContainerID& left,
const ContainerID& right)
256 return left.value() != right.value();
261 const CSIPluginContainerInfo& left,
262 const CSIPluginContainerInfo& right)
264 return !(left == right);
268 inline bool operator!=(
const ExecutorID& left,
const ExecutorID& right)
270 return left.value() != right.value();
274 inline bool operator!=(
const FrameworkID& left,
const FrameworkID& right)
276 return left.value() != right.value();
280 inline bool operator!=(
const OperationID& left,
const OperationID& right)
282 return left.value() != right.value();
287 const ResourceProviderID& left,
288 const ResourceProviderID& right)
290 return left.value() != right.value();
295 const ResourceProviderInfo& left,
296 const ResourceProviderInfo& right)
298 return !(left == right);
304 return !(left == right);
308 inline bool operator!=(
const AgentID& left,
const AgentID& right)
310 return left.value() != right.value();
314 inline bool operator!=(
const TimeInfo& left,
const TimeInfo& right)
316 return !(left == right);
320 inline bool operator!=(
const DurationInfo& left,
const DurationInfo& right)
322 return !(left == right);
327 const DomainInfo::FaultDomain::RegionInfo& left,
328 const DomainInfo::FaultDomain::RegionInfo& right)
330 return left.name() != right.name();
334 inline bool operator<(
const ContainerID& left,
const ContainerID& right)
336 return left.value() < right.value();
340 inline bool operator<(
const ExecutorID& left,
const ExecutorID& right)
342 return left.value() < right.value();
346 inline bool operator<(
const FrameworkID& left,
const FrameworkID& right)
348 return left.value() < right.value();
352 inline bool operator<(
const OfferID& left,
const OfferID& right)
354 return left.value() < right.value();
358 inline bool operator<(
const AgentID& left,
const AgentID& right)
360 return left.value() < right.value();
364 inline bool operator<(
const TaskID& left,
const TaskID& right)
366 return left.value() < right.value();
371 std::ostream& stream,
372 const CapabilityInfo& capabilityInfo);
376 std::ostream& stream,
377 const CheckStatusInfo& checkStatusInfo);
380 std::ostream&
operator<<(std::ostream& stream,
const ContainerID& containerId);
384 std::ostream& stream,
385 const ContainerInfo& containerInfo);
388 std::ostream&
operator<<(std::ostream& stream,
const DomainInfo& domainInfo);
391 std::ostream&
operator<<(std::ostream& stream,
const ExecutorID& executorId);
394 std::ostream&
operator<<(std::ostream& stream,
const ExecutorInfo& executor);
397 std::ostream&
operator<<(std::ostream& stream,
const FrameworkID& frameworkId);
403 std::ostream&
operator<<(std::ostream& stream,
const OfferID& offerId);
406 std::ostream&
operator<<(std::ostream& stream,
const OperationID& operationId);
409 std::ostream&
operator<<(std::ostream& stream,
const OperationState& state);
412 std::ostream&
operator<<(std::ostream& stream,
const RateLimits& limits);
415 std::ostream&
operator<<(std::ostream& stream,
const RLimitInfo& limits);
419 std::ostream& stream,
420 const ResourceProviderID& resourceProviderId);
424 std::ostream& stream,
425 const ResourceProviderInfo& resourceProviderInfo);
431 std::ostream&
operator<<(std::ostream& stream,
const OperationStatus& status);
434 std::ostream&
operator<<(std::ostream& stream,
const AgentID& agentId);
437 std::ostream&
operator<<(std::ostream& stream,
const AgentInfo&
agent);
440 std::ostream&
operator<<(std::ostream& stream,
const TaskID& taskId);
443 std::ostream&
operator<<(std::ostream& stream,
const MachineID& machineId);
446 std::ostream&
operator<<(std::ostream& stream,
const TaskInfo& task);
450 std::ostream& stream,
451 const TaskGroupInfo& taskGroupInfo);
454 std::ostream&
operator<<(std::ostream& stream,
const TaskState& state);
461 std::ostream& stream,
466 std::ostream& stream,
477 std::ostream& stream,
482 std::ostream& stream,
486 template <
typename T>
488 std::ostream& stream,
489 const std::vector<T>& messages)
492 for (
auto it = messages.begin(); it != messages.end(); ++it) {
493 if (it != messages.begin()) {
509 struct hash<
mesos::v1::CommandInfo::URI>
523 if (uri.executable()) {
527 boost::hash_combine(seed, uri.value());
528 boost::hash_combine(seed, uri.output_file());
541 result_type
operator()(
const argument_type& containerId)
const 544 boost::hash_combine(seed, containerId.value());
557 result_type
operator()(
const argument_type& executorId)
const 560 boost::hash_combine(seed, executorId.value());
573 result_type
operator()(
const argument_type& frameworkId)
const 576 boost::hash_combine(seed, frameworkId.value());
592 boost::hash_combine(seed, offerId.value());
608 boost::hash_combine(seed, agentId.value());
624 boost::hash_combine(seed, taskId.value());
640 return static_cast<size_t>(taskState);
646 struct hash<
mesos::v1::TaskStatus_Source>
655 return static_cast<size_t>(source);
661 struct hash<
mesos::v1::TaskStatus_Reason>
670 return static_cast<size_t>(reason);
685 return static_cast<size_t>(imageType);
691 struct hash<
std::pair<mesos::v1::FrameworkID, mesos::v1::ExecutorID>>
719 boost::hash_combine(seed, machineId.ip());
732 result_type
operator()(
const argument_type& operationId)
const 735 boost::hash_combine(seed, operationId.value());
742 struct hash<
mesos::v1::ResourceProviderID>
748 result_type
operator()(
const argument_type& resourceProviderId)
const 751 boost::hash_combine(seed, resourceProviderId.value());
758 #endif // __MESOS_V1_HPP__ mesos::v1::TaskStatus_Source argument_type
Definition: mesos.hpp:650
result_type operator()(const argument_type &source) const
Definition: mesos.hpp:652
bool equivalent(const FrameworkInfo &left, const FrameworkInfo &right)
size_t result_type
Definition: mesos.hpp:601
mesos::v1::ContainerID argument_type
Definition: mesos.hpp:539
Definition: master.hpp:27
mesos::v1::ResourceProviderID argument_type
Definition: mesos.hpp:746
mesos::v1::ExecutorID argument_type
Definition: mesos.hpp:555
result_type operator()(const argument_type &uri) const
Definition: mesos.hpp:515
size_t result_type
Definition: mesos.hpp:585
Result< ProcessStatus > status(pid_t pid)
Definition: proc.hpp:166
Definition: mesos.hpp:551
size_t result_type
Definition: mesos.hpp:569
result_type operator()(const argument_type &resourceProviderId) const
Definition: mesos.hpp:748
Definition: type_utils.hpp:619
mesos::v1::TaskState argument_type
Definition: mesos.hpp:635
result_type operator()(const argument_type &taskState) const
Definition: mesos.hpp:637
size_t result_type
Definition: mesos.hpp:744
Capability
Definition: capabilities.hpp:35
Operation
Definition: cgroups.hpp:444
result_type operator()(const argument_type &reason) const
Definition: mesos.hpp:667
std::pair< mesos::v1::FrameworkID, mesos::v1::ExecutorID > argument_type
Definition: mesos.hpp:696
mesos::v1::MachineID argument_type
Definition: mesos.hpp:713
size_t result_type
Definition: mesos.hpp:511
mesos::v1::FrameworkID argument_type
Definition: mesos.hpp:571
result_type operator()(const argument_type &executorId) const
Definition: mesos.hpp:557
size_t result_type
Definition: mesos.hpp:648
size_t result_type
Definition: mesos.hpp:693
bool operator==(const CommandInfo &left, const CommandInfo &right)
size_t result_type
Definition: mesos.hpp:711
size_t result_type
Definition: mesos.hpp:728
mesos::v1::AgentID argument_type
Definition: mesos.hpp:603
mesos::v1::TaskStatus_Reason argument_type
Definition: mesos.hpp:665
Option< std::string > diff(const FrameworkInfo &left, const FrameworkInfo &right)
result_type operator()(const argument_type &frameworkId) const
Definition: mesos.hpp:573
mesos::v1::OperationID argument_type
Definition: mesos.hpp:730
Type
Definition: capabilities.hpp:82
CSIPluginContainerInfo::Service Service
Definition: service_manager.hpp:38
Definition: mesos.hpp:567
result_type operator()(const argument_type &imageType) const
Definition: mesos.hpp:682
mesos::v1::Image::Type argument_type
Definition: mesos.hpp:680
size_t result_type
Definition: mesos.hpp:633
Try< uint32_t > type(const std::string &path)
bool operator<(const ContainerID &left, const ContainerID &right)
Definition: mesos.hpp:334
size_t result_type
Definition: mesos.hpp:663
mesos::v1::TaskID argument_type
Definition: mesos.hpp:619
size_t result_type
Definition: mesos.hpp:553
bool operator!=(const Labels &left, const Labels &right)
result_type operator()(const argument_type &offerId) const
Definition: mesos.hpp:589
size_t result_type
Definition: mesos.hpp:617
result_type operator()(const argument_type &machineId) const
Definition: mesos.hpp:715
result_type operator()(const argument_type &containerId) const
Definition: mesos.hpp:541
mesos::v1::OfferID argument_type
Definition: mesos.hpp:587
result_type operator()(const argument_type &operationId) const
Definition: mesos.hpp:732
mesos::v1::CommandInfo::URI argument_type
Definition: mesos.hpp:513
result_type operator()(const argument_type &taskId) const
Definition: mesos.hpp:621
size_t result_type
Definition: mesos.hpp:678
std::string lower(const std::string &s)
Definition: strings.hpp:429
std::ostream & operator<<(std::ostream &stream, const Attribute &attribute)
result_type operator()(const argument_type &pair) const
Definition: mesos.hpp:698
size_t result_type
Definition: mesos.hpp:537
result_type operator()(const argument_type &agentId) const
Definition: mesos.hpp:605