Logo Search packages:      
Sourcecode: xapian-core version File versions  Download package

FlintTable Class Reference

#include <flint_table.h>

Inheritance diagram for FlintTable:


List of all members.

Detailed Description

Class managing a Btree table in a Flint database.

A table is a store holding a set of key/tag pairs.

A key is used to access a block of data in a flint table.

Keys are of limited length.

Keys may not be empty (each Btree has a special empty key for internal use).

A tag is a piece of data associated with a given key. The contents of the tag are opaque to the Btree.

Tags may be of arbitrary length (the Btree imposes a very large limit). Note though that they will be loaded into memory in their entirety, so should not be permitted to grow without bound in normal usage.

Tags which are null strings _are_ valid, and are different from a tag simply not being in the table.

Definition at line 239 of file flint_table.h.

Public Member Functions

bool add (const string &key, string tag)
void cancel ()
void close ()
void commit (flint_revision_number_t revision)
void create (unsigned int blocksize)
FlintCursorcursor_get () const
bool del (const string &key)
bool exists () const
bool find_tag (const string &key, string *tag) const
 FlintTable (string path_, bool readonly_)
flint_tablesize_t get_entry_count () const
bool get_exact_entry (const string &key, string &tag) const
flint_revision_number_t get_latest_revision_number () const
flint_revision_number_t get_open_revision_number () const
bool is_modified () const
bool open (flint_revision_number_t revision_)
void open ()
void read_tag (Cursor_ *C_, string *tag) const
void set_full_compaction (bool parity)
void set_max_item_size (size_t block_capacity)
 ~FlintTable ()

Protected Member Functions

void add_item (Item_wr_ kt, int j)
void add_item_to_block (byte *p, Item_wr_ kt, int c)
int add_kt (bool found)
void alter ()
bool basic_open (bool revision_supplied, flint_revision_number_t revision)
void block_to_cursor (Cursor_ *C_, int j, uint4 n) const
void compact (byte *p)
void delete_item (int j, bool repeatedly)
int delete_kt ()
void do_open_to_read (bool revision_supplied, flint_revision_number_t revision_)
bool do_open_to_write (bool revision_supplied, flint_revision_number_t revision_)
void enter_key (int j, Key_ prevkey, Key_ newkey)
bool find (Cursor_ *) const
void form_key (const string &key) const
int mid_point (byte *p)
bool next (Cursor_ *C_, int j) const
bool next_default (Cursor_ *C_, int j) const
bool next_for_sequential (Cursor_ *C_, int dummy) const
bool prev (Cursor_ *C_, int j) const
bool prev_default (Cursor_ *C_, int j) const
bool prev_for_sequential (Cursor_ *C_, int dummy) const
void read_block (uint4 n, byte *p) const
 read_block(n, p) reads block n of the DB file to address p.
void read_root ()
void set_overwritten () const
void split_root (uint4 split_n)
void write_block (uint4 n, const byte *p) const

Static Protected Member Functions

static uint4 block_given_by (const byte *p, int c)
static int find_in_block (const byte *p, Key_ key, bool leaf, int c)

Protected Attributes

FlintTable_base base
 For writing back as file baseA or baseB.
int base_letter
unsigned int block_size
bool both_bases
bool Btree_modified
 Set to true the first time the B-tree is modified.
byte * buffer
 buffer of size block_size for reforming blocks
int changed_c
uint4 changed_n
bool dont_close_handle
 Set to true if we shouldn't close handle ourselves.
bool faked_root_block
bool full_compaction
 set to true when full compaction is to be achieved
int handle
 corresponding file handle
uint4 item_count
Item_wr_ kt
 buffer of size block_size for making up key-tag items
flint_revision_number_t latest_revision_number
int level
 number of levels, counting from 0
size_t max_item_size
 maximum size of an item (key-tag pair)
string name
 The path name of the B tree.
bool(FlintTable::* next_ptr )(Cursor_ *, int) const
char other_base_letter
 The base letter ('B' or 'A') of the next base.
bool(FlintTable::* prev_ptr )(Cursor_ *, int) const
flint_revision_number_t revision_number
uint4 root
 the root block of the B-tree
int seq_count
bool sequential
byte * split_p
bool writable
 Set to true when the database is opened to write.

Private Member Functions

 FlintTable (const FlintTable &)
 Copying not allowed.
FlintTableoperator= (const FlintTable &)
 Assignment not allowed.


class FlintCursor

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index