]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/include/rocksdb/universal_compaction.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / include / rocksdb / universal_compaction.h
index e3aeee6ceecb0562f888e80a84899e7eae08ba17..0b0a85e1c8628d5e13aa6d932c01097bfd446956 100644 (file)
@@ -5,10 +5,12 @@
 
 #pragma once
 
-#include <stdint.h>
 #include <climits>
+#include <cstdint>
 #include <vector>
 
+#include "rocksdb/rocksdb_namespace.h"
+
 namespace ROCKSDB_NAMESPACE {
 
 //
@@ -36,12 +38,12 @@ class CompactionOptionsUniversal {
   // The size amplification is defined as the amount (in percentage) of
   // additional storage needed to store a single byte of data in the database.
   // For example, a size amplification of 2% means that a database that
-  // contains 100 bytes of user-data may occupy upto 102 bytes of
+  // contains 100 bytes of user-data may occupy up to 102 bytes of
   // physical storage. By this definition, a fully compacted database has
   // a size amplification of 0%. Rocksdb uses the following heuristic
   // to calculate size amplification: it assumes that all files excluding
   // the earliest file contribute to the size amplification.
-  // Default: 200, which means that a 100 byte database could require upto
+  // Default: 200, which means that a 100 byte database could require up to
   // 300 bytes of storage.
   unsigned int max_size_amplification_percent;
 
@@ -57,7 +59,7 @@ class CompactionOptionsUniversal {
   //    A1...An B1...Bm C1...Ct
   // where A1 is the newest and Ct is the oldest, and we are going to compact
   // B1...Bm, we calculate the total size of all the files as total_size, as
-  // well as  the total size of C1...Ct as total_C, the compaction output file
+  // well as the total size of C1...Ct as total_C, the compaction output file
   // will be compressed iff
   //   total_C / total_size < this percentage
   // Default: -1
@@ -72,6 +74,13 @@ class CompactionOptionsUniversal {
   // Default: false
   bool allow_trivial_move;
 
+  // EXPERIMENTAL
+  // If true, try to limit compaction size under max_compaction_bytes.
+  // This might cause higher write amplification, but can prevent some
+  // problem caused by large compactions.
+  // Default: false
+  bool incremental;
+
   // Default set of parameters
   CompactionOptionsUniversal()
       : size_ratio(1),
@@ -80,7 +89,8 @@ class CompactionOptionsUniversal {
         max_size_amplification_percent(200),
         compression_size_percent(-1),
         stop_style(kCompactionStopStyleTotalSize),
-        allow_trivial_move(false) {}
+        allow_trivial_move(false),
+        incremental(false) {}
 };
 
 }  // namespace ROCKSDB_NAMESPACE