]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / rocksdb / utilities / write_batch_with_index / write_batch_with_index.cc
index 2df6bcaf381fa0480c50062f9f86a384824892c2..1e92d581412e96298d81b6821e329484e041c8e3 100644 (file)
@@ -846,8 +846,7 @@ Status WriteBatchWithIndex::GetFromBatchAndDB(
   Status s;
   MergeContext merge_context;
   const ImmutableDBOptions& immuable_db_options =
-      static_cast_with_check<DBImpl, DB>(db->GetRootDB())
-          ->immutable_db_options();
+      static_cast_with_check<DBImpl>(db->GetRootDB())->immutable_db_options();
 
   // Since the lifetime of the WriteBatch is the same as that of the transaction
   // we cannot pin it as otherwise the returned value will not be available
@@ -887,14 +886,14 @@ Status WriteBatchWithIndex::GetFromBatchAndDB(
     get_impl_options.column_family = column_family;
     get_impl_options.value = pinnable_val;
     get_impl_options.callback = callback;
-    s = static_cast_with_check<DBImpl, DB>(db->GetRootDB())
+    s = static_cast_with_check<DBImpl>(db->GetRootDB())
             ->GetImpl(read_options, key, get_impl_options);
   }
 
   if (s.ok() || s.IsNotFound()) {  // DB Get Succeeded
     if (result == WriteBatchWithIndexInternal::Result::kMergeInProgress) {
       // Merge result from DB with merges in Batch
-      auto cfh = reinterpret_cast<ColumnFamilyHandleImpl*>(column_family);
+      auto cfh = static_cast_with_check<ColumnFamilyHandleImpl>(column_family);
       const MergeOperator* merge_operator =
           cfh->cfd()->ioptions()->merge_operator;
       Statistics* statistics = immuable_db_options.statistics.get();
@@ -938,8 +937,7 @@ void WriteBatchWithIndex::MultiGetFromBatchAndDB(
     const size_t num_keys, const Slice* keys, PinnableSlice* values,
     Status* statuses, bool sorted_input, ReadCallback* callback) {
   const ImmutableDBOptions& immuable_db_options =
-      static_cast_with_check<DBImpl, DB>(db->GetRootDB())
-          ->immutable_db_options();
+      static_cast_with_check<DBImpl>(db->GetRootDB())->immutable_db_options();
 
   autovector<KeyContext, MultiGetContext::MAX_BATCH_SIZE> key_context;
   autovector<KeyContext*, MultiGetContext::MAX_BATCH_SIZE> sorted_keys;
@@ -982,7 +980,8 @@ void WriteBatchWithIndex::MultiGetFromBatchAndDB(
 
     assert(result == WriteBatchWithIndexInternal::Result::kMergeInProgress ||
            result == WriteBatchWithIndexInternal::Result::kNotFound);
-    key_context.emplace_back(column_family, keys[i], &values[i], &statuses[i]);
+    key_context.emplace_back(column_family, keys[i], &values[i],
+                             /*timestamp*/ nullptr, &statuses[i]);
     merges.emplace_back(result, std::move(merge_context));
   }
 
@@ -991,14 +990,14 @@ void WriteBatchWithIndex::MultiGetFromBatchAndDB(
   }
 
   // Did not find key in batch OR could not resolve Merges.  Try DB.
-  static_cast_with_check<DBImpl, DB>(db->GetRootDB())
+  static_cast_with_check<DBImpl>(db->GetRootDB())
       ->PrepareMultiGetKeys(key_context.size(), sorted_input, &sorted_keys);
-  static_cast_with_check<DBImpl, DB>(db->GetRootDB())
+  static_cast_with_check<DBImpl>(db->GetRootDB())
       ->MultiGetWithCallback(read_options, column_family, callback,
                              &sorted_keys);
 
   ColumnFamilyHandleImpl* cfh =
-      reinterpret_cast<ColumnFamilyHandleImpl*>(column_family);
+      static_cast_with_check<ColumnFamilyHandleImpl>(column_family);
   const MergeOperator* merge_operator = cfh->cfd()->ioptions()->merge_operator;
   for (auto iter = key_context.begin(); iter != key_context.end(); ++iter) {
     KeyContext& key = *iter;