caipengbo commented on code in PR #2040:
URL: https://github.com/apache/kvrocks/pull/2040#discussion_r1466314586


##########
src/storage/iterator.cc:
##########
@@ -164,4 +164,124 @@ void SubKeyIterator::Reset() {
   if (iter_) iter_.reset();
 }
 
+rocksdb::Status WALBatchExtractor::PutCF(uint32_t column_family_id, const 
Slice &key, const Slice &value) {
+  if (slot_ != -1) {
+    if (slot_ != ExtractSlotId(key)) {
+      return rocksdb::Status::OK();
+    }
+  }
+  items_.emplace_back(WALItem::Type::kTypePut, column_family_id, 
key.ToString(), value.ToString());
+  return rocksdb::Status::OK();
+}
+
+rocksdb::Status WALBatchExtractor::DeleteCF(uint32_t column_family_id, const 
rocksdb::Slice &key) {
+  if (slot_ != -1) {
+    if (slot_ != ExtractSlotId(key)) {
+      return rocksdb::Status::OK();
+    }
+  }
+  items_.emplace_back(WALItem::Type::kTypeDelete, column_family_id, 
key.ToString(), std::string{});
+  return rocksdb::Status::OK();
+}
+
+rocksdb::Status WALBatchExtractor::DeleteRangeCF(uint32_t column_family_id, 
const rocksdb::Slice &begin_key,
+                                                 const rocksdb::Slice 
&end_key) {
+  items_.emplace_back(WALItem::Type::kTypeDeleteRange, column_family_id, 
begin_key.ToString(), end_key.ToString());

Review Comment:
   This range can contain more than one slot, and checking the slot might lose 
some information, so I want to keep the whole range and let the caller deal 
with it.



-- 
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]

Reply via email to