xapian-core  2.0.0
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
HoneyFreeList Class Reference

#include <honey_freelist.h>

+ Collaboration diagram for HoneyFreeList:

Public Member Functions

 HoneyFreeList ()
 
void reset ()
 
 ~HoneyFreeList ()
 
bool empty () const
 
uint4 get_block (const HoneyTable *B, uint4 block_size, uint4 *blk_to_free=NULL)
 
uint4 walk (const HoneyTable *B, uint4 block_size, bool inclusive)
 
void mark_block_unused (const HoneyTable *B, uint4 block_size, uint4 n)
 
uint4 get_revision () const
 
void set_revision (uint4 revision_)
 
uint4 get_first_unused_block () const
 
void set_first_unused_block (uint4 base)
 
void commit (const HoneyTable *B, uint4 block_size)
 
void pack (std::string &buf)
 
bool unpack (const char **pstart, const char *end)
 
bool unpack (const std::string &s)
 

Protected Attributes

uint4 revision = 0
 
uint4 first_unused_block = 0
 
HoneyFLCursor fl
 
HoneyFLCursor fl_end
 
HoneyFLCursor flw
 
bool flw_appending = false
 

Private Member Functions

 HoneyFreeList (const HoneyFreeList &)
 
void operator= (const HoneyFreeList &)
 
void read_block (const HoneyTable *B, uint4 n, uint8_t *p)
 
void write_block (const HoneyTable *B, uint4 n, uint8_t *p, uint4 rev)
 

Private Attributes

uint8_t * p = nullptr
 Current freelist block. More...
 
uint8_t * pw = nullptr
 Current freelist block we're writing. More...
 

Detailed Description

Definition at line 65 of file honey_freelist.h.

Constructor & Destructor Documentation

◆ HoneyFreeList() [1/2]

HoneyFreeList::HoneyFreeList ( const HoneyFreeList )
private

◆ HoneyFreeList() [2/2]

HoneyFreeList::HoneyFreeList ( )
inline

Definition at line 91 of file honey_freelist.h.

◆ ~HoneyFreeList()

HoneyFreeList::~HoneyFreeList ( )
inline

Definition at line 99 of file honey_freelist.h.

References p, and pw.

Member Function Documentation

◆ commit()

void HoneyFreeList::commit ( const HoneyTable B,
uint4  block_size 
)

Definition at line 249 of file honey_freelist.cc.

References aligned_read4(), Assert, FREELIST_END, p, Xapian::revision(), and UNUSED.

◆ empty()

bool HoneyFreeList::empty ( ) const
inline

Definition at line 101 of file honey_freelist.h.

References fl, and fl_end.

◆ get_block()

uint4 HoneyFreeList::get_block ( const HoneyTable B,
uint4  block_size,
uint4 blk_to_free = NULL 
)

◆ get_first_unused_block()

uint4 HoneyFreeList::get_first_unused_block ( ) const
inline

Definition at line 113 of file honey_freelist.h.

References first_unused_block.

Referenced by HoneyFreeListChecker::HoneyFreeListChecker().

◆ get_revision()

uint4 HoneyFreeList::get_revision ( ) const
inline

Definition at line 110 of file honey_freelist.h.

References revision.

◆ mark_block_unused()

void HoneyFreeList::mark_block_unused ( const HoneyTable B,
uint4  block_size,
uint4  n 
)

◆ operator=()

void HoneyFreeList::operator= ( const HoneyFreeList )
private

◆ pack()

void HoneyFreeList::pack ( std::string &  buf)
inline

Definition at line 120 of file honey_freelist.h.

References first_unused_block, fl, flw, HoneyFLCursor::pack(), pack_uint(), and revision.

Referenced by HoneyDatabase::compact().

◆ read_block()

void HoneyFreeList::read_block ( const HoneyTable B,
uint4  n,
uint8_t *  p 
)
private

Definition at line 59 of file honey_freelist.cc.

References Glass::GET_LEVEL(), Glass::LEVEL_FREELIST, and rare.

◆ reset()

void HoneyFreeList::reset ( )
inline

Definition at line 93 of file honey_freelist.h.

References first_unused_block, flw_appending, and revision.

◆ set_first_unused_block()

void HoneyFreeList::set_first_unused_block ( uint4  base)
inline

Definition at line 116 of file honey_freelist.h.

References first_unused_block.

Referenced by HoneyDatabase::compact().

◆ set_revision()

void HoneyFreeList::set_revision ( uint4  revision_)
inline

Definition at line 111 of file honey_freelist.h.

References revision.

◆ unpack() [1/2]

bool HoneyFreeList::unpack ( const char **  pstart,
const char *  end 
)
inline

Definition at line 127 of file honey_freelist.h.

References first_unused_block, fl, fl_end, flw, flw_appending, revision, HoneyFLCursor::unpack(), and unpack_uint().

Referenced by unpack().

◆ unpack() [2/2]

bool HoneyFreeList::unpack ( const std::string &  s)
inline

Definition at line 139 of file honey_freelist.h.

References unpack().

◆ walk()

uint4 HoneyFreeList::walk ( const HoneyTable B,
uint4  block_size,
bool  inclusive 
)

Definition at line 143 of file honey_freelist.cc.

References aligned_read4(), Assert, C_BASE, FREELIST_END, p, and UNUSED.

◆ write_block()

void HoneyFreeList::write_block ( const HoneyTable B,
uint4  n,
uint8_t *  p,
uint4  rev 
)
private

Member Data Documentation

◆ first_unused_block

uint4 HoneyFreeList::first_unused_block = 0
protected

Definition at line 77 of file honey_freelist.h.

Referenced by get_first_unused_block(), pack(), reset(), set_first_unused_block(), and unpack().

◆ fl

HoneyFLCursor HoneyFreeList::fl
protected

Definition at line 79 of file honey_freelist.h.

Referenced by empty(), pack(), and unpack().

◆ fl_end

HoneyFLCursor HoneyFreeList::fl_end
protected

Definition at line 79 of file honey_freelist.h.

Referenced by empty(), and unpack().

◆ flw

HoneyFLCursor HoneyFreeList::flw
protected

Definition at line 79 of file honey_freelist.h.

Referenced by pack(), and unpack().

◆ flw_appending

bool HoneyFreeList::flw_appending = false
protected

Definition at line 81 of file honey_freelist.h.

Referenced by reset(), and unpack().

◆ p

uint8_t* HoneyFreeList::p = nullptr
private

Current freelist block.

Definition at line 85 of file honey_freelist.h.

Referenced by ~HoneyFreeList().

◆ pw

uint8_t* HoneyFreeList::pw = nullptr
private

Current freelist block we're writing.

Definition at line 88 of file honey_freelist.h.

Referenced by ~HoneyFreeList().

◆ revision

uint4 HoneyFreeList::revision = 0
protected

Definition at line 75 of file honey_freelist.h.

Referenced by get_revision(), pack(), reset(), set_revision(), and unpack().


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