summaryrefslogtreecommitdiff
path: root/include/leveldb/table.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.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.h')
-rw-r--r--include/leveldb/table.h69
1 files changed, 0 insertions, 69 deletions
diff --git a/include/leveldb/table.h b/include/leveldb/table.h
deleted file mode 100644
index bd99176..0000000
--- a/include/leveldb/table.h
+++ /dev/null
@@ -1,69 +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.
-
-#ifndef STORAGE_LEVELDB_INCLUDE_TABLE_H_
-#define STORAGE_LEVELDB_INCLUDE_TABLE_H_
-
-#include <stdint.h>
-#include "leveldb/iterator.h"
-
-namespace leveldb {
-
-class Block;
-class BlockHandle;
-struct Options;
-class RandomAccessFile;
-struct ReadOptions;
-
-// A Table is a sorted map from strings to strings. Tables are
-// immutable and persistent.
-class Table {
- public:
- // Attempt to open the table that is stored in bytes [0..file_size)
- // of "file", and read the metadata entries necessary to allow
- // retrieving data from the table.
- //
- // If successful, returns ok and sets "*table" to the newly opened
- // table. The client should delete "*table" when no longer needed.
- // If there was an error while initializing the table, sets "*table"
- // to NULL and returns a non-ok status. Does not take ownership of
- // "*source", but the client must ensure that "source" remains live
- // for the duration of the returned table's lifetime.
- //
- // *file must remain live while this Table is in use.
- static Status Open(const Options& options,
- RandomAccessFile* file,
- uint64_t file_size,
- Table** table);
-
- ~Table();
-
- // Returns a new iterator over the table contents.
- // The result of NewIterator() is initially invalid (caller must
- // call one of the Seek methods on the iterator before using it).
- Iterator* NewIterator(const ReadOptions&) const;
-
- // Given a key, return an approximate byte offset in the file where
- // the data for that key begins (or would begin if the key were
- // present in the file). The returned value is in terms of file
- // bytes, and so includes effects like compression of the underlying data.
- // E.g., the approximate offset of the last key in the table will
- // be close to the file length.
- uint64_t ApproximateOffsetOf(const Slice& key) const;
-
- private:
- struct Rep;
- Rep* rep_;
-
- explicit Table(Rep* rep) { rep_ = rep; }
- static Iterator* BlockReader(void*, const ReadOptions&, const Slice&);
-
- // No copying allowed
- Table(const Table&);
- void operator=(const Table&);
-};
-
-}
-
-#endif // STORAGE_LEVELDB_INCLUDE_TABLE_H_