git/reftable
Karthik Nayak e35155588a reftable/stack: add function to check if optimization is required
The reftable backend performs auto-compaction as part of its regular
flow, which is required to keep the number of tables part of a stack at
bay. This allows it to stay optimized.

Compaction can also be triggered voluntarily by the user via the 'git
pack-refs' or the 'git refs optimize' command. However, currently there
is no way for the user to check if optimization is required without
actually performing it.

Extract out the heuristics logic from 'reftable_stack_auto_compact()'
into an internal function 'update_segment_if_compaction_required()'.
Then use this to add and expose `reftable_stack_compaction_required()`
which will allow users to check if the reftable backend can be
optimized.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-10 09:28:47 -08:00
..
LICENSE
basics.c reftable: check for trailing newline in 'tables.list' 2025-10-07 09:22:57 -07:00
basics.h reftable: check for trailing newline in 'tables.list' 2025-10-07 09:22:57 -07:00
block.c Merge branch 'ps/reftable-read-block-perffix' 2025-05-19 16:02:48 -07:00
block.h Merge branch 'ps/reftable-api-revamp' 2025-04-29 14:21:30 -07:00
blocksource.c reftable/block: rename `block` to `block_data` 2025-04-07 14:53:10 -07:00
blocksource.h reftable/block: rename `block` to `block_data` 2025-04-07 14:53:10 -07:00
constants.h reftable/constants: make block types part of the public interface 2025-04-07 14:53:12 -07:00
error.c reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
fsck.c reftable: add code to facilitate consistency checks 2025-10-07 09:22:58 -07:00
iter.c reftable/constants: make block types part of the public interface 2025-04-07 14:53:12 -07:00
iter.h reftable/block: rename `block_reader` to `reftable_block` 2025-04-07 14:53:10 -07:00
merged.c reftable/constants: make block types part of the public interface 2025-04-07 14:53:12 -07:00
merged.h reftable/reader: rename data structure to "table" 2025-04-07 14:53:09 -07:00
pq.c reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
pq.h reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
record.c Merge branch 'ps/reftable-api-revamp' 2025-04-29 14:21:30 -07:00
record.h reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
reftable-basics.h reftable/block: create public interface for reading blocks 2025-04-07 14:53:11 -07:00
reftable-block.h reftable: fix perf regression when reading blocks of unwanted type 2025-05-12 10:55:24 -07:00
reftable-blocksource.h reftable/block: rename `block` to `block_data` 2025-04-07 14:53:10 -07:00
reftable-constants.h reftable/constants: make block types part of the public interface 2025-04-07 14:53:12 -07:00
reftable-error.h reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
reftable-fsck.h reftable: add code to facilitate consistency checks 2025-10-07 09:22:58 -07:00
reftable-iterator.h reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
reftable-merged.h reftable/reader: rename data structure to "table" 2025-04-07 14:53:09 -07:00
reftable-record.h reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
reftable-stack.h reftable/stack: add function to check if optimization is required 2025-11-10 09:28:47 -08:00
reftable-table.h reftable/table: move printing logic into test helper 2025-04-07 14:53:13 -07:00
reftable-writer.h reftable/writer: fix type used for number of records 2025-08-12 07:40:58 -07:00
stack.c reftable/stack: add function to check if optimization is required 2025-11-10 09:28:47 -08:00
stack.h reftable/reader: rename data structure to "table" 2025-04-07 14:53:09 -07:00
system.c reftable: don't second-guess errors from flock interface 2025-08-12 07:41:00 -07:00
system.h reftable: don't second-guess errors from flock interface 2025-08-12 07:41:00 -07:00
table.c reftable: fix perf regression when reading blocks of unwanted type 2025-05-12 10:55:24 -07:00
table.h reftable/table: add `reftable_table` to the public interface 2025-04-07 14:53:12 -07:00
tree.c reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
tree.h reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00
writer.c reftable/writer: drop Git-specific `QSORT()` macro 2025-08-12 07:40:59 -07:00
writer.h reftable: fix formatting of the license header 2025-04-07 14:53:09 -07:00