backends/flint/flint_table.cc File Reference

#include <config.h>
#include <xapian/error.h>
#include "safeerrno.h"
#include "omassert.h"
#include "stringutils.h"
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "flint_io.h"
#include "flint_table.h"
#include "flint_btreeutil.h"
#include "flint_btreebase.h"
#include "flint_cursor.h"
#include "flint_utils.h"
#include "omdebug.h"
#include "utils.h"
#include <algorithm>
#include <string>
#include <vector>

Include dependency graph for flint_table.cc:

Go to the source code of this file.

Defines

#define REVISION(b)   static_cast<unsigned int>(getint4(b, 0))
#define GET_LEVEL(b)   getint1(b, 4)
#define MAX_FREE(b)   getint2(b, 5)
#define TOTAL_FREE(b)   getint2(b, 7)
#define DIR_END(b)   getint2(b, 9)
#define DIR_START   11
#define SET_REVISION(b, x)   setint4(b, 0, x)
#define SET_LEVEL(b, x)   setint1(b, 4, x)
#define SET_MAX_FREE(b, x)   setint2(b, 5, x)
#define SET_TOTAL_FREE(b, x)   setint2(b, 7, x)
#define SET_DIR_END(b, x)   setint2(b, 9, x)
#define SEQ_START_POINT   (-10)
 Flip to sequential addition block-splitting after this number of observed sequential additions (in negated form).
#define BLOCK_CAPACITY   4
 Even for items of at maximum size, it must be possible to get this number of items in a block.
#define BYTE_PAIR_RANGE   (1 << 2 * CHAR_BIT)

Functions

static void sys_unlink (const string &filename)
static bytezeroed_new (size_t size)
static void sys_unlink_if_exists (const string &filename)
 Delete file, throwing an error if we can't delete it (but not if it doesn't exist).

Variables

const size_t COMPRESS_MIN = 4


Define Documentation

#define REVISION (  )     static_cast<unsigned int>(getint4(b, 0))

Definition at line 183 of file flint_table.cc.

#define GET_LEVEL (  )     getint1(b, 4)

Definition at line 184 of file flint_table.cc.

#define MAX_FREE (  )     getint2(b, 5)

Definition at line 185 of file flint_table.cc.

#define TOTAL_FREE (  )     getint2(b, 7)

Definition at line 186 of file flint_table.cc.

#define DIR_END (  )     getint2(b, 9)

Definition at line 187 of file flint_table.cc.

#define DIR_START   11

Definition at line 188 of file flint_table.cc.

#define SET_REVISION ( b,
 )     setint4(b, 0, x)

Definition at line 190 of file flint_table.cc.

Referenced by Btree::alter(), FlintTable::alter(), Btree::read_root(), FlintTable::read_root(), Btree::split_root(), and FlintTable::split_root().

#define SET_LEVEL ( b,
 )     setint1(b, 4, x)

Definition at line 191 of file flint_table.cc.

Referenced by Btree::read_root(), FlintTable::read_root(), Btree::split_root(), and FlintTable::split_root().

#define SET_MAX_FREE ( b,
 )     setint2(b, 5, x)

Definition at line 192 of file flint_table.cc.

Referenced by Btree::add_item_to_block(), FlintTable::add_item_to_block(), Btree::add_kt(), FlintTable::add_kt(), Btree::compact(), FlintTable::compact(), Btree::delete_item(), FlintTable::delete_item(), Btree::read_root(), and FlintTable::read_root().

#define SET_TOTAL_FREE ( b,
 )     setint2(b, 7, x)

Definition at line 193 of file flint_table.cc.

Referenced by Btree::add_item_to_block(), FlintTable::add_item_to_block(), Btree::add_kt(), FlintTable::add_kt(), Btree::compact(), FlintTable::compact(), Btree::delete_item(), FlintTable::delete_item(), Btree::enter_key(), FlintTable::enter_key(), Btree::read_root(), and FlintTable::read_root().

#define SET_DIR_END ( b,
 )     setint2(b, 9, x)

Definition at line 194 of file flint_table.cc.

Referenced by Btree::add_item(), FlintTable::add_item(), Btree::add_item_to_block(), FlintTable::add_item_to_block(), Btree::delete_item(), FlintTable::delete_item(), Btree::read_root(), FlintTable::read_root(), Btree::split_root(), and FlintTable::split_root().

#define SEQ_START_POINT   (-10)

Flip to sequential addition block-splitting after this number of observed sequential additions (in negated form).

Definition at line 198 of file flint_table.cc.

Referenced by Btree::add_kt(), FlintTable::add_kt(), Btree::cancel(), FlintTable::cancel(), Btree::commit(), FlintTable::commit(), Btree::delete_kt(), FlintTable::delete_kt(), Btree::do_open_to_write(), and FlintTable::do_open_to_write().

#define BLOCK_CAPACITY   4

Even for items of at maximum size, it must be possible to get this number of items in a block.

Definition at line 202 of file flint_table.cc.

Referenced by Btree::basic_open(), and FlintTable::basic_open().

#define BYTE_PAIR_RANGE   (1 << 2 * CHAR_BIT)

Definition at line 218 of file flint_table.cc.

Referenced by Btree::add(), FlintTable::add(), Btree::create(), and FlintTable::set_block_size().


Function Documentation

static void sys_unlink ( const string &  filename  )  [static]

Definition at line 112 of file flint_table.cc.

References msvc_posix_unlink(), and unlink().

Referenced by Btree::write_block(), and FlintTable::write_block().

static byte* zeroed_new ( size_t  size  )  [inline, static]

Definition at line 127 of file flint_table.cc.

References Assert.

Referenced by Btree::basic_open(), FlintTable::basic_open(), Btree::do_open_to_write(), FlintTable::do_open_to_write(), Btree::split_root(), and FlintTable::split_root().

static void sys_unlink_if_exists ( const string &  filename  )  [static]

Delete file, throwing an error if we can't delete it (but not if it doesn't exist).

Definition at line 1633 of file flint_table.cc.

References unlink().

Referenced by Btree::create(), FlintTable::create_and_open(), and FlintTable::erase().


Variable Documentation

const size_t COMPRESS_MIN = 4

Definition at line 85 of file flint_table.cc.

Referenced by FlintTable::add().


Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.