PragmaTwice commented on code in PR #3133:
URL: https://github.com/apache/kvrocks/pull/3133#discussion_r2289698606


##########
src/commands/cmd_timeseries.cc:
##########
@@ -51,6 +51,47 @@ std::string 
FormatAddResultAsRedisReply(TSChunk::AddResultWithTS res) {
   return "";
 }
 
+std::string_view FormatChunkTypeAsRedisReply(TimeSeriesMetadata::ChunkType 
chunk_type) {
+  using ChunkType = TimeSeriesMetadata::ChunkType;
+  static const std::unordered_map<ChunkType, std::string_view> map = {
+      {ChunkType::COMPRESSED, "compressed"},
+      {ChunkType::UNCOMPRESSED, "uncompressed"},
+  };

Review Comment:
   Could you move them to global variables instead of local static variables?
   
   Local static variables with non-trivial ctor will lead to a lock (i.e. 
`__cxa_guard_acquire`) to ensure thread-safety.



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

Reply via email to