fork of https://github.com/oxigraph/rocksdb and https://github.com/facebook/rocksdb for nextgraph and oxigraph
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.9 KiB
64 lines
1.9 KiB
6 years ago
|
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||
11 years ago
|
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a BSD-style license that can be
|
||
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#ifndef ROCKSDB_LITE
|
||
|
|
||
10 years ago
|
#include <string>
|
||
11 years ago
|
#include "rocksdb/options.h"
|
||
|
#include "rocksdb/table.h"
|
||
|
|
||
|
namespace rocksdb {
|
||
|
|
||
|
struct EnvOptions;
|
||
|
|
||
|
class Status;
|
||
|
class RandomAccessFile;
|
||
|
class WritableFile;
|
||
|
class Table;
|
||
|
class TableBuilder;
|
||
|
|
||
|
class AdaptiveTableFactory : public TableFactory {
|
||
|
public:
|
||
|
~AdaptiveTableFactory() {}
|
||
|
|
||
|
explicit AdaptiveTableFactory(
|
||
11 years ago
|
std::shared_ptr<TableFactory> table_factory_to_write,
|
||
11 years ago
|
std::shared_ptr<TableFactory> block_based_table_factory,
|
||
11 years ago
|
std::shared_ptr<TableFactory> plain_table_factory,
|
||
|
std::shared_ptr<TableFactory> cuckoo_table_factory);
|
||
10 years ago
|
|
||
11 years ago
|
const char* Name() const override { return "AdaptiveTableFactory"; }
|
||
10 years ago
|
|
||
9 years ago
|
Status NewTableReader(
|
||
|
const TableReaderOptions& table_reader_options,
|
||
6 years ago
|
std::unique_ptr<RandomAccessFileReader>&& file, uint64_t file_size,
|
||
|
std::unique_ptr<TableReader>* table,
|
||
9 years ago
|
bool prefetch_index_and_filter_in_cache = true) const override;
|
||
10 years ago
|
|
||
10 years ago
|
TableBuilder* NewTableBuilder(
|
||
|
const TableBuilderOptions& table_builder_options,
|
||
9 years ago
|
uint32_t column_family_id, WritableFileWriter* file) const override;
|
||
11 years ago
|
|
||
10 years ago
|
// Sanitizes the specified DB Options.
|
||
7 years ago
|
Status SanitizeOptions(
|
||
|
const DBOptions& /*db_opts*/,
|
||
|
const ColumnFamilyOptions& /*cf_opts*/) const override {
|
||
10 years ago
|
return Status::OK();
|
||
|
}
|
||
|
|
||
10 years ago
|
std::string GetPrintableTableOptions() const override;
|
||
10 years ago
|
|
||
11 years ago
|
private:
|
||
11 years ago
|
std::shared_ptr<TableFactory> table_factory_to_write_;
|
||
11 years ago
|
std::shared_ptr<TableFactory> block_based_table_factory_;
|
||
|
std::shared_ptr<TableFactory> plain_table_factory_;
|
||
11 years ago
|
std::shared_ptr<TableFactory> cuckoo_table_factory_;
|
||
11 years ago
|
};
|
||
|
|
||
|
} // namespace rocksdb
|
||
|
#endif // ROCKSDB_LITE
|