summaryrefslogtreecommitdiff
path: root/include/leveldb/table_builder.h
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-04-19 23:01:25 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-04-19 23:01:25 +0000
commitb743906eeabc925f3e824d91a9747012bf249e2f (patch)
treee7cb4f854196c43045756469627920e4e7b146c1 /include/leveldb/table_builder.h
parentb409afe968b6917574ec08e02c4bf6e6f722e3ca (diff)
downloadleveldb-b743906eeabc925f3e824d91a9747012bf249e2f.tar.gz
Revision created by MOE tool push_codebase.
MOE_MIGRATION= git-svn-id: https://leveldb.googlecode.com/svn/trunk@22 62dab493-f737-651d-591e-8d6aee1b9529
Diffstat (limited to 'include/leveldb/table_builder.h')
-rw-r--r--include/leveldb/table_builder.h86
1 files changed, 0 insertions, 86 deletions
diff --git a/include/leveldb/table_builder.h b/include/leveldb/table_builder.h
deleted file mode 100644
index 49d2d51..0000000
--- a/include/leveldb/table_builder.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// 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.
-//
-// TableBuilder provides the interface used to build a Table
-// (an immutable and sorted map from keys to values).
-
-#ifndef STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_
-#define STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_
-
-#include <stdint.h>
-#include "leveldb/options.h"
-#include "leveldb/status.h"
-
-namespace leveldb {
-
-class BlockBuilder;
-class BlockHandle;
-class WritableFile;
-
-class TableBuilder {
- public:
- // Create a builder that will store the contents of the table it is
- // building in *file. Does not close the file. It is up to the
- // caller to close the file after calling Finish().
- TableBuilder(const Options& options, WritableFile* file);
-
- // REQUIRES: Either Finish() or Abandon() has been called.
- ~TableBuilder();
-
- // Change the options used by this builder. Note: only some of the
- // option fields can be changed after construction. If a field is
- // not allowed to change dynamically and its value in the structure
- // passed to the constructor is different from its value in the
- // structure passed to this method, this method will return an error
- // without changing any fields.
- Status ChangeOptions(const Options& options);
-
- // Add key,value to the table being constructed.
- // REQUIRES: key is after any previously added key according to comparator.
- // REQUIRES: Finish(), Abandon() have not been called
- void Add(const Slice& key, const Slice& value);
-
- // Advanced operation: flush any buffered key/value pairs to file.
- // Can be used to ensure that two adjacent entries never live in
- // the same data block. Most clients should not need to use this method.
- // REQUIRES: Finish(), Abandon() have not been called
- void Flush();
-
- // Return non-ok iff some error has been detected.
- Status status() const;
-
- // Finish building the table. Stops using the file passed to the
- // constructor after this function returns.
- // REQUIRES: Finish(), Abandon() have not been called
- Status Finish();
-
- // Indicate that the contents of this builder should be abandoned. Stops
- // using the file passed to the constructor after this function returns.
- // If the caller is not going to call Finish(), it must call Abandon()
- // before destroying this builder.
- // REQUIRES: Finish(), Abandon() have not been called
- void Abandon();
-
- // Number of calls to Add() so far.
- uint64_t NumEntries() const;
-
- // Size of the file generated so far. If invoked after a successful
- // Finish() call, returns the size of the final generated file.
- uint64_t FileSize() const;
-
- private:
- bool ok() const { return status().ok(); }
- void WriteBlock(BlockBuilder* block, BlockHandle* handle);
-
- struct Rep;
- Rep* rep_;
-
- // No copying allowed
- TableBuilder(const TableBuilder&);
- void operator=(const TableBuilder&);
-};
-
-}
-
-#endif // STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_