mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [mesos] 01/02: Add the output file to the hash on CommandInfo::URI.
Date Wed, 17 Oct 2018 23:14:32 GMT
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 9108078aa2c41e2f88e4c7d66c0159b1810d89de
Author: James Peach <jpeach@apache.org>
AuthorDate: Wed Oct 17 15:22:27 2018 -0700

    Add the output file to the hash on CommandInfo::URI.
    
    The `output_file` field of the `CommandInfo::URI` is not combined
    into the hash value. This means that the fetcher does not consider two
    messages that differ only by the `output_file` as different. By adding
    the `output_file` to the hash it is possible for a task to fetch the
    same URI to multiple, distinct ouptuts.
    
    Review: https://reviews.apache.org/r/68586/
---
 include/mesos/type_utils.hpp | 5 +++--
 include/mesos/v1/mesos.hpp   | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/mesos/type_utils.hpp b/include/mesos/type_utils.hpp
index 19ea817..aa61c0c 100644
--- a/include/mesos/type_utils.hpp
+++ b/include/mesos/type_utils.hpp
@@ -510,11 +510,11 @@ inline std::ostream& operator<<(
 namespace std {
 
 template <>
-struct hash<mesos::CommandInfo_URI>
+struct hash<mesos::CommandInfo::URI>
 {
   typedef size_t result_type;
 
-  typedef mesos::CommandInfo_URI argument_type;
+  typedef mesos::CommandInfo::URI argument_type;
 
   result_type operator()(const argument_type& uri) const
   {
@@ -529,6 +529,7 @@ struct hash<mesos::CommandInfo_URI>
     }
 
     boost::hash_combine(seed, uri.value());
+    boost::hash_combine(seed, uri.output_file());
     return seed;
   }
 };
diff --git a/include/mesos/v1/mesos.hpp b/include/mesos/v1/mesos.hpp
index fda3eb4..452bcf2 100644
--- a/include/mesos/v1/mesos.hpp
+++ b/include/mesos/v1/mesos.hpp
@@ -529,6 +529,7 @@ struct hash<mesos::v1::CommandInfo::URI>
     }
 
     boost::hash_combine(seed, uri.value());
+    boost::hash_combine(seed, uri.output_file());
     return seed;
   }
 };


Mime
View raw message