xapian-core  1.4.27
Classes | Enumerations | Functions | Variables
Glass Namespace Reference

Classes

class  BItem
 
class  BItem_base
 
class  BItem_wr
 
class  Cursor
 
struct  fragment
 
class  Key
 
class  LeafItem
 
class  LeafItem_base
 
class  LeafItem_wr
 
class  PostlistChunkReader
 PostlistChunkReader is essentially an iterator wrapper around a postlist chunk. More...
 
class  PostlistChunkWriter
 PostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details. More...
 
class  RootInfo
 
class  ValueChunkReader
 
class  ValueUpdater
 

Enumerations

enum  table_type {
  POSTLIST, DOCDATA, TERMLIST, POSITION,
  SPELLING, SYNONYM, MAX_
}
 

Functions

uint4 REVISION (const uint8_t *b)
 
int GET_LEVEL (const uint8_t *b)
 
int MAX_FREE (const uint8_t *b)
 
int TOTAL_FREE (const uint8_t *b)
 
int DIR_END (const uint8_t *b)
 
void SET_REVISION (uint8_t *b, uint4 rev)
 
void SET_LEVEL (uint8_t *b, int x)
 
void SET_MAX_FREE (uint8_t *b, int x)
 
void SET_TOTAL_FREE (uint8_t *b, int x)
 
void SET_DIR_END (uint8_t *b, int x)
 
template<typename ITEM1 , typename ITEM2 >
int compare (ITEM1 a, ITEM2 b)
 Compare two items by their keys. More...
 
int compare (BItem a, BItem b)
 Compare two BItem objects by their keys. More...
 
std::string make_valuechunk_key (Xapian::valueno slot, Xapian::docid did)
 Generate a key for a value stream chunk. More...
 
Xapian::docid docid_from_key (Xapian::valueno required_slot, const std::string &key)
 

Variables

const size_t BLOCK_CAPACITY = 4
 Even for items of at maximum size, it must be possible to get this number of items in a block. More...
 
const int BYTES_PER_BLOCK_NUMBER = 4
 
const int K1 = 1
 
const int I2 = 2
 
const int D2 = 2
 
const int X2 = 2
 
const int DIR_START = 11
 
const int I_COMPRESSED_BIT = 0x80
 
const int I_LAST_BIT = 0x40
 
const int I_FIRST_BIT = 0x20
 
const int I_MASK = (I_COMPRESSED_BIT|I_LAST_BIT|I_FIRST_BIT)
 
const int ITEM_SIZE_MASK = (0xffff &~ (I_MASK << 8))
 
const size_t MAX_ITEM_SIZE = (ITEM_SIZE_MASK + 3)
 
const int LEVEL_FREELIST = 254
 Freelist blocks have their level set to LEVEL_FREELIST. More...
 

Enumeration Type Documentation

◆ table_type

Enumerator
POSTLIST 
DOCDATA 
TERMLIST 
POSITION 
SPELLING 
SYNONYM 
MAX_ 

Definition at line 53 of file glass_defs.h.

Function Documentation

◆ compare() [1/2]

template<typename ITEM1 , typename ITEM2 >
int Glass::compare ( ITEM1  a,
ITEM2  b 
)

Compare two items by their keys.

The result is negative if a precedes b, positive is b precedes a, and 0 if a and b are equal. The comparison is for byte sequence collating order, taking lengths into account. So if the keys are made up of lower case ASCII letters we get alphabetical ordering.

Now remember that items are added into the B-tree in fastest time when they are preordered by their keys. This is therefore the piece of code that needs to be followed to arrange for the preordering.

Note that keys have two parts - a string value and a "component_of" count. If the string values are equal, the comparison is made based on "component_of".

Definition at line 930 of file glass_table.h.

References Glass::Key::data(), and Glass::Key::length().

Referenced by GlassTableCheck::block_check(), GlassTable::enter_key_above_leaf(), find_in_branch_(), and GlassTable::find_in_leaf().

◆ compare() [2/2]

int Glass::compare ( BItem  a,
BItem  b 
)
inline

Compare two BItem objects by their keys.

Specialisation for comparing two BItems, where component_of is always explicitly stored.

Definition at line 959 of file glass_table.h.

References Glass::Key::data(), Glass::BItem_base< T >::key(), Glass::Key::length(), and X2.

◆ DIR_END()

int Glass::DIR_END ( const uint8_t *  b)
inline

◆ docid_from_key()

Xapian::docid Glass::docid_from_key ( Xapian::valueno  required_slot,
const std::string &  key 
)
inline

◆ GET_LEVEL()

int Glass::GET_LEVEL ( const uint8_t *  b)
inline

◆ make_valuechunk_key()

std::string Glass::make_valuechunk_key ( Xapian::valueno  slot,
Xapian::docid  did 
)
inline

◆ MAX_FREE()

int Glass::MAX_FREE ( const uint8_t *  b)
inline

◆ REVISION()

uint4 Glass::REVISION ( const uint8_t *  b)
inline

◆ SET_DIR_END()

void Glass::SET_DIR_END ( uint8_t *  b,
int  x 
)
inline

◆ SET_LEVEL()

void Glass::SET_LEVEL ( uint8_t *  b,
int  x 
)
inline

Definition at line 118 of file glass_table.h.

References AssertRel.

Referenced by GlassTable::read_root(), and GlassTable::split_root().

◆ SET_MAX_FREE()

void Glass::SET_MAX_FREE ( uint8_t *  b,
int  x 
)
inline

◆ SET_REVISION()

void Glass::SET_REVISION ( uint8_t *  b,
uint4  rev 
)
inline

Definition at line 117 of file glass_table.h.

References aligned_write4().

Referenced by GlassTable::alter(), GlassTable::read_root(), and GlassTable::split_root().

◆ SET_TOTAL_FREE()

void Glass::SET_TOTAL_FREE ( uint8_t *  b,
int  x 
)
inline

◆ TOTAL_FREE()

int Glass::TOTAL_FREE ( const uint8_t *  b)
inline

Variable Documentation

◆ BLOCK_CAPACITY

const size_t Glass::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 50 of file glass_table.h.

Referenced by GlassTable::basic_open(), and GlassTable::set_max_item_size().

◆ BYTES_PER_BLOCK_NUMBER

const int Glass::BYTES_PER_BLOCK_NUMBER = 4

◆ D2

const int Glass::D2 = 2

◆ DIR_START

const int Glass::DIR_START = 11

◆ I2

const int Glass::I2 = 2

◆ I_COMPRESSED_BIT

const int Glass::I_COMPRESSED_BIT = 0x80

◆ I_FIRST_BIT

const int Glass::I_FIRST_BIT = 0x20

◆ I_LAST_BIT

const int Glass::I_LAST_BIT = 0x40

◆ I_MASK

const int Glass::I_MASK = (I_COMPRESSED_BIT|I_LAST_BIT|I_FIRST_BIT)

Definition at line 130 of file glass_table.h.

◆ ITEM_SIZE_MASK

const int Glass::ITEM_SIZE_MASK = (0xffff &~ (I_MASK << 8))

Definition at line 132 of file glass_table.h.

◆ K1

const int Glass::K1 = 1

◆ LEVEL_FREELIST

const int Glass::LEVEL_FREELIST = 254

Freelist blocks have their level set to LEVEL_FREELIST.

Definition at line 136 of file glass_table.h.

Referenced by GlassFreeList::read_block(), GlassTable::read_block(), and GlassFreeList::write_block().

◆ MAX_ITEM_SIZE

const size_t Glass::MAX_ITEM_SIZE = (ITEM_SIZE_MASK + 3)

Definition at line 133 of file glass_table.h.

Referenced by GlassTable::set_max_item_size().

◆ X2

const int Glass::X2 = 2