bmahler commented on code in PR #557:
URL: https://github.com/apache/mesos/pull/557#discussion_r1566143430


##########
src/linux/cgroups2.hpp:
##########
@@ -217,9 +217,49 @@ Try<BandwidthLimit> max(const std::string& cgroup);
 
 namespace memory {
 
+// Memory usage limit.
+//
+// Represents a snapshot of "memory.high" and "memory.max".
+struct ByteLimit
+{
+  // Constructs a limitless byte limit.
+  ByteLimit() = default;
+
+  ByteLimit(const Bytes& limit);
+
+  bool operator==(const ByteLimit& other) const;
+
+  // Limit in bytes. None if the limit is "unlimited".
+  Option<Bytes> limit;
+};

Review Comment:
   what's up with this? is this only to avoid `Try<Option<Bytes>>`? If so, 
that's what `Result<Bytes>` provides:
   
   ```
   Try<Nothing> set_max(const std::string& cgroup, const Option<Bytes>& limit);
   Result<ByteLimit> max(const std::string& cgroup);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to