reftable/stack: use stat info to avoid re-reading stack list
[git/gitster.git] / reftable / stack.h
blob3f80cc598af5dfd3040c92a6baeac98a3fb39986
1 /*
2 Copyright 2020 Google LLC
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file or at
6 https://developers.google.com/open-source/licenses/bsd
7 */
9 #ifndef STACK_H
10 #define STACK_H
12 #include "system.h"
13 #include "reftable-writer.h"
14 #include "reftable-stack.h"
16 struct reftable_stack {
17 struct stat_validity list_validity;
18 char *list_file;
19 char *reftable_dir;
20 int disable_auto_compact;
22 struct reftable_write_options config;
24 struct reftable_reader **readers;
25 size_t readers_len;
26 struct reftable_merged_table *merged;
27 struct reftable_compaction_stats stats;
30 int read_lines(const char *filename, char ***lines);
32 struct segment {
33 int start, end;
34 int log;
35 uint64_t bytes;
38 int fastlog2(uint64_t sz);
39 struct segment *sizes_to_segments(int *seglen, uint64_t *sizes, int n);
40 struct segment suggest_compaction_segment(uint64_t *sizes, int n);
42 #endif