]>
Commit | Line | Data |
---|---|---|
f67539c2 | 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. |
7c673cae FG |
2 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. |
3 | // Use of this source code is governed by a BSD-style license that can be | |
4 | // found in the LICENSE file. See the AUTHORS file for names of contributors. | |
5 | ||
6 | #pragma once | |
7 | ||
8 | #ifndef ROCKSDB_LITE | |
9 | ||
10 | #include <string> | |
11 | #include "rocksdb/options.h" | |
12 | #include "rocksdb/table.h" | |
13 | ||
f67539c2 | 14 | namespace ROCKSDB_NAMESPACE { |
7c673cae FG |
15 | |
16 | struct EnvOptions; | |
17 | ||
7c673cae FG |
18 | class Status; |
19 | class RandomAccessFile; | |
20 | class WritableFile; | |
21 | class Table; | |
22 | class TableBuilder; | |
23 | ||
24 | class AdaptiveTableFactory : public TableFactory { | |
25 | public: | |
26 | ~AdaptiveTableFactory() {} | |
27 | ||
28 | explicit AdaptiveTableFactory( | |
29 | std::shared_ptr<TableFactory> table_factory_to_write, | |
30 | std::shared_ptr<TableFactory> block_based_table_factory, | |
31 | std::shared_ptr<TableFactory> plain_table_factory, | |
32 | std::shared_ptr<TableFactory> cuckoo_table_factory); | |
33 | ||
34 | const char* Name() const override { return "AdaptiveTableFactory"; } | |
35 | ||
20effc67 | 36 | using TableFactory::NewTableReader; |
7c673cae | 37 | Status NewTableReader( |
20effc67 | 38 | const ReadOptions& ro, const TableReaderOptions& table_reader_options, |
494da23a TL |
39 | std::unique_ptr<RandomAccessFileReader>&& file, uint64_t file_size, |
40 | std::unique_ptr<TableReader>* table, | |
7c673cae FG |
41 | bool prefetch_index_and_filter_in_cache = true) const override; |
42 | ||
43 | TableBuilder* NewTableBuilder( | |
44 | const TableBuilderOptions& table_builder_options, | |
45 | uint32_t column_family_id, WritableFileWriter* file) const override; | |
46 | ||
20effc67 | 47 | std::string GetPrintableOptions() const override; |
7c673cae FG |
48 | |
49 | private: | |
50 | std::shared_ptr<TableFactory> table_factory_to_write_; | |
51 | std::shared_ptr<TableFactory> block_based_table_factory_; | |
52 | std::shared_ptr<TableFactory> plain_table_factory_; | |
53 | std::shared_ptr<TableFactory> cuckoo_table_factory_; | |
54 | }; | |
55 | ||
f67539c2 | 56 | } // namespace ROCKSDB_NAMESPACE |
7c673cae | 57 | #endif // ROCKSDB_LITE |