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.
|
|
|
|
|
|
|
|
#ifndef STORAGE_LEVELDB_DB_BUILDER_H_
|
|
|
|
#define STORAGE_LEVELDB_DB_BUILDER_H_
|
|
|
|
|
2013-02-28 22:09:30 +00:00
|
|
|
#include "leveldb/comparator.h"
|
2011-03-30 18:35:40 +00:00
|
|
|
#include "leveldb/status.h"
|
2013-02-28 22:09:30 +00:00
|
|
|
#include "leveldb/types.h"
|
2013-03-15 00:00:04 +00:00
|
|
|
#include "util/storage_options.h"
|
2011-03-18 22:37:00 +00:00
|
|
|
|
|
|
|
namespace leveldb {
|
|
|
|
|
|
|
|
struct Options;
|
|
|
|
struct FileMetaData;
|
|
|
|
|
|
|
|
class Env;
|
|
|
|
class Iterator;
|
|
|
|
class TableCache;
|
|
|
|
class VersionEdit;
|
|
|
|
|
|
|
|
// Build a Table file from the contents of *iter. The generated file
|
|
|
|
// will be named according to meta->number. 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.
|
2011-03-18 22:37:00 +00:00
|
|
|
extern Status BuildTable(const std::string& dbname,
|
|
|
|
Env* env,
|
|
|
|
const Options& options,
|
2013-03-15 00:00:04 +00:00
|
|
|
const StorageOptions& soptions,
|
2011-03-18 22:37:00 +00:00
|
|
|
TableCache* table_cache,
|
|
|
|
Iterator* iter,
|
2013-02-28 22:09:30 +00:00
|
|
|
FileMetaData* meta,
|
|
|
|
const Comparator* user_comparator,
|
|
|
|
const SequenceNumber newest_snapshot,
|
|
|
|
const SequenceNumber earliest_seqno_in_memtable);
|
2011-03-18 22:37:00 +00:00
|
|
|
|
2011-10-31 17:22:06 +00:00
|
|
|
} // namespace leveldb
|
2011-03-18 22:37:00 +00:00
|
|
|
|
|
|
|
#endif // STORAGE_LEVELDB_DB_BUILDER_H_
|