Smityz commented on a change in pull request #722:
URL: https://github.com/apache/incubator-pegasus/pull/722#discussion_r619768162



##########
File path: src/base/pegasus_value_schema.h
##########
@@ -238,13 +238,24 @@ class pegasus_value_generator
 
 enum data_version
 {
+    VERSION_0 = 0,
+    VERSION_COUNT,
+    VERSION_MAX = VERSION_0,
     /// TBD(zlw)
 };
 
 struct value_params
 {
+    value_params(std::string &buf, std::vector<rocksdb::Slice> &slices)
+        : write_buf(buf), write_slices(slices)
+    {
+    }
+
     std::map<value_field_type, std::unique_ptr<value_field>> fields;

Review comment:
       ```
   std::map<value_field_type, std::unique_ptr<value_field>> fields;
   ```
   =>
   ```
   std::array<std::unique_ptr<value_field>> fields;
   fields[value_field_type::TIME_TAG] = 
dsn::make_unique<time_tag_field>(time_tag);
   ```
   
   ```
      ...
      auto expire_iter = params.fields.find(value_field_type::EXPIRE_TIMESTAMP);
       if (... || user_data_iter == params.fields.end())) {
           dassert_f(false, "USER_DATA or EXPIRE_TIMESTAMP is not provided");
           return {nullptr, 0};
       }
   ```
   =>
   ```
      ...
     // make sure std::array fields has enough spaces
      auto expire_iter = params.fields[value_field_type::EXPIRE_TIMESTAMP];
       if (... || user_data_iter == nullptr)) {
           dassert_f(false, "USER_DATA or EXPIRE_TIMESTAMP is not provided");
           return {nullptr, 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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pegasus.apache.org
For additional commands, e-mail: dev-h...@pegasus.apache.org

Reply via email to