aboutsummaryrefslogtreecommitdiff
path: root/reftable/reftable-writer.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-13 10:18:38 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-13 17:02:39 -0700
commitf663d34306d414bca27cf6b5dc7affb00e8603fe (patch)
treebc9bbb0beb771f18a52fbc8b49e486e1ee35685a /reftable/reftable-writer.h
parentafbdbfae0b44efe470c6c7998822900c61f71e39 (diff)
downloadgit-f663d34306d414bca27cf6b5dc7affb00e8603fe.tar.xz
reftable: make the compaction factor configurable
When auto-compacting, the reftable library packs references such that the sizes of the tables form a geometric sequence. The factor for this geometric sequence is hardcoded to 2 right now. We're about to expose this as a config option though, so let's expose the factor via write options. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/reftable-writer.h')
-rw-r--r--reftable/reftable-writer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/reftable/reftable-writer.h b/reftable/reftable-writer.h
index 94804eaa68..189b1f4144 100644
--- a/reftable/reftable-writer.h
+++ b/reftable/reftable-writer.h
@@ -45,6 +45,12 @@ struct reftable_write_options {
/* boolean: Prevent auto-compaction of tables. */
unsigned disable_auto_compact : 1;
+
+ /*
+ * Geometric sequence factor used by auto-compaction to decide which
+ * tables to compact. Defaults to 2 if unset.
+ */
+ uint8_t auto_compaction_factor;
};
/* reftable_block_stats holds statistics for a single block type */