]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/table/block_builder.cc
import 14.2.4 nautilus point release
[ceph.git] / ceph / src / rocksdb / table / block_builder.cc
index 37b407ea5f4be9cdc5dea4f703bb528c6a58a9c2..c14b4f6d3ee23f6c8e946dd7cd30880067c1b3c7 100644 (file)
@@ -64,14 +64,14 @@ BlockBuilder::BlockBuilder(
       assert(0);
   }
   assert(block_restart_interval_ >= 1);
-  restarts_.push_back(0);       // First restart point is at offset 0
+  restarts_.push_back(0);  // First restart point is at offset 0
   estimate_ = sizeof(uint32_t) + sizeof(uint32_t);
 }
 
 void BlockBuilder::Reset() {
   buffer_.clear();
   restarts_.clear();
-  restarts_.push_back(0);       // First restart point is at offset 0
+  restarts_.push_back(0);  // First restart point is at offset 0
   estimate_ = sizeof(uint32_t) + sizeof(uint32_t);
   counter_ = 0;
   finished_ = false;
@@ -81,8 +81,8 @@ void BlockBuilder::Reset() {
   }
 }
 
-size_t BlockBuilder::EstimateSizeAfterKV(const Slice& key, const Slice& value)
-  const {
+size_t BlockBuilder::EstimateSizeAfterKV(const Slice& key,
+                                         const Slice& value) const {
   size_t estimate = CurrentSizeEstimate();
   // Note: this is an imprecise estimate as it accounts for the whole key size
   // instead of non-shared key size.
@@ -95,13 +95,13 @@ size_t BlockBuilder::EstimateSizeAfterKV(const Slice& key, const Slice& value)
           : value.size() / 2;
 
   if (counter_ >= block_restart_interval_) {
-    estimate += sizeof(uint32_t); // a new restart entry.
+    estimate += sizeof(uint32_t);  // a new restart entry.
   }
 
-  estimate += sizeof(int32_t); // varint for shared prefix length.
+  estimate += sizeof(int32_t);  // varint for shared prefix length.
   // Note: this is an imprecise estimate as we will have to encoded size, one
   // for shared key and one for non-shared key.
-  estimate += VarintLength(key.size()); // varint for key length.
+  estimate += VarintLength(key.size());  // varint for key length.
   if (!use_value_delta_encoding_ || (counter_ >= block_restart_interval_)) {
     estimate += VarintLength(value.size());  // varint for value length.
   }