| 102 | } |
| 103 | |
| 104 | std::unique_ptr<SubKeyIterator> DBIterator::GetSubKeyIterator() const { |
| 105 | if (!Valid()) { |
| 106 | return nullptr; |
| 107 | } |
| 108 | |
| 109 | RedisType type = metadata_.Type(); |
| 110 | if (type == kRedisNone || metadata_.IsSingleKVType()) { |
| 111 | return nullptr; |
| 112 | } |
| 113 | |
| 114 | auto prefix = InternalKey(Key(), "", metadata_.version, ctx_->storage->IsSlotIdEncoded()).Encode(); |
| 115 | return std::make_unique<SubKeyIterator>(*ctx_, read_options_, type, std::move(prefix)); |
| 116 | } |
| 117 | |
| 118 | SubKeyIterator::SubKeyIterator(engine::Context &ctx, rocksdb::ReadOptions read_options, RedisType type, |
| 119 | std::string prefix) |