hashmap<string, Resources> Resources::reserved() const
{
hashmap<string, Resources> result;
foreach (const Resource& resource, resources) {
if (isReserved(resource)) {
result[resource.role()] += resource;
}
}
return result;
}
Resources Resources::reserved(const string& role) const
{
return filter(lambda::bind(isReserved, lambda::_1, role));
}
The first resrved() API will return a hashmap of reserved resource with role as key and resources as value.
The second reserved(const string& role) will only return reserved resources for a specified role, but this is not the intention of the API, as this API actually want to return either reserved resources for a specified role or all reserved resources in mesos cluster for all roles in flatten mode.
So we need to update the API of reserved(const string& role) to reserved(const Option<string>& role) with default value as None():
Resources Resources::reserved(const Option<string>& role) const
{
return filter(lambda::bind(isReserved, lambda::_1, role));
}
But the problem is that if the caller use "reserved()", the compiler will not know which "reserved()" API does the caller is using, after some discussion with BMahler, MPark, Josep, we want to rename the API of "reserved()" to "reservation()" to resolve this conflict.
I have uploaded a patch here https://reviews.apache.org/r/42590 and please show your comments if any.
Thanks,
Guangya
--
You received this message because you are subscribed to the Google Groups "Mesos Resource Allocation Working Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mesos-allocati...@googlegroups.com.
To post to this group, send email to mesos-al...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mesos-allocation/4af09f6a-6301-417f-8f8e-a8c3b9286c37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mesos-allocation+unsubscribe@googlegroups.com.
To post to this group, send email to mesos-allocation@googlegroups.com.