Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-10-07 23:25:13 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-08 20:45:48 +0300
commite48d427268f965bf381a2f4fa445b5ade7913880 (patch)
tree0a98015729d11ec786a5824ca2d3df959316e8fa /reftable/stack.h
parentacb533440fc0ed32e195987b9946e948a9706560 (diff)
reftable: implement stack, a mutable database of reftable files.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/stack.h')
-rw-r--r--reftable/stack.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/reftable/stack.h b/reftable/stack.h
new file mode 100644
index 0000000000..f57005846e
--- /dev/null
+++ b/reftable/stack.h
@@ -0,0 +1,41 @@
+/*
+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 {
+ char *list_file;
+ char *reftable_dir;
+ int disable_auto_compact;
+
+ 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 {
+ int start, end;
+ int log;
+ uint64_t bytes;
+};
+
+int fastlog2(uint64_t sz);
+struct segment *sizes_to_segments(int *seglen, uint64_t *sizes, int n);
+struct segment suggest_compaction_segment(uint64_t *sizes, int n);
+
+#endif