2013-10-16 21:59:46 +00:00
|
|
|
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
|
|
|
|
// This source code is licensed under the BSD-style license found in the
|
|
|
|
// LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
// of patent rights can be found in the PATENTS file in the same directory.
|
2011-03-18 22:37:00 +00:00
|
|
|
// 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.
|
2013-10-05 05:32:05 +00:00
|
|
|
#pragma once
|
2013-08-23 15:38:13 +00:00
|
|
|
#include "rocksdb/comparator.h"
|
|
|
|
#include "rocksdb/status.h"
|
|
|
|
#include "rocksdb/types.h"
|
2013-10-30 17:52:33 +00:00
|
|
|
#include "rocksdb/options.h"
|
2011-03-18 22:37:00 +00:00
|
|
|
|
2013-10-04 04:49:15 +00:00
|
|
|
namespace rocksdb {
|
2011-03-18 22:37:00 +00:00
|
|
|
|
|
|
|
struct Options;
|
|
|
|
struct FileMetaData;
|
|
|
|
|
|
|
|
class Env;
|
2013-11-13 04:05:28 +00:00
|
|
|
struct EnvOptions;
|
2011-03-18 22:37:00 +00:00
|
|
|
class Iterator;
|
|
|
|
class TableCache;
|
|
|
|
class VersionEdit;
|
2013-10-29 00:54:09 +00:00
|
|
|
class TableBuilder;
|
|
|
|
class WritableFile;
|
|
|
|
|
2014-01-27 21:53:22 +00:00
|
|
|
extern TableBuilder* NewTableBuilder(
|
|
|
|
const Options& options, const InternalKeyComparator& internal_comparator,
|
|
|
|
WritableFile* file, CompressionType compression_type);
|
2011-03-18 22:37:00 +00:00
|
|
|
|
|
|
|
// Build a Table file from the contents of *iter. The generated file
|
2014-06-13 22:54:19 +00:00
|
|
|
// will be named according to number specified in meta. On success, the rest of
|
2011-06-22 02:36:45 +00:00
|
|
|
// *meta will be filled with metadata about the generated table.
|
|
|
|
// If no data is present in *iter, meta->file_size will be set to
|
|
|
|
// zero, and no Table file will be produced.
|
2014-01-27 21:53:22 +00:00
|
|
|
extern Status BuildTable(const std::string& dbname, Env* env,
|
|
|
|
const Options& options, const EnvOptions& soptions,
|
|
|
|
TableCache* table_cache, Iterator* iter,
|
2013-02-28 22:09:30 +00:00
|
|
|
FileMetaData* meta,
|
2014-01-27 21:53:22 +00:00
|
|
|
const InternalKeyComparator& internal_comparator,
|
2013-02-28 22:09:30 +00:00
|
|
|
const SequenceNumber newest_snapshot,
|
2013-10-17 20:33:39 +00:00
|
|
|
const SequenceNumber earliest_seqno_in_memtable,
|
2013-12-19 18:02:53 +00:00
|
|
|
const CompressionType compression);
|
2011-03-18 22:37:00 +00:00
|
|
|
|
2013-10-04 04:49:15 +00:00
|
|
|
} // namespace rocksdb
|