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

Function setLimit

src/slave/slave.cpp:11630–11648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11628
11629
11630static void setLimit(Option<Value::Scalar>& limit, const Value::Scalar& delta)
11631{
11632 if (limit.isSome() && std::isinf(limit->value())) {
11633 // Just return if the limit is already infinite.
11634 return;
11635 }
11636
11637 Value::Scalar scalar;
11638 if (limit.isNone() || std::isinf(delta.value())) {
11639 // Set limit directly if it is the first time or the value to be
11640 // added is infinite.
11641 scalar.set_value(delta.value());
11642 } else {
11643 // Add the value into the limit.
11644 scalar.set_value(limit->value() + delta.value());
11645 }
11646
11647 limit = scalar;
11648};
11649
11650} // namespace slave {
11651} // namespace internal {

Callers 2

foreachFunction · 0.85
computeExecutorLimitsMethod · 0.85

Calls 3

isSomeMethod · 0.45
valueMethod · 0.45
isNoneMethod · 0.45

Tested by

no test coverage detected