xapian-core  1.4.26
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
GlassChanges Class Reference

#include <glass_changes.h>

+ Collaboration diagram for GlassChanges:

Public Member Functions

 GlassChanges (const std::string &db_dir)
 
 ~GlassChanges ()
 
GlassChangesstart (glass_revision_number_t old_rev, glass_revision_number_t rev, int flags)
 
void write_block (const char *p, size_t len)
 
void write_block (const std::string &s)
 
void set_oldest_changeset (glass_revision_number_t rev)
 
glass_revision_number_t get_oldest_changeset () const
 
void commit (glass_revision_number_t new_rev, int flags)
 

Static Public Member Functions

static void check (const std::string &changes_file)
 

Private Attributes

int changes_fd
 File descriptor to write changeset to (or -1 for none). More...
 
std::string changes_stem
 
glass_revision_number_t max_changesets
 The maximum number of changesets to keep. More...
 
glass_revision_number_t oldest_changeset
 The oldest changeset which might exist on disk. More...
 

Detailed Description

Definition at line 28 of file glass_changes.h.

Constructor & Destructor Documentation

◆ GlassChanges()

GlassChanges::GlassChanges ( const std::string &  db_dir)
inlineexplicit

Definition at line 50 of file glass_changes.h.

References start(), write_block(), and ~GlassChanges().

◆ ~GlassChanges()

GlassChanges::~GlassChanges ( )

Definition at line 43 of file glass_changes.cc.

References close(), and io_unlink().

Referenced by GlassChanges().

Member Function Documentation

◆ check()

void GlassChanges::check ( const std::string &  changes_file)
static

◆ commit()

void GlassChanges::commit ( glass_revision_number_t  new_rev,
int  flags 
)

◆ get_oldest_changeset()

glass_revision_number_t GlassChanges::get_oldest_changeset ( ) const
inline

Definition at line 71 of file glass_changes.h.

References check(), commit(), and oldest_changeset.

Referenced by GlassWritableDatabase::flush_postlist_changes().

◆ set_oldest_changeset()

void GlassChanges::set_oldest_changeset ( glass_revision_number_t  rev)
inline

Definition at line 67 of file glass_changes.h.

Referenced by GlassDatabase::open_tables().

◆ start()

GlassChanges * GlassChanges::start ( glass_revision_number_t  old_rev,
glass_revision_number_t  rev,
int  flags 
)

◆ write_block() [1/2]

void GlassChanges::write_block ( const char *  p,
size_t  len 
)

Definition at line 105 of file glass_changes.cc.

References io_write().

Referenced by GlassChanges(), GlassVersion::write(), and write_block().

◆ write_block() [2/2]

void GlassChanges::write_block ( const std::string &  s)
inline

Definition at line 63 of file glass_changes.h.

References write_block().

Member Data Documentation

◆ changes_fd

int GlassChanges::changes_fd
private

File descriptor to write changeset to (or -1 for none).

Definition at line 30 of file glass_changes.h.

◆ changes_stem

std::string GlassChanges::changes_stem
private

Definition at line 32 of file glass_changes.h.

◆ max_changesets

glass_revision_number_t GlassChanges::max_changesets
private

The maximum number of changesets to keep.

If a slave is more than this number of changesets behind, it will need to be sent a full copy of the database (which can be more efficient if a lot has changed).

Definition at line 40 of file glass_changes.h.

◆ oldest_changeset

glass_revision_number_t GlassChanges::oldest_changeset
private

The oldest changeset which might exist on disk.

Used to optimise removal of old changesets by giving us a point to start looking for ones to delete.

Definition at line 47 of file glass_changes.h.

Referenced by get_oldest_changeset().


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