jjz921024 commented on code in PR #2402:
URL: https://github.com/apache/kvrocks/pull/2402#discussion_r1677889529
##########
src/types/redis_hash.h:
##########
@@ -63,9 +65,16 @@ class Hash : public SubKeyScanner {
std::vector<std::string> *values = nullptr);
rocksdb::Status RandField(const Slice &user_key, int64_t command_count,
std::vector<FieldValue> *field_values,
HashFetchType type = HashFetchType::kOnlyKey);
+ rocksdb::Status ExpireFields(const Slice &user_key, uint64_t expire_ms,
const std::vector<Slice> &fields,
+ HashFieldExpireType type, bool is_persist,
std::vector<int8_t> *ret);
+ rocksdb::Status TTLFields(const Slice &user_key, const std::vector<Slice>
&fields, std::vector<int64_t> *ret);
+ static bool IsExpiredField(Metadata &metadata, const Slice &value);
private:
rocksdb::Status GetMetadata(Database::GetOptions get_options, const Slice
&ns_key, HashMetadata *metadata);
+ static rocksdb::Status decodeFieldValue(const HashMetadata &metadata,
std::string *value, uint64_t &expire);
Review Comment:
done
##########
src/types/redis_hash.h:
##########
@@ -63,9 +65,16 @@ class Hash : public SubKeyScanner {
std::vector<std::string> *values = nullptr);
rocksdb::Status RandField(const Slice &user_key, int64_t command_count,
std::vector<FieldValue> *field_values,
HashFetchType type = HashFetchType::kOnlyKey);
+ rocksdb::Status ExpireFields(const Slice &user_key, uint64_t expire_ms,
const std::vector<Slice> &fields,
+ HashFieldExpireType type, bool is_persist,
std::vector<int8_t> *ret);
+ rocksdb::Status TTLFields(const Slice &user_key, const std::vector<Slice>
&fields, std::vector<int64_t> *ret);
+ static bool IsExpiredField(Metadata &metadata, const Slice &value);
private:
rocksdb::Status GetMetadata(Database::GetOptions get_options, const Slice
&ns_key, HashMetadata *metadata);
+ static rocksdb::Status decodeFieldValue(const HashMetadata &metadata,
std::string *value, uint64_t &expire);
+ static rocksdb::Status encodeValueExpire(std::string *value, uint64_t
expire);
Review Comment:
done
--
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]