This is an automated email from the ASF dual-hosted git repository.

twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 7cbf0a57 Replace manual RedisType check by calling IsSingleKVType 
(#2013)
7cbf0a57 is described below

commit 7cbf0a577859da1f9e41364a56931a1402f02145
Author: Twice <[email protected]>
AuthorDate: Sun Jan 14 14:53:01 2024 +0900

    Replace manual RedisType check by calling IsSingleKVType (#2013)
---
 src/storage/compact_filter.cc | 2 +-
 src/storage/iterator.cc       | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/storage/compact_filter.cc b/src/storage/compact_filter.cc
index 91c6751a..5353608e 100644
--- a/src/storage/compact_filter.cc
+++ b/src/storage/compact_filter.cc
@@ -91,7 +91,7 @@ bool SubKeyFilter::IsMetadataExpired(const InternalKey &ikey, 
const Metadata &me
   // `util::GetTimeStampMS() - 300000` means extending 5 minutes for expired 
items,
   // to prevent them from being recycled once they reach the expiration time.
   uint64_t lazy_expired_ts = util::GetTimeStampMS() - 300000;
-  return metadata.Type() == kRedisString  // metadata key was overwrite by set 
command
+  return metadata.IsSingleKVType()  // metadata key was overwrite by set 
command
          || metadata.ExpireAt(lazy_expired_ts) || ikey.GetVersion() != 
metadata.version;
 }
 
diff --git a/src/storage/iterator.cc b/src/storage/iterator.cc
index 12238cea..58e283b1 100644
--- a/src/storage/iterator.cc
+++ b/src/storage/iterator.cc
@@ -103,9 +103,8 @@ std::unique_ptr<SubKeyIterator> 
DBIterator::GetSubKeyIterator() const {
     return nullptr;
   }
 
-  // The string/json type doesn't have sub keys
   RedisType type = metadata_.Type();
-  if (type == kRedisNone || type == kRedisString || type == kRedisJson) {
+  if (type == kRedisNone || metadata_.IsSingleKVType()) {
     return nullptr;
   }
 

Reply via email to