chaoyli commented on a change in pull request #327: Add path info of replica in
catalog
URL: https://github.com/apache/incubator-doris/pull/327#discussion_r234407196
##########
File path: be/src/util/string_util.h
##########
@@ -57,6 +59,23 @@ struct StringCaseLess {
}
};
+struct PathHash {
+public:
+ std::size_t operator()(const std::string& identifier, const std::string&
path) const {
+ std::size_t hash = std::hash<std::string>()(identifier);
+ std::vector<std::string> path_parts;
+ boost::split(path_parts, path, boost::is_any_of("/"));
+ for (std::string part : path_parts) {
+ if (part.empty()) {
+ continue;
+ }
+
+ boost::hash_combine<std::string>(hash, part);
Review comment:
May be use the hash function in util/hash_util.hpp? it has been already
optimized
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]