Anand Mazumdar created MESOS-4765:
-------------------------------------
Summary: Add equality operator for `process::http::URL` objects.
Key: MESOS-4765
URL: https://issues.apache.org/jira/browse/MESOS-4765
Project: Mesos
Issue Type: Task
Components: HTTP API, libprocess
Reporter: Anand Mazumdar
Priority: Minor
Currently two {{process::http::URL}} objects cannot be compared. It would be
good to add an equality operator for comparing them. This might require a
hostname lookup provided that the {{URL}} object was constructed from
{{domain}} and not from {{net::IP}}.
The other details can be similar to the equality operator semantics of the
corresponding Java 7 URL object:
https://docs.oracle.com/javase/7/docs/api/java/net/URL.html#equals(java.lang.Object)
Also, it would also us to get rid of the corresponding {{URL}} object
comparison in {{type_utils.cpp}} that just compares if the serialized strings
match.
{code}
// TODO(bmahler): Leverage process::http::URL for equality.
bool operator==(const URL& left, const URL& right)
{
return left.SerializeAsString() == right.SerializeAsString();
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)