]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/db/builder.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / db / builder.h
CommitLineData
7c673cae 1// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
11fdf7f2
TL
2// This source code is licensed under both the GPLv2 (found in the
3// COPYING file in the root directory) and Apache 2.0 License
4// (found in the LICENSE.Apache file in the root directory).
7c673cae
FG
5// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
6// Use of this source code is governed by a BSD-style license that can be
7// found in the LICENSE file. See the AUTHORS file for names of contributors.
8#pragma once
9#include <string>
10#include <utility>
11#include <vector>
1e59de90 12
494da23a 13#include "db/range_tombstone_fragmenter.h"
1e59de90 14#include "db/seqno_to_time_mapping.h"
7c673cae 15#include "db/table_properties_collector.h"
f67539c2 16#include "logging/event_logger.h"
7c673cae
FG
17#include "options/cf_options.h"
18#include "rocksdb/comparator.h"
19#include "rocksdb/env.h"
20#include "rocksdb/listener.h"
21#include "rocksdb/options.h"
22#include "rocksdb/status.h"
23#include "rocksdb/table_properties.h"
24#include "rocksdb/types.h"
25#include "table/scoped_arena_iterator.h"
7c673cae 26
f67539c2 27namespace ROCKSDB_NAMESPACE {
7c673cae 28
7c673cae
FG
29struct FileMetaData;
30
20effc67 31class VersionSet;
20effc67 32class BlobFileAddition;
11fdf7f2 33class SnapshotChecker;
7c673cae 34class TableCache;
7c673cae
FG
35class TableBuilder;
36class WritableFileWriter;
37class InternalStats;
1e59de90 38class BlobFileCompletionCallback;
7c673cae 39
1e59de90
TL
40// Convenience function for NewTableBuilder on the embedded table_factory.
41TableBuilder* NewTableBuilder(const TableBuilderOptions& tboptions,
42 WritableFileWriter* file);
7c673cae
FG
43
44// Build a Table file from the contents of *iter. The generated file
45// will be named according to number specified in meta. On success, the rest of
46// *meta will be filled with metadata about the generated table.
47// If no data is present in *iter, meta->file_size will be set to
48// zero, and no Table file will be produced.
49//
50// @param column_family_name Name of the column family that is also identified
51// by column_family_id, or empty string if unknown.
52extern Status BuildTable(
20effc67 53 const std::string& dbname, VersionSet* versions,
1e59de90
TL
54 const ImmutableDBOptions& db_options, const TableBuilderOptions& tboptions,
55 const FileOptions& file_options, TableCache* table_cache,
56 InternalIterator* iter,
494da23a
TL
57 std::vector<std::unique_ptr<FragmentedRangeTombstoneIterator>>
58 range_del_iters,
20effc67 59 FileMetaData* meta, std::vector<BlobFileAddition>* blob_file_additions,
7c673cae
FG
60 std::vector<SequenceNumber> snapshots,
61 SequenceNumber earliest_write_conflict_snapshot,
1e59de90
TL
62 SequenceNumber job_snapshot, SnapshotChecker* snapshot_checker,
63 bool paranoid_file_checks, InternalStats* internal_stats,
20effc67 64 IOStatus* io_status, const std::shared_ptr<IOTracer>& io_tracer,
1e59de90
TL
65 BlobFileCreationReason blob_creation_reason,
66 const SeqnoToTimeMapping& seqno_to_time_mapping,
7c673cae
FG
67 EventLogger* event_logger = nullptr, int job_id = 0,
68 const Env::IOPriority io_priority = Env::IO_HIGH,
1e59de90 69 TableProperties* table_properties = nullptr,
f67539c2 70 Env::WriteLifeTimeHint write_hint = Env::WLTH_NOT_SET,
1e59de90
TL
71 const std::string* full_history_ts_low = nullptr,
72 BlobFileCompletionCallback* blob_callback = nullptr,
73 uint64_t* num_input_entries = nullptr,
74 uint64_t* memtable_payload_bytes = nullptr,
75 uint64_t* memtable_garbage_bytes = nullptr);
7c673cae 76
f67539c2 77} // namespace ROCKSDB_NAMESPACE