~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/leveldb/db/table_cache.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-08 15:54:37 UTC
  • mfrom: (1.1.8) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120608155437-gy3j9k6wzv7w4gn9
Tags: 0.44.1-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - d/control: Switch from libcryptopp to libnss as libcryptopp
    is not seeded.
  - d/control,d/rules: Move from python-support to dh_python2.
  - d/patches/manpage_updates*.patch: cherry picked upstream manpage
    updates warning about lack of encryption, per MIR review.
  - d/rules,d/control: Drop radosgw since libfcgi is not in main and
    the code may not be suitable for LTS.
  - d/rules,d/control: Drop tcmalloc since google perftools is not
    in main yet.
  - d/rules,d/control: Drop ceph-fuse entirely per MIR review
    recommendation.
* d/patches/fix-radosgw-tests.patch: Cherry picked patch from upstream
  VCS to fixup tests to conditionally use radosgw if enabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
 
2
// Use of this source code is governed by a BSD-style license that can be
 
3
// found in the LICENSE file. See the AUTHORS file for names of contributors.
 
4
//
 
5
// Thread-safe (provides internal synchronization)
 
6
 
 
7
#ifndef STORAGE_LEVELDB_DB_TABLE_CACHE_H_
 
8
#define STORAGE_LEVELDB_DB_TABLE_CACHE_H_
 
9
 
 
10
#include <string>
 
11
#include <stdint.h>
 
12
#include "db/dbformat.h"
 
13
#include "leveldb/cache.h"
 
14
#include "leveldb/table.h"
 
15
#include "port/port.h"
 
16
 
 
17
namespace leveldb {
 
18
 
 
19
class Env;
 
20
 
 
21
class TableCache {
 
22
 public:
 
23
  TableCache(const std::string& dbname, const Options* options, int entries);
 
24
  ~TableCache();
 
25
 
 
26
  // Return an iterator for the specified file number (the corresponding
 
27
  // file length must be exactly "file_size" bytes).  If "tableptr" is
 
28
  // non-NULL, also sets "*tableptr" to point to the Table object
 
29
  // underlying the returned iterator, or NULL if no Table object underlies
 
30
  // the returned iterator.  The returned "*tableptr" object is owned by
 
31
  // the cache and should not be deleted, and is valid for as long as the
 
32
  // returned iterator is live.
 
33
  Iterator* NewIterator(const ReadOptions& options,
 
34
                        uint64_t file_number,
 
35
                        uint64_t file_size,
 
36
                        Table** tableptr = NULL);
 
37
 
 
38
  // Evict any entry for the specified file number
 
39
  void Evict(uint64_t file_number);
 
40
 
 
41
 private:
 
42
  Env* const env_;
 
43
  const std::string dbname_;
 
44
  const Options* options_;
 
45
  Cache* cache_;
 
46
};
 
47
 
 
48
}  // namespace leveldb
 
49
 
 
50
#endif  // STORAGE_LEVELDB_DB_TABLE_CACHE_H_