You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PragmaTwice (via GitHub)" <gi...@apache.org> on 2023/04/28 13:28:54 UTC

[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #1405: Add the ability to use the '*-123' pattern to specify stream entry ID…

PragmaTwice commented on code in PR #1405:
URL: https://github.com/apache/incubator-kvrocks/pull/1405#discussion_r1180405528


##########
src/types/redis_stream_base.cc:
##########
@@ -85,39 +79,48 @@ Status ParseStreamEntryID(const std::string &input, StreamEntryID *id) {
   return Status::OK();
 }
 
-Status ParseNewStreamEntryID(const std::string &input, NewStreamEntryID *id) {
+std::unique_ptr<NextStreamEntryIDGenerationStrategy> ParseNextStreamEntryIDStrategy(const std::string &input) {

Review Comment:
   From my side, I recommend you to use something like `StatusOr<std::unique_ptr<NextStreamEntryIDGenerationStrategy>>`, e.g.
   ```
   StatusOr<std::unique_ptr<NextStreamEntryIDGenerationStrategy>> ParseNextStreamEntryIDStrategy(const std::string &input) {
     ...
     if (...) {
       return {Status::NotOk, "some reason..."};
     } else {
       return std::make_unique<SomeDerivedClass>(...);
     }
     ...
   }
   ```



-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org