mirror of
https://github.com/git/git.git
synced 2024-05-27 06:26:13 +02:00
bc91330cec
The reftable stack already has a variable to configure whether or not to run auto-compaction, but it is inaccessible to users of the library. There exist use cases where a caller may want to have more control over auto-compaction. Move the `disable_auto_compact` option into `reftable_write_options` to allow external callers to disable auto-compaction. This will be used in a subsequent commit. Signed-off-by: Justin Tobler <jltobler@gmail.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
44 lines
889 B
C
44 lines
889 B
C
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by a BSD-style
|
|
license that can be found in the LICENSE file or at
|
|
https://developers.google.com/open-source/licenses/bsd
|
|
*/
|
|
|
|
#ifndef STACK_H
|
|
#define STACK_H
|
|
|
|
#include "system.h"
|
|
#include "reftable-writer.h"
|
|
#include "reftable-stack.h"
|
|
|
|
struct reftable_stack {
|
|
struct stat list_st;
|
|
char *list_file;
|
|
int list_fd;
|
|
|
|
char *reftable_dir;
|
|
|
|
struct reftable_write_options config;
|
|
|
|
struct reftable_reader **readers;
|
|
size_t readers_len;
|
|
struct reftable_merged_table *merged;
|
|
struct reftable_compaction_stats stats;
|
|
};
|
|
|
|
int read_lines(const char *filename, char ***lines);
|
|
|
|
struct segment {
|
|
size_t start, end;
|
|
int log;
|
|
uint64_t bytes;
|
|
};
|
|
|
|
int fastlog2(uint64_t sz);
|
|
struct segment *sizes_to_segments(size_t *seglen, uint64_t *sizes, size_t n);
|
|
struct segment suggest_compaction_segment(uint64_t *sizes, size_t n);
|
|
|
|
#endif
|