acelyc111 commented on code in PR #1870:
URL: 
https://github.com/apache/incubator-pegasus/pull/1870#discussion_r1464600314


##########
src/http/http_server.cpp:
##########
@@ -57,6 +57,16 @@ error_s update_config(const http_request &req)
     return update_flag(iter->first, iter->second);
 }
 
+// If sub_path is 'app/duplication', the built path would be 
'<root_path>/app/duplication'.
+std::string build_rel_path(const std::string &root_path, const std::string 
&sub_path)

Review Comment:
   Is it short for build_real_path? It's not too long, use the original name is 
OK IMO.



##########
src/utils/metrics.cpp:
##########
@@ -245,14 +272,19 @@ metric_entity_prototype::metric_entity_prototype(const 
char *name) : _name(name)
 
 metric_entity_prototype::~metric_entity_prototype() {}
 
+const std::string metrics_http_service::kMetricsRootPath("");

Review Comment:
   Where will it be used?



##########
src/http/http_server.cpp:
##########
@@ -57,6 +57,16 @@ error_s update_config(const http_request &req)
     return update_flag(iter->first, iter->second);
 }
 
+// If sub_path is 'app/duplication', the built path would be 
'<root_path>/app/duplication'.
+std::string build_rel_path(const std::string &root_path, const std::string 
&sub_path)
+{
+    std::string rel_path(root_path);
+    if (!rel_path.empty()) {

Review Comment:
   In which case the root_path is empty?



##########
src/utils/strings.cpp:
##########
@@ -424,5 +425,11 @@ std::string find_string_prefix(const std::string &input, 
char separator)
     }
     return input.substr(0, current);
 }
+
+bool has_space(const std::string &str)
+{
+    return std::any_of(str.begin(), str.end(), [](unsigned char c) { return 
std::isspace(c); });

Review Comment:
   Have check the absl implementation is better than Cpp standard or not?
   
   ```
   // Determines whether the given character is a whitespace character (space,
   // tab, vertical tab, formfeed, linefeed, or carriage return).
   inline bool ascii_isspace(unsigned char c) {
     return (ascii_internal::kPropertyBits[c] & 0x08) != 0;
   }
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to